Skip to content

The water of the world is what the land holds: no walls of water at roads or where levels meet, rapids instead; a street to every road end of a village (gw 79) - #512

Merged
k06a merged 7 commits into
mainfrom
claude/project-thread-kl5tv2
Dec 2, 2026

Conversation

@k06a

@k06a k06a commented Dec 2, 2026 •

Copy link
Copy Markdown
Owner

Requested by Anton · project thread

🌊 The water of the world is what the land holds (world version gw 79)

Two remarks on one cliff world (seed code 01712ad9…, seed 7919914): right behind the house a wedge of water ended in a wall at a road, and 280 m from the home a lake was cut along a straight line. Both have one cause, in the generator: the water level is a field, and it jumped. The basin under the cliff has its water at 20, the world at 60, and the field switched between them on one threshold.

  • A road under the cliff reached over the edge with its skirt, took dry land of the top under 60, and that land filled: 618 columns of water that no river brought, with a wall at the asphalt.
  • Where the basin ends (x = home ± 1400 cells) the jump ran along a straight line: water and its bed stood as a wall of 40 cells, 800 to 1900 hanging columns per cliff world.

What the generator does now (31_terrain.js, 35_span.js, 35_roads.js, 31_terrforms.js)

Rule Where
The level climbs from the basin to the world a cell at a time; the land of that rise stands over it (a dry rim), and a river leaves the basin as rapids, one cell at a step Terr.nat, WL_EVEN_GW
A way under the water level of its place is drained and runs between banks; the inner skirt of an earthwork is a bank Terr.at, Span.lay, CUT_DRY_GW
Land that an earthwork takes down never goes under the water of its place Terr.at
No bridge deck under its own water Span.prof
The crack of a rift stays dry where a sea only touched it (the test of dryness was an exact equality of two floats) Terr.nat
The stream of a waterfall ends in a pond before the earthwork of a way (the road took its water, the dry bed ran on) Terr.stream, Roads.reach, BROOK_GW

Worlds made before keep their version and their look; the same seed at the new version shows the fix.

🏘️ A road that ends at a village has a street to its end (34_vill.js, VIL_IN_GW)

tools/navi.test.mjs was still checking worlds of gw 65; on the current ones a car to Porto Sole (seed 20261139) left the road at the edge of the village and crossed 110 cells of grass. An arm of the main street sent to a road may stop where it meets another street. After every plan type has drawn its streets, a lane now winds from the nearest street to each road end that none reaches.

Tests

  • tools/water.test.mjs (new; parts cut, seam, ways, brook): 4.5 million columns of eight worlds walked cell by cell, 30 streams. No water made by an earthwork, no hanging face of water, no way under water, every stream has its water or a deck. Both remarks are reproduced at the version before the gate (592 columns of made water with 53 hanging at the road; 102 hanging columns along the seam).
  • tools/ways.test.mjs: vill checks a street to the end of each of 174 roads at 64 villages (and finds the bare end in the old world); new part ends counts the passes of Rail.make over 100 regions of four worlds (the hang of seed 20261146 that build 487 fixed: before it two of these worlds never ended).
  • tools/navi.test.mjs on the current worlds: 0.00 % off the net outside grown towns; golden hashes of all older worlds unchanged, two worlds of gw 79 added.
  • Rules in docs/ARCHITECTURE.md: "The water of the world is what the land holds", and two lines in "The ways are one net" (a street to every road end; a search ends by its own form).

Sources

  • Génevaux, Galin, Guérin, Peytavie, Beneš, Terrain Generation Using Procedural Models Based on Hydrology, SIGGRAPH 2013: the water network first, the land shaped to hold it. Used as the invariant: every water surface is bounded by land at its level.
  • Peytavie, Dupont, Guérin, Cortial, Benes, Gain, Galin, Procedural Riverscapes, Computer Graphics Forum 2019: a river as reaches of constant level joined by steps (rapids, falls) sized by the drop. Used for the level that changes a cell at a time across the rise.
  • Procedural Generation of Landscapes with Water Bodies Using Artificial Drainage Basins (CGI 2022): a water body sits in a basin closed by its rim. Used for the dry rim round the basin under the cliff.
  • TxDOT Hydraulic Design Manual, bridge and culvert selection: a way crosses water on a deck above it, or the water is led off and the way runs in a drained cut with banks. Used for the rule of ways and decks.

Screenshots (before and after, the same seeds): in the release of this build, tools/shots/488.mjs.

https://claude.ai/code/session_01Uiczdw3KUitNgtCeCv9tDM


Generated by Claude Code

@k06a k06a self-assigned this Dec 2, 2026
@k06a k06a changed the title Towns with estates are built again (STR declared nowhere); undef.test: every name used is declared Ways and water: crossings of watercourses, a road past a village joins its streets (in work) Dec 2, 2026
@k06a
k06a force-pushed the claude/project-thread-kl5tv2 branch from d1b5182 to baa8d37 Compare December 2, 2026 21:18
…ets a street; the loop search ends

Water level is one continuous field across the rise of a cliff basin (no jump from 60 to 20 along a line), with a dry rim and a
river that leaves as rapids one cell at a time. Earthworks never bring land under the water of its place: way cells are drained,
the inner skirt is a bank, no bridge deck under its water, a brook ends in a pond before a way. Every road that ends at a village
has a street up to its end. Rail.make's search for a loop ends when a town alone cannot be served (seed 20261146 never came up).
Tests: tools/water.test.mjs, tools/ways.test.mjs (vill, ends).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uiczdw3KUitNgtCeCv9tDM
…-kl5tv2

# Conflicts:
#	build/notes.mjs
#	src/game/75_seed.js
#	tools/shots/485.mjs
#	tools/test-times.json
…-kl5tv2

# Conflicts:
#	build/notes.mjs
#	src/game/35_track.js
#	tools/roads.mjs
#	tools/shots/487.mjs
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uiczdw3KUitNgtCeCv9tDM
…; the after scene keeps the camera of the before scene

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uiczdw3KUitNgtCeCv9tDM
@k06a k06a changed the title Ways and water: crossings of watercourses, a road past a village joins its streets (in work) The water of the world is what the land holds: no walls of water at roads or where levels meet, rapids instead; a street to every road end of a village (gw 79) Dec 2, 2026
@k06a k06a added the queue In the merge queue: lands on main by itself (node tools/merge.mjs <pr>) label Dec 2, 2026 — with Claude
@k06a k06a removed the queue In the merge queue: lands on main by itself (node tools/merge.mjs <pr>) label Dec 2, 2026
@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

⏱ Performance: this PR against main

Scenarios of src/game/98_perf.js, the two builds by turns on one runner (tools/perf.mjs, CPU side, draws counted not drawn).

✅ No regression against main

More turns to settle a suspicion: night +2, tunnel +2 (a difference counts when the turns of the two builds stand apart, 8 turns each).

scenario metric main PR Δ threshold turns
– no change beyond the noise
scenario CPU mean p95 max slow/min spikes/min miss sync gens draws top systems (ms/frame)
idle 6.16 10.3 32.3 0.00 11.2 0% 3.00 389 Town.update 0.79, Land.drawPass 0.72, Town.draw 0.49, BigMap.sample 0.42
night 4.70 7.65 22.1 0.00 8.99 0% 1.50 362 Land.drawPass 0.60, Town.update 0.54, BigMap.sample 0.39, Town.draw 0.33
drive 26.6 60.3 272 217 175 35% 109 130 Land.lightTick 9.82⚠️, Land.gen 3.10⚠️, Land.meshChunk 1.69⚠️, BigMap.sample 1.47
flight 12.7 31.0 447 72.4 140 0% 65.0 60.0 Land.lodData 2.50, Folk.update 1.73, BigMap.sample 1.73, Lift.update 0.62
tunnel 11.4 40.4 326 92.4 150 14% 16.0 203 Land.lightTick 1.99⚠️, Land.lodData 1.09, Land.meshChunk 0.89, Folk.update 0.78

Over budget (ms/frame, budget): drive Land.lightTick 9.82 > 1 · drive Land.gen 3.10 > 0 · tunnel Land.lightTick 1.99 > 1 · drive Land.meshChunk 1.69 > 1 · flight Land.gen 0.60 > 0 · tunnel Land.gen 0.23 > 0 · idle Land.gen 0.03 > 0


Generated by Claude Code

@k06a
k06a merged commit 490aa62 into main Dec 2, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants