Status: done (2026-11-14)
Priority: 2
Size: S
Arch: roads
Phase: implement
Design ref: World, climate and travel (Worn paths); src/sim/routes.js, tileCost
Goal: A developed tile walks as open ground (tileCost, src/sim/routes.js: cost 1, whatever its biome), so developing one changes its walking cost. Three acts developed a tile without telling the route cache, so routes cached past it stayed stale until something else dropped them: a household’s broken field (sim/fields, broken), its new meadow (sim/meadows, addMeadow) and a village plot’s broken field (sim/expansion, finishStep). Every other writer of w.dev already calls costChanged. Kim, 14 November: found by the review of PR #134, whose research is not merged; this fix is taken from it.
Acceptance criteria:
costChanged(st, tile) when the tile was not developed before, and not when it was (its cost does not change then).tests/routes.js (fast): each act marks its tile in st.routeDirty; a second break of developed ground marks nothing. It fails without the fix.
Notes:sim/routes).routeSearch 11,875 and 12,543, routeExpand 319,425 and 321,664, routeRefresh 128,727 and 119,378, routeHit 45,511 and 44,972. Seed 42: 8,919 and 9,633; 226,030 and 240,968; 115,563 and 116,565; 48,592 and 47,881.node tests/counters.js, per living pawn-day, before, after, target): routeSearch 0.5828, 0.6188, 0.3606 (out before and after); routeExpand 2.721, 2.861, 1.648 (out before and after); routeRefresh 4.1, 3.646, 0.9203 (out before and after, nearer). node tests/scaling.js: scaling.routeRefresh 1.131, 1.266 against 1.15: in before, out after, residual +0.116, and this change is its cause (more tiles are marked, and each mark checks the cached routes). npm run verify: 104 of 104; 17 targets out, 16 before. No target or baseline was changed.small-y40, medium-ref).