Fluid/Gas System
Fluids and gases should be stored and simulated outside the normal voxel volume.
Goals
- heavy liquid should flow downwards
- light gases should flow upwards
- biomes should have an associated liquid/fog block. Whenever a block in that biome is broken, the gap must get filled with the right fog/fluid block
- Fluids/Gases should exist in seperate memory to allow for underwater fences and similar
- Fluids should not propagate endlessly, flooding the entire world
Relaxations
- fluid volume does not need to be preserved
- the flow does not need to be realistic
- big bodies of water like the ocean can be assumed as infinite, as long as they don't flood the entire underground
We cannot mix gases like on the left, since this will create an exponential amount of gas types.
Oxygen not included has a gas system which I believe allows only one gas type per tile, what we could have would be similarly constrained I think. Are there any other games with similar systems?
We could write gases as vectors (smoke, cloud, poison, ...) as long as we
- control their proliferation (unlike rotation modes)
- decide their color in O(d) time/space using maths instead of lookup tables
Mixed gases are also problematic since every border between different gas color/density needs a transparent face, which makes every biome with mixed gases a lag biome.
Then we could have fluid glob together at a uniform density to reduce the number of faces to render. If they glob independently then we only have to deal with O(liquid dimensions) faces. We could also assign several levels of fluid to the same transparency to have the same dynamics without adding extra faces.