Rebuild lake generation: bowls in valleys filled to their spill level (t96)

Lakes no longer pour water to a guessed lip and repair it afterwards. Each lake lowers the land
in the nearest valley with a smoothstep bowl, and water fills it to its spill level (the lower of
the highest ground on each side, Priority-Flood in one dimension), so it is flat and contained by
construction. Clay beds, no caves or loose pockets close under lakes, trees kept off the shore.
Removes the levelling pass, the lower-rim lip and the bank-slope cap.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cj2RPXdPykKMEz5BXXczsj
This commit is contained in:
2026-10-29 20:55:52 -04:00
co-authored by Claude Opus 5.5
parent e3e01a84b1
commit daeb3b2238
9 changed files with 165 additions and 206 deletions
+20 -21
View File
@@ -590,27 +590,26 @@ above, including:
ordinary repose rules take over. Keep stamped moves, barriers, burning-bed protection and
worker independence. The existing worldgen POWDER_FAN switch disables new face releases.
- **Level lakes during world generation (t96, 2026-10-29).** The owner wants new worlds
to start with flat lakes instead of waiting 80–125 seconds for them to flow level. Changed
generated worlds are accepted: seeds no longer reproduce the old water layout. After the
existing settling loop, level four-connected water bodies of at least 50 grains, preserving
their exact volume. Fill reachable air/water from the bottom upward, respecting solid/powder
walls and dry rims; place a partial top row from the middle outward. Establish the dock's
existing foundation first so it cannot erase newly levelled water. Keep the pinned settling
values, startup water wakes, and round-1 wet/water-connected-bank tree filtering. Existing
load wakes and later snowmelt/flooding rules stay as they are.
- **Lakes fill only to their lower rim and keep clear of spawn (t96 round 3, 2026-10-29).**
The generator took the basin's `lip` as `Math.min(surfY)`, the highest ground (y grows
downward), so water was poured above the lower rim and ran out toward low ground; once
levelled it reached the trade dock on 4 of 12 seeds. The owner chose option 2: the lip is
now the lower of the two rim edges, minus one, so a lake is filled to just under that rim,
and each lake's half-width is capped so its edge stays 80 grains from spawn (and the dock).
Lakes are smaller and lower: about 180-250 grains wide instead of 250-330, 5-15 grains
lower. The random draws keep their order.
Dug to the lower rim, the high side ended in a vertical cliff as tall as the gap between the
rims (15-18 grains on seeds 766733, 7, 42; owner screenshots). From each edge inward the
ground may now fall at most 0.7 grains a column and is never raised above the natural
surface, so the high side is a sloped bank down to the water.
- **Lakes are bowls filled to their spill level (t96, 2026-10-29).** Three patches the same
day (a levelling pass, a lower-rim lip, a 0.7-grain bank cap) each fixed one symptom and
exposed the next: lakes started tilted, then flooded to the dock, then had a cliff, then a
straight ramp. The real cause was pouring water to a guessed `lip` (which was the highest
ground, since y grows downward) so it ran out over the lower rim during settling. Banks and
beds are solid and never moved. Owner decisions: fix it properly, planned lakes only (no
extra ponds), clay lake beds. The method, from depression filling (Priority-Flood, Barnes et
al.): every basin fills to its spill level, the lowest point of its rim, so water is flat and
contained by construction. The generated surface is one height per column with no overhangs
(caves start 10+ rows down), so this is the 1D form: each column's water top is the lower of
the highest ground to its left and to its right (`spillLevels` in worldgen-helpers.js).
Generation: each lake goes to the lowest smoothed ground within 60 grains of its planned spot,
keeping 80 grains from spawn and the dock; the land is lowered by a smoothstep bowl (flat floor
in the middle 40%, banks easing in and out, a little noise) on top of its own shape, so banks
keep the land's contours and meet it with no step; on sloping ground the bowl deepens (up to
3x) until the water is at least 12 deep. Water fills only to the spill level within the bowl.
The bed (top 3 rows under water) is clay and grass stops at the waterline. No caves or loose
sand/gravel pockets within 40 rows under a lake or 12 columns of its edge, so nothing can open
a hole in its bed. Trees keep 6 columns from the water. The levelling pass, the lip, the bank
cap and the post-settle tree re-check are gone. Generation time is unchanged (within 5%).
## Ideas not built yet