Skip to content

Critics of the world generators: a random world every run (reach, roads, sea) - #574

Closed
k06a wants to merge 2 commits into
mainfrom
claude/project-thread-d204bd
Closed

k06a wants to merge 2 commits into
mainfrom
claude/project-thread-d204bd

Conversation

@k06a

@k06a k06a commented Dec 3, 2026 •

Copy link
Copy Markdown
Owner

Requested by Anton · project thread

What

A suite of critics for the world generators: node tools/critics.test.mjs (no build, no browser, about a minute a world).

Every run makes the worlds of a small fixed panel and one world of a seed drawn anew; the seed is printed and SEED=<n> makes that world again. The map has no end, so the critics look at the land round the home (seven settlement cells wide) and at squares far away drawn from the seed (up to 128 km).

A critic repairs nothing and knows nothing of how a thing was made. It asks the world what the game asks it: the navigator for the way a service car gets (Navi.start → Navi.ends → Navi.carWay), the one ground finder for where a wheel stands (Ground.at), the blocks for what is in a body's way, with the limits of the driving physics (a step of two cells, the inner 70% of the width free).

critic what it lists
reach from the home to every settlement, railway station, airport and sea port within a kilometre, a car body driven on the real blocks: reach.none / gap / cut, way.off / step / wall / hole / wet / scrape / edge / low / steep
roads every road of the squares as the generator answers (road.lost / step / wet / clash / grade / bend / tree / house) and as it is built, a bus along a lane (lane.*)
sea the lanes of the ships: deep water as wide as a hull, no deck or causeway across, the piers in deep water (sea.land / bridge / pier)

Each finding names the seed, the place and what the generators say is there (which road and how far from its axis, a deck, which cell of which settlement's plan), so it is clear whose it is. node tools/critics/view.mjs <seed> <x,z> out.png [span] [to x,z] draws the place with the way to it.

What the first worlds show (main, gw 89)

world destinations reached by car faults
panel 20261129 town 2 of 25 91
panel 7 1 of 3 3
panel 987654321 mount 6 of 24 114
random 1509154513 lake, forest 3 of 24 138

The causes seen so far, each with a place to stand at (they go to the threads that own the generators):

  • the navigator's way round a roundabout on a class 3 or 4 road lies 16 to 36 cells outside the ring (the arc keeps the lane offset of the road it came from): over grass, through railings, off the edge of a deck (seed 987654321 at 850,1566 and 1582,3597);
  • a road that comes to a grown town is not met by a street, and the way crosses the bare plan (the ratchet TOWNS of navi.test counts the same thing): seed 987654321, New Plaza at 2348,4017, 646 cells;
  • ways across town squares through their trees (Nordby at -2562,1992);
  • no road comes to a railway station: 0 of 20 stations reached in four worlds, the network ends 480 to 530 cells short (Haardrecht at -170,-1079);
  • roads steeper than their class allows, roads less than a vehicle's height apart, one road without a surface for 15 cells.

Ratchet

tools/critics.known.json holds per panel world the destinations not reached, the faults in all and the kinds seen (one whole per world, the form of tools/drive.known.json). More of either, or a new kind, fails; fewer asks for UPDATE=1, which never raises a number. A kind clean in the panel and in at least twelve random worlds goes on the strict list (SEEDS=12 UPDATE=1); from then on one case of it in the random world of any run fails that run. The list is empty today, so the random world reports and does not block.

Rule: docs/ARCHITECTURE.md → "Critics of the worlds".

Prior art used

  • Generate-and-test with separate critics, and playability judged by an agent that plays what was generated: Togelius, Yannakakis, Stanley, Browne, Search-Based Procedural Content Generation (2011); Shaker, Togelius, Nelson, Procedural Content Generation in Games (2016), ch. 12; Withington, Cook, Tokarchuk, On the Evaluation of Procedural Level Generation Systems (2024).
  • Probes sent over generated planets to see what the generator made: Hello Games, No Man's Sky (Continuous World Generation in No Man's Sky, GDC 2017).
  • A fresh random input each run, the failing one printed, replayed and kept: property-based testing (Hypothesis: reproducing failures, QuickCheck).

The first fix: the way round a roundabout

Navi.isle gave the arc round an island the lane offset of the road the way came by, so by class 3 and 4 roads the way of the taxi, the police and the fire engine ran 20 to 36 cells outside the ring. The arc now takes the lane of the ring road. Test first: part ring of tools/ways.test.mjs (red before: 8.5, 31.9 and 51.9 cells off the middle of the ring for classes 2, 3, 4). navi.test and ways.test green. Panel after it: world 987654321 reaches 10 of 24 instead of 6 (faults 114 → 96), world 20261129 faults 91 → 85; the numbers of tools/critics.known.json are lowered here. Before and after pictures of the way at 850,1566 are in the project thread (no in-game shot list: the change is in the line a driver follows, drawn by tools/critics/view.mjs).

Not in this PR

The nightly workflow over many random worlds (a workflow file: its own PR, merged directly), critics for railways, town interiors, buildings and flora, and the other fixes of what was found.

One release note (the roundabout fix).

https://claude.ai/code/session_01UiczdvXKSNcFXPzzYu2LYJ


Generated by Claude Code

@k06a k06a self-assigned this Dec 3, 2026
@k06a k06a added the queue In the merge queue: lands on main by itself (node tools/merge.mjs <pr>) label Dec 3, 2026 — with Claude
github-actions Bot added a commit that referenced this pull request Dec 3, 2026
Critics of the world generators: a random world every run (reach, roads, sea)

Merge queue: build 524
@github-actions

github-actions Bot commented Dec 3, 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

scenario metric main PR Δ threshold turns
– no change beyond the noise
scenario CPU mean p95 max slow/min spikes/min miss sync gens read gens draws top systems (ms/frame)
idle 7.49 12.1 42.1 0.00 15.0 0% 0.00 0.00 399 Town.update 2.35⚠️, Land.drawPass 0.53, Town.draw 0.46, Occ.keep 0.41
night 5.65 9.65 20.9 0.00 0.00 0% 0.00 0.00 374 Town.update 1.03⚠️, Land.drawPass 0.67, Town.draw 0.44, Walk.casters 0.27
drive 34.2 73.7 285 336 89.7 23% 70.0 0.00 150 Land.lightTick 13.2⚠️, Land.gen 2.51⚠️, Land.meshChunk 2.35⚠️, BigMap.sample 1.60
flight 11.9 28.4 270 59.9 107 0% 0.00 0.00 66.5 Land.lodData 1.96, BigMap.sample 1.71, Sp.draw 0.88, Herd.update 0.85
tunnel 12.5 44.5 89.7 87.3 165 0% 0.00 0.00 319 Land.lightTick 2.53⚠️, Town.update 1.29⚠️, Land.meshChunk 0.85, BigMap.sample 0.85

Over budget (ms/frame, budget): drive Land.lightTick 13.16 > 1 · drive Land.gen 2.51 > 0 · tunnel Land.lightTick 2.53 > 1 · idle Town.update 2.35 > 1 · drive Land.meshChunk 2.35 > 1 · drive Town.update 1.56 > 1 · tunnel Town.update 1.29 > 1 · night Town.update 1.03 > 1


Generated by Claude Code

k06a pushed a commit that referenced this pull request Dec 3, 2026
Critics of the world generators: a random world every run (reach, roads, sea)

Merge queue: build 524
…s when high or opening, sea.idle

A lane binds a bridge only when a voyage sails it (Ships.spec). With seaways in the game a deck over a lane is a fault
only in the state 'low' (Seaway.state); before them the fixed air of 60 cells holds. sea.idle counts a port no voyage sails from.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UiczdvXKSNcFXPzzYu2LYJ
github-actions Bot added a commit that referenced this pull request Dec 3, 2026
Critics of the world generators: a random world every run (reach, roads, sea)

Merge queue
After a gate the worlds of the panel's seeds are other worlds: the two ceilings still hold, the kinds are not held, and
UPDATE=1 writes the numbers of the new version. A PR that lands behind a gate no longer turns red on kinds it did not make.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UiczdvXKSNcFXPzzYu2LYJ
@k06a
k06a force-pushed the claude/project-thread-d204bd branch from e7c255f to df0b11f Compare December 3, 2026 07:45

k06a commented Dec 3, 2026

Copy link
Copy Markdown
Owner Author

This work is in main as build 524 (landed through dev in #580 at head 4d8cce5). The commits that came after go into a new pull request from the same branch.


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

queue In the merge queue: lands on main by itself (node tools/merge.mjs <pr>)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants