Because I haven’t wasted enough time on this project yet.
Reply chain from #17
it uhh… yep
its not based off anything in real life. i just threw in numbers until it looked good.
is it like a full on fluid sim, or is it more of a floodfill gas thing
each chunk is handled separately, each block has the gases and velocity (cause simulating billions of particles would be uhhh… yeah).
each tick, each block (in a random order) decides how much it needs to push to neighboring blocks. it pushes out however much it needs to to return to 1 pressure + 6/7 of the gas in that block (it also supports multiple gas types at the same time)
then it decides how much of the amount to push out, should each neighbor get. this depends on the neighbor velocity dot product this velocity, the difference in pressure between the neighbor and this block, etc.
then it moves it and adjusts the velocity of the current block according to how much it pushed in that direction.
if the amount of a gas in a block ever drops below a threshold, destroy the gas.
This conversation is on Discord · Reply there