System Rain

Prozix

New Member
Reaction score
7
Then the system must perform an additional 400*32 (12800) complex calculations per second to perform something that probably detracts from the point of the system. Not a bad thought, but rain forms streams more than clumps... :p

What if you divide the rain area in several smaller areas :p. Ultimately updating more and more rain drops in puddles will take more calculations per second.... ultimately.

Hahah I set the lifespan ticks to 200 and changed the timer speed to 0.01. The world was being shot by blue bullets xD
 

Jesus4Lyf

Good Idea™
Reaction score
397
What if you divide the rain area in several smaller areas :p. Ultimately updating more and more rain drops in puddles will take more calculations per second.... ultimately.
Excuse me, 400*32 was wrong, it should be 80,000*32 (2,560,000). The distribution of the drops is irrelevant. It's O(n^2) for manual collision detection of locusted units.
 

Lyerae

I keep popping up on this site from time to time.
Reaction score
105
Excuse me, 400*32 was wrong, it should be 80,000*32 (2,560,000). The distribution of the drops is irrelevant. It's O(n^2) for manual collision detection of locusted units.

My brain hurts now, honestly. :nuts: :banghead:
 

quraji

zap
Reaction score
144
I think it would be 80,200 operations to check collisions between 400 units. O(n^2) is excessive (which for 400 drops would be 160,000 not 80,000 right?)..

Also, wouldn't it be less since you would only be considering the raindrops that are not falling? And would it shrink further as any "puddles" got larger (if you would consider the puddle to be one large drop)?

Just wondering.
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
889
I put LIFESPAN_TICKS at 2000 and the fps leveled out around 10-15, with it going below 10 when I would head over to the bottom right corner where lots of the drops liked to congregate. :)
 

Joker(Div)

Always Here..
Reaction score
86
Change tile to snowy, Model to frost breath, size to 3, and volia! IT'S SNOWING!
lk0ex.jpg
 

Prozix

New Member
Reaction score
7
Excuse me, 400*32 was wrong, it should be 80,000*32 (2,560,000). The distribution of the drops is irrelevant. It's O(n^2) for manual collision detection of locusted units.

Sorry, I wasn't clear, again...

attachment.php


The green dot is in the area C3, so collision checking needs to occur only with units in the area C3. The blue dot is in the areas (A,B)(4,5) so this one needs to check collisions with units in 4 areas.

I'm wondering if the indexing of the units in areas every now and then can result in a performance optimization.

Lets say we have 4 areas with in all of those 10 units. Normally this would take 40+39+38...+1 = (40²-40)/2 = 780 calculations
With the units indexed this would approximately take 4*(10+9+8...+1) = 180 calculations.
If you double calculate the differences (n²) then it becomes 1600 vs 400.

The problem would be the algorithm to accomplish this...

(and btw isn't it 400²/2-200 = 79800?)
 

Attachments

  • CollisionSquareIndexing.GIF
    CollisionSquareIndexing.GIF
    2.6 KB · Views: 459

Jesus4Lyf

Good Idea™
Reaction score
397
As far as I know, it is not possible to enumerate locusted units an an area whatsoever. Hence, as far as I know, I would have to compare all raindrops to all other raindrops. :)

There's probably optimisations which could be done, but it just isn't going to happen. It wasn't the objective for this system...
 

Prozix

New Member
Reaction score
7
You'd have to list them at creation?
Well I was just wondering if what I said was possible :p
 

quraji

zap
Reaction score
144
>The green dot is in the area C3, so collision checking needs to occur only with units in the area C3. The blue dot is in the areas (A,B)(4,5) so this one needs to check collisions with units in 4 areas.

What if a raindrop was in the center-right of one cell, and another in the center-left of an adjacent cell to the first cell's right? Wouldn't they merge?

>(and btw isn't it 400²/2-200 = 79800?)

Edit: That's correct, I made an error.
 

Prozix

New Member
Reaction score
7
>What if a raindrop was in the center-right of one cell, and another in the center-left of an adjacent cell to the first cell's right? Wouldn't they merge?

they can be in multiple areas like it said:

>>The blue dot is in the areas (A,B)(4,5) so this one needs to check collisions with units in 4 areas.

Wouldn't full collision checking be 400*(400-1) ?
 

quraji

zap
Reaction score
144
>they can be in multiple areas like it said:

I guess my scenario isn't really a problem. Only in a perfect world :p

>Wouldn't full collision checking be 400*(400-1) ?

Full as in checking every drop against every other drop only once, n*(n-1) would be excessive (it would check drops A vs. B, then later B vs. A which isn't necessary).
 

Prozix

New Member
Reaction score
7
>I guess my scenario isn't really a problem. Only in a perfect world:p
Well I think that if they collide, the radius's (radiusi? radia? radiusculae?) have to overlap, when they overlap one another at least one of them has got to cover multiple area's because the indexing should be done like this: (UnitX-UnitR < RectMaxX and UnitX+UnitR > RectMinX) and (something similar for Y)

>Well if you check each drop against eachother the equotation becomes 0.5(n-1)n
Imagine 4 points, the first one connecting with 3 others, the next one only has to connect with 2, the third one with 1 and the last one with 0 because it was already connected by all points. That makes 3+2+1 = 6
5 points make 4+3+2+1 connections -> (4+1)+(3+2) = 2*5
6 points: (5+1)+(4+2)+3 -> 2*6+3 = 2.5*6
n points: ((n-1)+1)+((n-2)+2) ... = eugh I suck at explaining it but I figured that the formula becomes (n²-n)/2 :)
 

quraji

zap
Reaction score
144
Yes, that's the formula I was describing when I said: (n-1)+(n-2)+(n-3)...+(n-n), but I an error when I actually calculated it :p

>Well I think that if they collide, the radius's (radiusi? radia? radiusculae?) have to overlap, when they overlap one another at least one of them has got to cover multiple area's because the indexing should be done like this: (UnitX-UnitR < RectMaxX and UnitX+UnitR > RectMinX) and (something similar for Y)

Also true, I was thinking as if the drops would have 0 radii and would merge when they were within a certain distance, instead of merging when their radii intersected. That would be where the problem of being "close enough to merge" but being in separate grid cells would arise. Didn't really spend time thinking it through I guess :p
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top