Commit 3350dc3
Genesis: living details — crops ripen, logs lie, saplings come up
Props stop being one sprite for the whole day.
CROPS RIPEN. A crop plot is three sprites now: sprouts on bare drills
before ~10:00, the rows that have always been there until ~16:00, and
tall gold after. The stage is a pure function of the clock and a ±40
world-minute jitter off the plot's own seed, so a valley's fields do not
all turn on the same stroke. `buildCropRow` is untouched and is still the
middle stage; the two new sprites are built from the same pool seeds, so
a field keeps its colour and its earth as it ripens.
FELLED LOGS. A tree that goes over leaves its trunk beside the stump for
ninety world-minutes, then the yards haul it. The honest clock for that
needed the snapshot to say WHEN a tree became a stump, not just that it
had — scene-side it could only ever have been "the frame I noticed the
slot flip", which is a different world after a scrub. So WorldSnapshot
grows one field, `felled: Map<treeId, t>`, written by the `chop-done`
event that already existed: no new event type, TYPE_RANK untouched,
applyEvent/emptySnapshot updated in timeline.ts and fixture.ts alike, and
serialize() in the harness taught the field so check (j) still compares
all of the snapshot. A new check (j2) holds `felled` to the events and to
`trees` at midnight and at midday.
SAPLINGS. Three to five come up after ~18:00 on ground the day's axes
cleared — anchored to road clears standing clear of every town, so
regrowth lands on the lane through the wood and not under somebody's new
roof, and each one still gated on its anchor actually being a stump.
VEG CACHE. The layer's two fingerprints say "nothing changed unless the
snapshot grew", and all three of these change on the clock instead, so
each carries its own sweep: crops and saplings are recomputed outright
every sync (a dozen plots, five saplings), and a felled log turns ON
through the existing tree paths but OFF through `veg.logOn`, the short
list of trunks currently on the ground. None of the three caches a state
of its own — every one recomputes what it wants from (snapshot, t) and
lets `want` compare it against `veg.on` — so a backward scrub still needs
nothing beyond `invalidateVeg`. Log slots and sapling anchors are
allocated only for trees the map has already promised to a plot or a
road, which is the complete set that can ever become a stump; the other
two thousand trees are unchanged two-slot trees.
Gates: genesis:check 61/61, sweep 200 seeds 1x/4x, perf worst avg 2.6ms /
max 4.7ms against 4:8, astro build 7 pages, console clean. Scrubbing to
the same t twice gives identical pixels, and the veg layer at 08:00,
13:00 and 19:30 is identical whether reached by loading or by scrubbing
back from 21:00.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B7t8Qgo2z11gAegjSKAr7b1 parent 80d3628 commit 3350dc3
7 files changed
Lines changed: 624 additions & 8 deletions
File tree
- scripts
- src/components/designs
- genesis
- vale
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
312 | 312 | | |
313 | 313 | | |
314 | 314 | | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
315 | 318 | | |
316 | 319 | | |
317 | 320 | | |
| |||
593 | 596 | | |
594 | 597 | | |
595 | 598 | | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
596 | 619 | | |
597 | 620 | | |
598 | 621 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
730 | 730 | | |
731 | 731 | | |
732 | 732 | | |
733 | | - | |
| 733 | + | |
734 | 734 | | |
735 | | - | |
| 735 | + | |
736 | 736 | | |
737 | 737 | | |
738 | | - | |
| 738 | + | |
739 | 739 | | |
740 | | - | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
741 | 746 | | |
742 | 747 | | |
743 | 748 | | |
| |||
907 | 912 | | |
908 | 913 | | |
909 | 914 | | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
910 | 949 | | |
911 | 950 | | |
912 | 951 | | |
| |||
1244 | 1283 | | |
1245 | 1284 | | |
1246 | 1285 | | |
1247 | | - | |
1248 | | - | |
| 1286 | + | |
| 1287 | + | |
1249 | 1288 | | |
1250 | 1289 | | |
1251 | 1290 | | |
| |||
1307 | 1346 | | |
1308 | 1347 | | |
1309 | 1348 | | |
1310 | | - | |
| 1349 | + | |
1311 | 1350 | | |
1312 | 1351 | | |
1313 | 1352 | | |
1314 | 1353 | | |
1315 | 1354 | | |
1316 | 1355 | | |
1317 | 1356 | | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
1318 | 1364 | | |
1319 | 1365 | | |
1320 | 1366 | | |
1321 | 1367 | | |
1322 | 1368 | | |
1323 | 1369 | | |
1324 | | - | |
| 1370 | + | |
1325 | 1371 | | |
1326 | 1372 | | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
1327 | 1380 | | |
1328 | 1381 | | |
1329 | 1382 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
610 | 610 | | |
611 | 611 | | |
612 | 612 | | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
613 | 616 | | |
614 | 617 | | |
615 | 618 | | |
| |||
657 | 660 | | |
658 | 661 | | |
659 | 662 | | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
660 | 666 | | |
661 | 667 | | |
662 | 668 | | |
| |||
0 commit comments