Status: done (2026-11-13) Priority: 2 Size: S Design ref: design.md, World and scale (Walking and terrain); src/sim/rules.js SLOPE Goal: Walking slows on a slope by the factor a walker’s speed falls by, the same up and down, on any terrain. Acceptance criteria:
exp(SLOPE.tobler × S), S = SLOPE.grade × the elevation between them, at most SLOPE.max; 1 on the level, the same up and down.SLOPE = { tobler: 3.5, grade: 1.5, max: 6 } in src/sim/rules.js, each with its meaning; grade: 0 switches slopes off.MAX_STEP) follows: the dearest terrain times SLOPE.max.tests/routes.js holds the formula, the symmetry, the cap, the proportion on hard ground and that a ramp is cheaper than a cliff.design.md, Walking and terrain, says what the code does.Tobler (1993): a walker makes 6 exp(-3.5 |S + 0.05|) km an hour at slope S. Kim asked for it symmetric around 0, so the 0.05 is dropped
and the speed falls by exp(-3.5 |S|).
grade 1.5, where the median step costs what it did. Read physically (1,400 m of relief, tiles of 150 m) grade would be 9.3: the
median step a slope of 0.3 and three times as slow, the 90th percentile 15 to 45 times. The heightmap is far steeper than ground is. The
level is left to a tuning run; only the shape changed.slopeCost (added) became slopeFactor (multiplied) in src/sim/routes.js; nothing outside the module and its test read it. No state changed.Math.exp a step where the two tiles differ in elevation (rule 6, compile what is hot: not compiled; see the cost below).Rise between walkable neighbours (small and medium, seeds 7 and 42): 0.03 to 0.04 at the median, 0.08 to 0.12 at the 90th percentile, 0.16 to 0.24 at the 99th, 0.4 to 0.5 at most. On meadow a step cost about 1.2, 1.6, 2.2 and 3; it costs about 1.2, 1.7, 2.9 and 6.
| Run | Living at year 10 | Mean grain | Walking, share of job hours |
|---|---|---|---|
| founders, seed 7 | 19 → 19 | 657 → 662 | 14.8% → 14.6% |
| founders, seed 42 | 21 → 20 | 565 → 496 | 17.3% → 16.2% |
| populous, seed 7 | 410 → 409 | 594 → 623 | 16.7% → 17.3% |
| populous, seed 42 | 431 → 433 | 585 → 592 | 18.5% → 19.4% |
(The walking share sums the hours report’s rows over its groups of households, unweighted: a description, not a target.)
main has, the same nine.npm test and npm run verify pass (104 of 104; 18 targets out, as on main).