village-builder

VB-468: The idle stroll costs less

Status: done (2026-11-15) Priority: 2 Size: S Design ref: docs/review-jobs.md section 6 A Goal: Idling costs little, and idle pawns meet company as often as today. Acceptance criteria:

Implementation and validation (VB-468)

Measured over 3 years of populous small (seeds 7 | 42), by a throwaway script (hourly idle sampling; idle share = idle % of work hours, mean of roles). Both options were built: walkTo(..., near) (the stroll’s args.near) walks a stroll to a neighbouring tile straight, no route; and IDLE.wait is longer. Runs (seed 7 unless noted): | run | talks/pawn-day | ties | idleStroll | routeHit | routeSearch | | before | 6.617 | 6.658 | 14498 | 16620 | 135141 | 125356 | 138518 | 135186 | 84701 | 92089 | | 1 near only | 6.617 | 6.658 | same | same | 113276 | 119563 | 82885 | 90118 | | 2 wait [3,6] | 6.573 | 14464 | 99310 | 101504 | 77789 | | 3 wait [4,8] (chosen) | 6.628 | 6.617 | 14394 | 16362 | 79809 | 74531 | 93715 | 99241 | 74041 | 79120 | | 4 wait [6,12] | 6.572 | 14372 | 63668 | 88296 | 70958 | The near walk alone changes nothing in behaviour (talks identical) but takes out the cache lookups (routeHit -18%, searches -2%): most strolls already hit the cache, so the cost is in the stroll itself, and a longer pause is what saves. Chosen: IDLE.wait 2-4 h to 4-8 h; strolls -41% | -41%, route hits -32% | -27%, searches -13% | -14%. Talks a pawn-day: 6.617 to 6.628 (+0.2%) | 6.658 to 6.617 (-0.6%), within a twentieth; ties 14498 to 14394 | 16620 to 16362 (-0.7|-1.6%). Idle share by season, spring/summer/autumn/winter %, seed 7: 28.6/33.6/21.2/56.1 to 29.0/33.2/21.4/57.1; seed 42: 27.6/36.5/20.8/58.5 to 28.5/38.4/20.5/59.0. Households not measured separately (only island-wide numbers are judged). Checks: npm test and npm run verify pass.