Skip to content

Towns to the measure of real small towns: less asphalt, houses on streets, roads that reach the streets (gw 71) - #499

Open
k06a wants to merge 9 commits into
mainfrom
claude/project-thread-650e12
Open

k06a wants to merge 9 commits into
mainfrom
claude/project-thread-650e12

Conversation

@k06a

@k06a k06a commented Dec 2, 2026 •

Copy link
Copy Markdown
Owner

Requested by Anton · project thread

What

Anton pointed out (2026-12-02, on a tiny town drowned in asphalt) that towns had more roads than cars and far too many streets for their size, and asked to take small towns with orderly streets as the model. Towns of new worlds (GENV gw 78, WVS_GW in 34_weave.js) are now measured against real small towns:

measure gw 66-77 gw 78 real
asphalt (carriageway + lines) of the town's ground, mean / max 31 % / 39 % 20 % / 28 % small historic towns 15-25 % (UN-Habitat 2013)
buildings more than 6 m from a street, walk, square or path 11.8 % 2.8 % about 0
roads in that stop short of the town's streets (3 seeds, 95 roads) 24 0 0
mean degree k: grown / medina / planned 2.72 / 2.86 / 2.90 2.66 / 2.98 / 2.98 2.47-2.92 / 2.65-3.04 / 2.98-3.55 (Boeing 2019)
  • Street spacing by tradition (WV_DSK): streets about two rows of lots apart, so a block is no longer one house between two streets; the field turns over a shorter run (WV_NFK) so the fewer, longer streets still wind.

  • Width hierarchy (Street.set, gw ≥ WVS_GW): main street two lanes with narrow sidewalks, streets with narrow sidewalks, the lanes of grown cores (burg, medina, strip, loops, ribbon) one carriageway without sidewalks.

  • A house on a street (Weave.front, chamfer distance): the ring fill of Settle.plan puts a lot only where its middle lies within WV_FRONT of a street; the inside of a block is gardens and yards.

  • Roads reach the streets (coordinator, from the residents thread: on seed 20261129, 13 of 31 roads ended 130-544 cells short and Urban.gate found no street). The greedy walk of art, pulled to the road end, could wander off and stop at the edge of the town. A road in is now the least-cost path over the land from where it meets the town to the core (Dijkstra on a 16-cell grid, 16 headings, cost = length × (1 + height off the town level), water dear; Galin et al. 2010, Beneš et al. 2014), smoothed (Chaikin) and joined to the first street it meets.

  • Market squares (sq in Weave.grow): the lens of a market street is 19-28 × 8-11 m (it was 5-8 m across) and a medina's or link town's disc a little larger, so a market fits once the wide walks along every street are gone; Fest.site samples a stall's footprint every half cell (a one-cell hole between samples put a stall over grass).

  • Ice-cream van (79_icevan.js gate): a street cut into short pieces by car park entrances still has kerb stops (only real junctions keep the 6-cell distance); 43/46 → 46/46 towns.

  • Railway planning that ends (Rail.make, 35_track.js; found while moving this PR onto main, where it hangs too since gw 71): when the grade could not reach the last town of a loop, the town was left out and the stale plan was asked again for ever, so the world of seed 5150 (a town by the sea in the desert) never came, nor did seed 260429754 in a forest (Terr.at(-2160, -2736)). Every plan now costs the loop a town or, for a town alone, one of the four sides its loop may turn to; with every town left out there is no line. Street.set takes the generator version again (the argument was dropped with the old-version code in Build 468: generator version floor (gw 60), old worlds asked once to rebuild; lot trees keep their places #466).

Not changed: a town on a narrow ridge (Königsstadt, seed 20261129) still has only a few houses; that is the next phase (towns shaped by their land: terraces, grade-limited streets).

Tests

  • tools/weave.test.mjs 7-10 (new): asphalt share, houses on streets, street graphs inside the ranges of real cities of the same tradition (tools/weave.real.mjs: Boeing 2019 Table 1, 100 cities), every road in ends on a street. GW=77 node tools/weave.test.mjs shows the old generator failing them (30.8 % asphalt, 682 of 5778 buildings off the streets, 24 roads short).
  • tools/fest.test.mjs: the van in ≥ 95 % of towns (was 90 %). tools/fair.test.mjs caught the smaller squares (36 of 46 towns with a fair, now 39) and the stall on grass.
  • tools/rail.mjs test (new check, failed before the fix on seed 5150 regions 0,0 and 0,1 and on seed 260429754 region -1,-1): the plans of a loop are counted, at most one per town plus the four sides of the last one.
  • Passed on this head (main of build 486 merged, GENV gw 78): gen golden (1104 checks, only the two new worlds hashed) / determinism / town / land / roads, weave, estate, fest, fair, urban, under, front, roadin, rail.
  • The medina check of weave.test (5) now knows the size of a network (phiFloor in tools/weave.lib.mjs): the entropy of n bearings in 18 bins falls short by (18 − 1) / 2n (Miller 1955), so 23 random straight streets already show φ ≈ 0.35. The limit is that floor plus the old margin: 0.35 at the 35 streets a medina had before, 0.45 at 23.
  • Failing the same way on main (not from this PR): tools/cone.test.mjs (the same 6 ceilings), tools/city.mjs test (P.gw is gone since the old-version code was dropped), tools/streets.test.mjs ("cars drive on the left" 1.30 %).
  • tools/xing.test.mjs never ends on main (seed 5150, the railway loop above). With the fix it ends and fails two ceilings that this PR does not move (the same numbers on main with only the railway fix): 4242 lost 2 > 1 and 5150 clash 95 > 5. LIM is not touched here. The railway fix alone, for a hotfix, is git diff main -- src/game/35_track.js tools/rail.mjs tools/roads.mjs.
  • Rule in docs/ARCHITECTURE.md: "Towns to the measure of real small towns".

Sources

  • G. Boeing, Urban spatial order: street network orientation, configuration, and entropy, Applied Network Science 4, 67 (2019): φ, k, dead ends, four-way share of 100 cities.
  • UN-Habitat, Streets as Public Spaces and Drivers of Urban Prosperity (2013): street share of urban land.
  • E. Galin, A. Peytavie, N. Maréchal, E. Guérin, Procedural Generation of Roads, Computer Graphics Forum 29(2), 2010: least-cost roads over terrain.
  • J. Beneš, A. Wilkie, J. Křivánek, Procedural Modelling of Urban Road Networks, Computer Graphics Forum 33(6), 2014: slope-weighted road edges.
  • G. Chen, G. Esch, P. Wonka, P. Müller, E. Zhang, Interactive Procedural Street Modeling, SIGGRAPH 2008 (the tensor field the streets follow).
  • G. A. Miller, Note on the bias of information estimates, 1955 (the small-sample floor of the orientation order).
  • G. Chaikin, An algorithm for high-speed curve generation, 1974.

Screenshots: in the release of this build (tools/shots/487.mjs, the queue renames it to the build number) and below.

https://claude.ai/code/session_01Uiczdt14xCS9pvwcYytzRr


Generated by Claude Code

…house on a street, roads that reach the streets (gw 70)

Asphalt of a town 31 % -> 21 % of its ground (small historic towns 15-25 %, UN-Habitat 2013); street spacing by planning
tradition, lanes without sidewalks in grown cores; no building more than 6 m off a street; street graphs inside the ranges
of real cities of the same tradition (Boeing 2019); every road in reaches a street of its town by a least-cost path over the
land (Galin et al. 2010), 24 of 95 stopped short before. Ice-cream van stops on streets cut by car park entrances.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uiczdt14xCS9pvwcYytzRr
…V gw 71

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uiczdt14xCS9pvwcYytzRr
…n's remarks paraphrased

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uiczdt14xCS9pvwcYytzRr
@k06a k06a self-assigned this 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
@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).

❌ Slower than main in 3 gating metric(s)

scenario metric main PR Δ threshold
idle cpu.mean 6.38 7.76 22% ❌ ±16%
idle cpu.p95 12.1 17.9 48% ❌ ±25%
night cpu.max 20.4 48.9 139% ⚠️ ±125%
drive draws 105 92.0 -12% ✅ ±7%
flight cpu.p95 43.7 53.6 23% ❌ ±23%
flight draws 50.0 44.5 -11% ✅ ±8%
tunnel draws 229 197 -14% ✅ ±5%
tunnel tris 491545 426780 -13% ✅ ±5%
scenario CPU mean p95 max slow/min spikes/min miss sync gens draws top systems (ms/frame)
idle 7.76 17.9 79.3 11.2 29.9 0% 0.50 391 Town.update 1.11⚠️, Land.drawPass 0.84, Town.draw 0.54, Land.meshChunk 0.46
night 5.15 8.35 48.9 3.00 5.99 0% 0.00 368 Land.drawPass 0.83, Town.update 0.42, Town.draw 0.36, BigMap.sample 0.34
drive 52.9 108 568 452 32.5 78% 92.0 92.0 Land.lightTick 21.5⚠️, Land.gen 7.54⚠️, Land.lodData 4.85, Land.meshChunk 2.23⚠️
flight 19.4 53.6 915 81.3 212 0% 1.00 44.5 Folk.update 3.83, Land.lodData 2.60, BigMap.sample 1.79, Herd.update 1.71
tunnel 19.8 66.9 401 139 144 0% 0.50 197 Land.lightTick 3.81⚠️, Land.lodData 2.53, Land.meshChunk 1.35⚠️, Town.update 1.18⚠️

Over budget (ms/frame, budget): drive Land.lightTick 21.52 > 1 · drive Land.gen 7.54 > 0 · tunnel Land.lightTick 3.81 > 1 · drive Land.meshChunk 2.23 > 1 · drive gl.upload 1.16 > 0.8 · tunnel Land.meshChunk 1.35 > 1 · drive Town.update 1.20 > 1 · tunnel Town.update 1.18 > 1


Generated by Claude Code

…ilway loop planning that ends

Rail.make left the last town of a loop out and asked the stale plan again for ever (seed 5150 by the sea in the desert, gw 71+): every plan
now costs the loop a town or one of the four sides of a town alone, and with no town left there is no line. tools/rail.mjs test counts the plans.
Street.set takes the generator version again.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uiczdt14xCS9pvwcYytzRr
The medina check of weave.test knows the size of a network: few streets always look ordered (the entropy of n samples, Miller 1955), so the
limit is the order of random streets at that size plus the old margin (0.35 at the 35 streets of a medina before WVS_GW).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uiczdt14xCS9pvwcYytzRr
…tes and shots 487; the second world that never came

Seed 260429754 in a forest (Terr.at(-2160, -2736) never returned on main) is the same railway loop planned for ever: it joins the test.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uiczdt14xCS9pvwcYytzRr
github-actions Bot added a commit that referenced this pull request Dec 2, 2026
Towns to the measure of real small towns: less asphalt, houses on streets, roads that reach the streets (gw 71)

Merge queue: build 487
…s the railway planning test

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uiczdt14xCS9pvwcYytzRr
k06a pushed a commit that referenced this pull request Dec 2, 2026
…7; a yard is not put across a road that cannot pass it

A road held close by (its town's pad, a ring, a junction with another road) cannot dive a storey under a level yard:
the yard slides, takes the other flank or stands farther out from its town (LN_OUT, within LN_FAR of the town's edge)
until every road across has the room (Rail.xcount); rline.test checks the room with the roads' own profiles laid.
The fix of the loop planner that never ended is taken from #499 as it is; ways.test part ends builds the three
regions that never came back.

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

This branch has not been deployed

No deployments
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