feat: derive resource visuals from state

This commit is contained in:
Rijad Zuzo
2026-07-17 18:39:14 +02:00
parent 04c5371b6b
commit 2719b0398b
21 changed files with 686 additions and 18 deletions
+20 -8
View File
@@ -904,17 +904,29 @@ of eighteen resources, sit above the carved channel, and expose separate
terrain-snapped approach points. A forced village query expands beyond the
initial 24 m range and selects the nested berry exactly by ID.
The immediate next slice should make those two resource-specific visuals
reflect authoritative amount/depletion: thin the berry patch and leave a stump
or equivalent readable tree state after real NPC/player extraction, then prove
save/restore rebuilds the same presentation without persisting visual-only
state. Only after both the berry and tree consume that contract should shared
cluster/depletion tooling be extracted or the workflow copied to a forest
edge. Do not generalize the resource grid to people/buildings/events or
introduce active/abstract LOD before those consumers need it.
The first amount-derived resource presentation slice is complete. A shared
`ResourceAmountVisual` contract reads the loaded `ResourceNode`'s authoritative
amount and derives full, low, or depleted presentation without entering saved
state. Real player berry harvests remove fruit and leaf mass; real NPC wood
gathers thin the crown and ultimately leave a warm-cut stump. Restoring both
low and depleted snapshots rebinds the same nodes and reconstructs the same
visuals from `ResourceStateRecord.amount_remaining` alone.
The immediate next slice should apply that proven contract to the existing
`tree_forest_grove_01` and `tree_forest_grove_02` anchors as one bounded
forest-edge authoring consumer. Preserve both stable IDs, keep decorative
canopy/understory outside simulation state, and prove reachable expanding
discovery plus depletion/restore with the shared tree presentation. Do not
generalize the resource grid to people/buildings/events or introduce
active/abstract LOD before those consumers need it.
Recently completed:
- `Jajce Resource States 05`: the authored river berry/tree now derive full,
low, and depleted visuals from authoritative amounts. Player and NPC
extraction drive the changes, save/restore reconstructs low and depleted
states without visual save fields, and matched Metal frames record the berry
thinning, sparse crown, fruitless remnant, and stump.
- `Jajce Resource Grove 04`: two existing river resources now live as nested
stable-ID anchors inside a restrained decorative bank cluster. Twenty-eight
understory instances use three MultiMesh batches, bespoke berry/tree visuals