Type Alias SimulationKind

SimulationKind:
    | "static"
    | "sand"
    | "water"
    | "oil"
    | "napalm"
    | "gas"
    | "fire"

How a material behaves under the cellular-automaton simulation step.

Vertical motion follows a density ordering — heavier sinks, lighter rises. Density ranks (high → low):

static  >  sand (5)  >  water (4)  >  oil (3)  >  napalm (2.5)
                     >  fire (2)  >  air  (1)  >  gas (0)

Two cells of different ranks swap places when doing so brings the heavier one closer to the floor. 'static' materials never swap.

  • 'static' — doesn't move; only Carve / Deposit / debris detection change static cells. Default when omitted (back-compat with v1 definitions).
  • 'sand' — granular: falls straight down (swapping into any lower-rank fluid), slides diagonally into pure air. Doesn't move horizontally.
  • 'water' — liquid: falls straight down (density swap), then diagonal-down into air, then horizontal multi-cell flow into air. Pools level off over a few ticks.
  • 'oil' — liquid lighter than water: falls into air / gas only (rank 3 vs water rank 4 means oil floats on water), otherwise spreads horizontally.
  • 'napalm' — flammable liquid lighter than oil (rank 2.5). Same flow rules as 'oil' — sinks into air/gas, floats on oil/water — but distinguished in the unified-pool density sort so it surfaces above oil. Pair with flammable: true so adjacent fire ignites the pool.
  • 'gas' — lighter than air: rises straight up (density swap), diagonal-up, horizontal spread. Bubbles up through liquids.
  • 'fire' — doesn't translate. Each tick, ignites one adjacent flammable neighbor (converting it to fire). After burnDuration ticks, the cell turns to air. Re-uses the per-cell timer storage that 'sand' settling already lazily allocates.

Only 'static' materials generate Box2D colliders. Fluid mutations therefore don't trigger per-frame physics rebuilds.