Status: done (2026-11-22)
Priority: 3
Size: M
Design ref: none (the page’s drawing; src/page/settlement.js, buildFarms; src/page/animate.js, updateSettlement)
Goal: buildFarms destroys and redraws the whole settlement layer (fields, fences, houses, herds, every pawn’s rig) whenever st.visualDirty is set or st.rigDirty holds a pawn. The simulation asks for that on about 85 steps a game year on populous tiny (255 of 34,560 steps in 3 years, seed 18): a field broken (71 sets), a meadow finished (49), a building raised (27), a plot’s or cottage’s step (27 each), scrub cleared (25), a birth (16), a death (10). At the uncapped speed that is several whole rebuilds a second of wall time, each some hundreds of sprites and about 80 Graphics, for a change to one farm or one pawn. Rebuild what the change touched: the farm, the fence or the rig.
Acceptance criteria:
st.rigDirty already names them) and leaves the others.st and writes only its flags (AGENTS.md, Conventions), so a set of dirty farms beside rigDirty, cleared by the page, is the existing pattern (rigDirty, treeDirty, landDirty); a whole rebuild stays for a load and a new game.tests/smoke.js, tests/browser.js), with VB-441’s check of the renderer’s Graphics contexts.
Notes:Sim.advance in 6-minute steps, counting the steps on which visualDirty or rigDirty was set; on 10 November (5ce315e) the same run asked on 168 steps (56 a year).buildFarms fills are shared by the frame’s drawing (fieldSprites, rigs, houseInfo, pitInfo, fences, herdSprites, deerSprites, meadowSprites, teamDraw), rigs indexed by pawn id: a partial rebuild has to keep them consistent.rigDirty, st.farmDirty and st.villageDirty (Sets of ids, cleared by the page); visualDirty stays the whole rebuild, for a load, a new game and the rare changes (booths, tar pits, a green, a household founded, emptied or inherited, the round).drawnBy), and is taken down and drawn again alone; the frame’s lists drop what was destroyed. Rigs named in rigDirty are remade, new pawns get theirs.visualDirty on a field’s stage change (fallow, scrub, a crop lost; the frame retextures from the stage), on scrub cleared (treeDirty and biomeDirty carry it) and on a birth (its rigs). A death names the widowed’s rig.tools/same.js (founders, heirs, populous; seeds 7, 42; tiny; 3 years): only the signals differ.