Biomes and height — terrain as derived scalars

Nothing on this page is wired to the game. It is where the council in docs/BIOME_HEIGHT_COUNCIL.md gets proven or broken. Every number below is a slider, and the defaults ARE the proposal. Play to a version you like and the slider readouts are what goes to powersConfig.

Changes

iteration 1 — first build. Four approved global rules made concrete: biome is derived, elevation and saturation are two orthogonal fields, ground does not flow, and terrain renders per tile instead of per pixel. Band cutoffs default 3 / 6 / 11 on a 0-15 scale. Rain does not flood a ground-level field; Downpour does, and it drains back. Deep valleys are bistable in both directions.

THE MODEL, IN FOUR LINES.
elev is an integer 0-15, banded deepest / deep / ground / high. It never diffuses and only a god moves it.
sat is water held on top of that tile, never measured from sea level. It diffuses and it relaxes toward a rest value.
The band alone decides which saturation states are stable. That is the whole mechanism.
Biome is read off the two. No power writes a biome name.

1. The sandbox

Pick a brush and drag on the map. Eruption and Raze push elev; Rain, Downpour and Heatwave push sat. There are no cooldowns and no lava, and Eruption applies instantly, so you can feel the shape of the powers rather than wait for them. Hover any tile for its two numbers and what they derive to. The sim ticks once a second, the way the real diffusion pass would.

brush render
Under the cursor
Hover the map.
This tick
Legend

2. Where the band cutoffs sit

Elevation is a 0-15 integer so that Eruption's +1 to +4 profile has somewhere to land and Raze has something to subtract. Your four bands are ranges on that scale, and these three sliders are where they divide. This is the set of numbers most worth playing with: they decide how much of a generated map is floodable at all.

deepest ≤ 3 deep ≤ 6 ground ≤ 11

3. What makes a state stable

A tile's saturation relaxes toward a rest value the band decides, and nothing else. There is no neighbour search and no stored rest field: the band is the anchor, which is what stops a diffusing field flattening into one uniform value. The deep band has two rest values rather than one, and that single fact is what makes a flooded valley stay flooded and a drained one stay drained.

bandrest saturationstable stateswhat a god sees
deepest100, pulled hard, plus edge healingwet onlyOcean. Heatwave pushes the shoreline and it comes back.
deep100 if already wet, 0 if already drywet AND dryLake or valley, same ground. Rain floods it and it stays. Heatwave drains it and it stays.
ground0, drained fasterdry onlyField. Downpour floods it; it drains back by itself.
high0, and capped below the waterlinedry onlyMountain. Will not hold water even for a moment.
water at 50 relax 0.06 diffuse 0.02 ground drains 4.0× edge heal 0.30 / width 6

4. The two powers that write elevation

Eruption and Raze stop transforming biome names and start pushing a number. Everything that used to be a special case becomes arithmetic: an eruption in the sea raises the seabed, and if it clears the water an island appears — which is the ruling already made, arriving as physics rather than as a clause somebody has to remember not to gate. Raze is its inverse, and a Raze deep enough digs a basin that then fills.

eruption r 4 inner +1..4 outer +0..2 raze r 3 −2 rain 8 downpour 24 heat 18

5. The render cost, which is why any of this is affordable

The council's hardest constraint was that a biome flip cost a full buildTerrainCache(), re-measured this session at ~128ms, of which 65-74% is the per-pixel border contest that blends a 9px band between tiles of differing biome. Deleting that pass deletes the constraint. Toggle the renderer in section 1 and compare the two numbers below: flat is one fill per tile with a deterministic per-tile texture and no neighbour reads, blended is a stand-in for the contest.

Scale the blended figure up honestly before quoting it: this canvas is 600×600 = 360,000 pixels and the real terrain canvas is 2000×2000 = 4,000,000, about 11× more. The point is not the absolute number, it is that one of these grows with pixels and the other grows with changed tiles.

6. What this page has not decided

questionthe constraint it sits againstrecommendation
One axis or twoNo shipped power writes a temperature; the ground layer is a three-value enum and the config says "cold does not exist yet"SETTLED. Two orthogonal scalars, elevation and saturation. Not Whittaker.
Where height fits36.9% of river tiles are painted onto mountain, so water above sea level is normal, not an edge caseSETTLED. Elevation is its own field. Eruption raises it rather than painting a tile.
Deep grass / crater tileRepo grep: seven biomes, no eighth; crater is eruption cone artSETTLED. Nothing to delete. The model makes a caldera expressible later, which is a purchase, not a refund.
Forest: biome or a tile.trees bitForest is 1.7× enriched on freshwater shores and separates from grass by 0.93 tiles, so it is not derivable from either scalarKeep it a biome, simply not derived. Free, and the docs must then say "the ground class is derived" rather than overclaiming. The bit is ~78 sites and can come later.
Two scalars on the wireJoin payload measured at 583.7 KB, sent twice, perMessageDeflate offTurn on compression first and re-measure. Terrain JSON compresses well and it likely swamps the increase while shrinking today's payload.
Does the autotile pass ever landFlat tiles lose ocean depth bands, blended borders, beach rims and canopy bleedShip flat, judge it in play, then decide. An autotile set is O(1) per tile and never reintroduces a per-pixel contest.
River as a flagUnder bands the channel survives drying because it lives in elevation, so a dried river refills along the same courseKeep a flag for the passability and rendering difference only. The channel no longer needs authoring to survive.
Hysteresis widthA tile parked on a threshold flips every tick forever: strobing, and a re-bake per tick under the old rendererStill wanted, but far less urgent once a flip is one fill. Tune it here once the band cutoffs settle.