feat: add typed pantry storage site

This commit is contained in:
2026-07-07 12:57:47 +02:00
parent 33b9c1bdfb
commit e5bd93d705
16 changed files with 304 additions and 69 deletions
+10 -6
View File
@@ -67,9 +67,10 @@ Main
└── UI
```
The player and `WorldViewManager` still reference non-resource activity markers
The player and `WorldViewManager` still reference non-resource activity sites
through exported `NodePath` values. `NpcVisual` relies on the navigation map to
reach both those markers and ResourceNode interaction points.
reach legacy guard/study/rest markers, `ResourceNode` interaction points, and
the typed village pantry `StorageNode`.
Replacing the ground without respecting those references would break behavior
that already works.
@@ -91,11 +92,12 @@ Main
│ ├── FoliageRoot
│ ├── NavigationRegion3D
│ ├── WorldObjects
│ │ ── ResourceNodes
│ │ ── ResourceNodes
│ │ ├── BerryBush instances
│ │ └── Tree instances
│ │ └── StorageSites
│ │ └── VillagePantry
│ ├── LegacyActivityMarkers temporary non-resource activities
│ │ ├── PantryMarker
│ │ ├── GuardZone
│ │ ├── StudyZone
│ │ └── RestZone
@@ -110,8 +112,10 @@ Main
```
`JajceWorld` should contain geography, world-object presentations, and temporary
legacy interaction locations. It should not own `SimulationManager`, simulated
NPC data, player state, or UI.
legacy interaction locations. The pantry has since moved out of
`LegacyActivityMarkers` into `WorldObjects/StorageSites/VillagePantry`; guard,
study, and rest remain temporary markers. `JajceWorld` should not own
`SimulationManager`, simulated NPC data, player state, or UI.
Create a small look-development wrapper that instances the same world:
+5 -5
View File
@@ -24,8 +24,8 @@ world only when consumed.
transactions.
- `village.food` is a synchronized aggregate view used by the existing UI,
priorities, and utility scoring. It is not a second mutation path.
- `PantryMarker` supplies the active-world interaction position for deposit,
withdrawal, eating, and current player pantry interaction.
- `StorageNode` supplies the active-world interaction position and presentation
for deposit, withdrawal, eating, and current player pantry interaction.
The village pantry has stable ID `village_pantry`. Storage and NPC inventory
are included in versioned state and deterministic checksums.
@@ -49,13 +49,13 @@ replans on its next idle tick.
## Deliberate limits
This slice contains one pantry and one carried item type. It does not yet add:
This slice contains one authored pantry and one carried item type. It does not
yet add:
- player inventory;
- storage reservations or access capacity;
- multiple households or ownership;
- spoilage, item quality, weight, or stack definitions;
- an authored StorageNode scene beyond the current pantry marker.
- spoilage, item quality, weight, or stack definitions.
Economic transfer events exist, but event retention, denial/depletion facts,
witnesses, and social interpretation are deliberately deferred.
+18 -12
View File
@@ -181,8 +181,8 @@ task choice, physical travel, work completion, resource change, and direct
player assistance. NPC `gather_food` and `gather_wood` tasks now use finite
world `ResourceNode` instances (berry bushes and trees) rather than abstract
zone markers. The obsolete farm and forest markers have been removed. Separate
temporary activity markers remain for eating, rest, study, and patrol. The
migration is documented in
temporary activity markers remain for rest, study, and patrol; eating and food
transfer now target the typed village pantry. The migration is documented in
[the ResourceNode plan](RESOURCE_NODE_MIGRATION.md).
## Current technology
@@ -293,25 +293,29 @@ stop moving, change appearance, and no longer collide.
### Current activity markers
The main scene contains placeholder activity markers for guard duty, study,
rest, and food. The former farm and forest zones and their decorative geometry
have been deleted.
and rest. The former farm and forest zones and their decorative geometry have
been deleted, and food storage now uses a typed pantry site.
**Migration status:** NPC `gather_food` and `gather_wood` target `ResourceNode`
instances (berry bushes and trees), with no marker fallback. The remaining
markers are direct transitional targets for non-resource NPC tasks:
markers are direct transitional targets for non-resource NPC tasks, while
storage actions now route to a typed pantry site:
- patrol → guard marker;
- study → study marker;
- rest → rest marker;
- eat → food marker.
- eat/deposit/withdraw → `StorageNode` (`village_pantry`).
The player also harvests food and wood directly from nearby `ResourceNode`
instances. Extraction returns the actual amount removed, updates the village by
that amount, and releases an NPC reservation if the source is depleted.
The food bullet above is the historical transition point: active eating,
deposit, and withdrawal now resolve to `WorldObjects/StorageSites/VillagePantry`
instead of a pantry marker.
Storage, rest, study, and guard behavior should later migrate to target types
that match their actual semantics rather than treating every usable object as a
resource source.
Rest, study, and guard behavior should later migrate to target types that match
their actual semantics rather than treating every usable object as a generic
marker.
### Jajce scaffold
@@ -323,7 +327,8 @@ resource source.
- fortress, houses, mill, bridge, shader river/waterfall, mist, and smoke;
- warm sky, fog, shadows, and wind-reactive foliage;
- four ResourceNodes preserving the flat-map stable IDs;
- remaining food, guard, study, and rest activity markers;
- typed village pantry storage plus remaining guard, study, and rest activity
markers;
- a temporary baked navigation loop with 24 tested routes;
- a look-development scene and camera.
@@ -503,8 +508,9 @@ These are expected prototype constraints, not necessarily isolated bugs:
- Action and profession IDs are stable and definition-backed, but activity
marker mapping and several action effects remain hard-coded.
- Temporary activity markers remain for eating, rest, study, and patrol; NPC
and player food/wood gathering use `ResourceNode` instances with no fallback.
- Temporary activity markers remain for rest, study, and patrol; NPC and player
food/wood gathering use `ResourceNode` instances with no fallback, while food
transfer uses the typed pantry `StorageNode`.
- Current NPC, village, resource, storage, event, clock, and RNG state serialize
through world schema v3. F5/F9 provide one validated local quicksave; a save
menu, metadata, and player-transform persistence remain deferred.
+8 -9
View File
@@ -14,7 +14,7 @@
### Key divergences from the original plan
- **Zone fallback removed** (Phase 3): `gather_food`/`gather_wood` no longer fall back to `FarmZone`/`ForestZone` markers when no resource node is available. The original plan called for a logged fallback; instead, the NPC goes idle (via `navigation_failed` → wander) to guarantee resource conservation. The obsolete farm and forest scene nodes have now also been deleted. The remaining markers are temporary targets for eating, rest, study, and patrol—not resource fallbacks.
- **Zone fallback removed** (Phase 3): `gather_food`/`gather_wood` no longer fall back to `FarmZone`/`ForestZone` markers when no resource node is available. The original plan called for a logged fallback; instead, the NPC goes idle (via `navigation_failed` → wander) to guarantee resource conservation. The obsolete farm and forest scene nodes have now also been deleted. The remaining markers are temporary targets for rest, study, and patrol—not resource fallbacks. Eating and food transfer now target the typed village pantry.
- **`navigation_failed` signal** (discovered during Phase 4): Added a separate signal pathway to distinguish genuine arrival from navigation failure. The original plan treated all "arrivals" uniformly.
- **Stale-path prevention** (discovered during Phase 4): Added `path_request_id` + `path_pending` to reject async path results that arrive after a new target was set or the NPC died.
- **Duplicate node_id detection** (discovered during Phase 4): Added startup validation that disables nodes with duplicate IDs and pushes an error.
@@ -524,15 +524,14 @@ Remove each old zone only when its replacement has:
**Progress:** the `TaskZone` container and obsolete `FarmZone`/`ForestZone`
nodes have been deleted from `main.tscn`. The surviving nodes live under
`ActivityMarkers` to make their transitional role explicit. Task-to-marker
mapping still exists for eating, rest, study, and patrol, so this phase is not
complete.
`LegacyActivityMarkers` to make their transitional role explicit. Task-to-marker
mapping still exists for rest, study, and patrol, so this phase is not complete.
The former `FoodZone` is now `PantryMarker` backed by simulation-owned
`StorageStateRecord` state and explicit deposit/withdraw transactions. A
dedicated authored StorageNode presentation is still pending. Successful food
transfers now emit serializable economic events, and an active NPC visibly
carries food between source, pantry, and consumption.
The former `FoodZone`/`PantryMarker` is now an authored `StorageNode` at
`JajceWorld/WorldObjects/StorageSites/VillagePantry`, backed by
simulation-owned `StorageStateRecord` state and explicit deposit/withdraw/eat
transactions. Successful food transfers emit serializable economic events, and
an active NPC visibly carries food between source, pantry, and consumption.
**Exit:** temporary activity markers and task-to-marker mapping are deleted,
not merely unused.