Cubyz icon indicating copy to clipboard operation
Cubyz copied to clipboard

Fluid/Gas System

Open IntegratedQuantum opened this issue 2 years ago • 6 comments

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

IntegratedQuantum avatar Sep 17 '23 12:09 IntegratedQuantum

Image

ikabod-kee avatar May 26 '25 01:05 ikabod-kee

We cannot mix gases like on the left, since this will create an exponential amount of gas types.

IntegratedQuantum avatar May 26 '25 15:05 IntegratedQuantum

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?

Argmaster avatar May 26 '25 15:05 Argmaster

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

archbirdplus avatar May 27 '25 16:05 archbirdplus

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.

IntegratedQuantum avatar May 27 '25 17:05 IntegratedQuantum

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.

archbirdplus avatar May 27 '25 17:05 archbirdplus