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:
+20
-21
@@ -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
|
||||
|
||||
|
||||
+5
-6
@@ -378,12 +378,12 @@ The same chunk schedule runs inline or in workers. Workers only own a pass at a
|
||||
simTick: one simulation step, in order.
|
||||
- functions: simTick
|
||||
|
||||
### src/sim/worldgen-helpers.js (131 lines)
|
||||
World generation helpers: noise and removal of tiny hard rock specks.
|
||||
- functions: makeNoise, fbm, clearHardSpecks, levelWorldWater
|
||||
### src/sim/worldgen-helpers.js (74 lines)
|
||||
World generation helpers: noise, hard rock specks and lake spill levels.
|
||||
- functions: makeNoise, fbm, clearHardSpecks, spillLevels
|
||||
- variables: SPECK_MIN
|
||||
|
||||
### src/sim/worldgen.js (305 lines)
|
||||
### src/sim/worldgen.js (309 lines)
|
||||
World generation: staged terrain, ore, caves and placement, with synchronous and async entry points.
|
||||
- functions: generateWorld, generateWorldAsync
|
||||
|
||||
@@ -664,8 +664,7 @@ The frame loop and boot.
|
||||
- `test/t_gpu_light.py`: The former CPU light behavioural checks, now read from the actual GPU light grid.
|
||||
- `test/t_import_save.js`: Import must preserve the running world before reading or replacing it.
|
||||
- `test/t_joins.js`: The oracle states the geometric rule independently of the precomputed neighbour tables.
|
||||
- `test/t_lakes.py`: Pixel startup and fresh/reloaded flat lakes after 600 ticks; shots/t96-level.png.
|
||||
- `test/t_lakes.js`: Generated lakes start flat, conserve water, and have dry tree bases.
|
||||
- `test/t_lakes.js`: Generated lakes sit in a smooth bowl filled to its spill level: flat, contained, clay-bedded, stable, with natural banks, dry tree bases and the dock clear.
|
||||
- `test/t_lakes.py`: t96: flat generated lakes, fresh and reloaded, in the real pixel frame loop.
|
||||
- `test/t_load.js`: Reload wakes nearby areas first, without losing distant water, fire or saved state.
|
||||
- `test/t_molds.js`: Molds and furnaces stay usable: ingots drop below and keep their stubs, plugs over molds are cleared, spoiled castings can be knocked out, grains never drop through a grate by teleporting, and slag lets the fire breathe.
|
||||
|
||||
+8
-7
@@ -76,14 +76,15 @@ The conveyor fixture uses a wider feed pile, the screen fixture warms longer, an
|
||||
checks waking within eight ticks separately from the probabilistic consumption of fuel.
|
||||
|
||||
`test/t_lakes.js` pins SHA-256 over raw `mat` followed by Float32 `temp` bytes for seeds
|
||||
7, 42 and 424242 at 2048x1024. t96 round 2 re-baselines only for the lake-levelling pass;
|
||||
`t_corner_seal.js` also pins three smaller worlds with the same intentional change. The lake
|
||||
suite checks all five seeds (also 2 and 1): surface pools wider than 20 grains start within
|
||||
one grain of level and stay so after 600 ticks, exact WATER count from the pre-pass 0.99
|
||||
progress callback, dry tree bases and startup wakes. Small fixtures cover solid/powder rims,
|
||||
volume, centered partial rows, the 50-grain cutoff and diagonal separation.
|
||||
7, 42 and 424242 at 2048x1024; `t_corner_seal.js` pins three smaller worlds and `t_world.js`
|
||||
the shallow-ore hash, all re-baselined for the t96 lake rebuild (changes only inside lake spans).
|
||||
For seeds 7, 42, 424242, 2, 1, 5 and 6 (and Huge seed 766733 without ticks) every lake is at
|
||||
least 12 deep with one at least 120 wide, exactly flat, held by a dry bank at or above its
|
||||
surface on both sides, clay-bedded, with no ground step over 3 grains within 40 columns, clear
|
||||
of the dock, with no submerged tree base; after 3000 ticks each lake keeps its exact surface and
|
||||
water count (no leaks). A hand-made surface checks `spillLevels`.
|
||||
`python3 test/t_lakes.py` checks pixel startup and fresh/reloaded lakes after 600 ticks with
|
||||
two browser helpers and no page errors; `shots/t96-level.png` shows the untouched new lake.
|
||||
two browser helpers and no page errors; `shots/t96-level.png` shows the new lake.
|
||||
|
||||
`test/t_bot_rescue.js` covers deep basalt burial, nearest/upward and diagonal nudges,
|
||||
unexplored-pocket rejection, newest open trail points, ring wrap/load reset, bounded searches,
|
||||
|
||||
@@ -4,6 +4,28 @@ What agents have done, newest first. Add an entry for every piece of work: the d
|
||||
note or request it was for, what changed, the files touched, the tests run, and anything left
|
||||
open or not verified. Keep each entry short; the git history has the details.
|
||||
|
||||
## 2026-10-29: t96 rebuilt: lakes are bowls filled to their spill level (Claude)
|
||||
|
||||
- Owner: the round-4 bank was a flat, unnatural ramp; fix lake generation properly instead of
|
||||
patching. Mapped worldgen first: banks and beds are solid (only sand, gravel, snow and liquids
|
||||
move while settling), so the original tilt was water poured above the lower rim spilling out,
|
||||
not slumping banks (Claude's earlier explanation was wrong). Researched depression filling
|
||||
(Priority-Flood) and its 1D form. Owner chose planned lakes only and clay beds.
|
||||
- src/sim/worldgen.js: lake goes to the lowest smoothed ground within 60 grains of its plan (80
|
||||
from spawn); smoothstep bowl added to the land's own shape, deepened up to 3x until 12+ deep;
|
||||
water fills to `spillLevels` (new, worldgen-helpers.js) within the bowl; clay bed (3 rows),
|
||||
grass stops at the waterline; no caves or sand/gravel pockets within 40 rows under a lake or 12
|
||||
columns of it; noTree 6 columns from water. Removed levelWorldWater, the lip, the 0.7 bank
|
||||
cap, the dock-first ordering and the post-settle tree re-check.
|
||||
- Measured on 10 seeds (incl. owner's 766733/12446/23565 at 6144x2048): lakes 120-231 wide,
|
||||
14-47 deep, exactly flat, banks no steeper than 3 per column, no wet trees, each lake's
|
||||
surface and water identical after 3000 ticks (underground aquifers still drain, as before).
|
||||
Screenshots of all four seeds checked in the smooth/pixel looks. Generation time within 5%.
|
||||
- Tests: t_lakes.js rewritten (flat, held by banks, clay bed, no cliff, real lake, dock clear,
|
||||
stable 3000 ticks, spillLevels fixture; Huge seed 766733); hashes re-baselined in t_lakes,
|
||||
t_corner_seal and t_world (shallow ore: 724 of 27,985 cells, all within old/new lake spans).
|
||||
Full `run_all.py --browser`: ALL PASSED.
|
||||
|
||||
## 2026-10-29: t96 round 3, lakes fill to their lower rim (Claude)
|
||||
|
||||
- Owner chose option 2. src/sim/worldgen.js: lake `lip` is the lower rim edge minus one (was
|
||||
|
||||
Reference in New Issue
Block a user