feat: replace activity markers with typed sites

This commit is contained in:
2026-07-07 13:27:02 +02:00
parent e5bd93d705
commit 4c090f1635
19 changed files with 308 additions and 126 deletions
+3 -2
View File
@@ -39,12 +39,13 @@ SimulationManager tick
- consumes active-world facts through ActiveWorldAdapter;
- checks simulation-owned ResourceStateRecord availability;
- reserves and returns stable resource target IDs;
- returns activity or wander positions without owning presentation.
- returns typed activity-site, storage, or wander positions without owning
presentation.
### ActiveWorldAdapter
- exposes loaded resource interaction positions;
- maps current temporary activity markers to action IDs;
- exposes loaded storage and activity-site interaction positions;
- contains active-world query facts, not persistent mutable authority;
- does not choose actions or reserve resources.
+23 -25
View File
@@ -41,8 +41,8 @@ Do not redo these tasks:
- hunger, energy, starvation, death, task scoring, and task duration;
- task-change and village-change signals;
- visual NPC navigation and arrival reporting;
- finite berry/tree ResourceNodes plus food, guard, study, and rest activity
markers;
- finite berry/tree ResourceNodes plus typed food, guard, study, and rest
world sites;
- aggregate village UI;
- initial tree assets;
- a baked navigation region for the current flat test area.
@@ -56,21 +56,20 @@ plugin content. They are references, not the game.
```text
Main
├── current flat World and NavigationRegion3D
├── JajceWorld
├── Player
├── CameraRig
├── SimulationManager
├── WorldViewManager
├── ActiveNPCs
├── ActivityMarkers
├── typed world sites inside JajceWorld/WorldObjects
├── WorldEnvironment
└── UI
```
The player and `WorldViewManager` still reference non-resource activity sites
through exported `NodePath` values. `NpcVisual` relies on the navigation map to
reach legacy guard/study/rest markers, `ResourceNode` interaction points, and
the typed village pantry `StorageNode`.
The player still references interactable world sites through exported `NodePath`
values. `NpcVisual` relies on the navigation map to reach typed `ActivitySite`,
`StorageNode`, and `ResourceNode` interaction points.
Replacing the ground without respecting those references would break behavior
that already works.
@@ -95,12 +94,12 @@ Main
│ │ ├── ResourceNodes
│ │ ├── BerryBush instances
│ │ └── Tree instances
│ │ ── StorageSites
│ │ └── VillagePantry
├── LegacyActivityMarkers temporary non-resource activities
│ │ ├── GuardZone
│ │ ├── StudyZone
│ │ └── RestZone
│ │ ── StorageSites
│ │ └── VillagePantry
│ └── ActivitySites
│ │ ├── GuardPost
│ │ ├── StudyDesk
│ │ └── RestBench
│ ├── DirectionalLight3D
│ └── WorldEnvironment
├── Player
@@ -111,11 +110,10 @@ Main
└── UI
```
`JajceWorld` should contain geography, world-object presentations, and temporary
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.
`JajceWorld` should contain geography and world-object presentations. The former
legacy interaction locations now live as typed storage and activity sites under
`WorldObjects`; `JajceWorld` should not own `SimulationManager`, simulated NPC
data, player state, or UI.
Create a small look-development wrapper that instances the same world:
@@ -295,7 +293,7 @@ Create `world/jajce/JajceWorld.tscn` with:
- placeholder `VillageRoot`;
- placeholder `FoliageRoot`;
- a navigation region;
- resource-node containers plus temporary activity markers;
- resource-node, storage-site, and activity-site containers;
- lighting and environment.
Create `JajceLookdev.tscn` that instances `JajceWorld` and adds a temporary
@@ -422,8 +420,8 @@ Once the world composition is stable:
2. Disable or remove the old flat world only after the new instance is present.
3. Place or move bushes and trees under
`JajceWorld/WorldObjects/ResourceNodes` while preserving stable IDs.
4. Reconnect only remaining non-resource activity markers under
`JajceWorld/LegacyActivityMarkers`.
4. Reconnect remaining non-resource activities as typed sites under
`JajceWorld/WorldObjects`.
5. Bake navigation for the new walkable area.
6. Test each existing task from multiple spawn positions.
7. Verify task arrival still transitions from traveling to working.
@@ -436,8 +434,8 @@ Once the world composition is stable:
Do not move simulation ownership into `JajceWorld` to make wiring convenient.
**Status: runtime integration complete.** `main.tscn` now instances the reusable
world and points player/simulation adapters at its stable-ID resources and
remaining activity markers. The duplicate flat world objects were removed.
world and points player/simulation adapters at its stable-ID resources, storage
site, and activity sites. The duplicate flat world objects were removed.
The runtime regression checks Terrain3D presence, 24 navigation routes, core
task execution, starvation/death, player extraction parity, reservations, and
NPC visual lifecycle. Terrain sculpting and presentation polish remain
@@ -445,7 +443,7 @@ separate work, not blockers for this wiring milestone.
### Exit condition
The current three NPCs and player can perform all existing prototype behaviors
The current six NPCs and player can perform all existing prototype behaviors
inside the new terrain without regression.
### Phase 5 — Make the simulation readable on video
+5 -3
View File
@@ -652,9 +652,11 @@ Completed after the architecture gate:
The practical next sequence is:
1. Replace the remaining generic activity markers with typed world sites,
beginning with the pantry/storage presentation.
2. Add a cinematic/debug toggle and repeatable simulation-garden demo reset.
1. Add a cinematic/debug toggle and repeatable simulation-garden demo reset.
2. Expand resource discovery with many finite `ResourceNode` instances placed
in meaningful foliage, animal-camp, berry, and village-stockpile contexts.
Score them by reachability, distance, safety, profession, and NPC comfort
range rather than reintroducing abstract resource zones.
3. Expand persistence only when schedules, player state, or a real save menu
creates a concrete requirement.
+30 -34
View File
@@ -180,9 +180,9 @@ The current prototype implements a very early version of observe, autonomous
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 rest, study, and patrol; eating and food
transfer now target the typed village pantry. The migration is documented in
zone markers. The obsolete farm, forest, and activity markers have been
removed. Eating and food transfer target the typed village pantry, while rest,
study, and patrol target typed activity sites. The migration is documented in
[the ResourceNode plan](RESOURCE_NODE_MIGRATION.md).
## Current technology
@@ -207,7 +207,7 @@ plugin content, not game architecture.
### World and player
- `main.tscn` contains a flat approximately 30×30 prototype ground.
- `main.tscn` instances the reusable Jajce Terrain3D world.
- The player is a `CharacterBody3D` represented by placeholder primitive
geometry.
- WASD movement is camera-relative.
@@ -215,17 +215,19 @@ plugin content, not game architecture.
follow/focus behavior.
- Pressing `E` near a berry bush or tree extracts its configured yield into the
village through the same `ResourceNode` contract used by NPCs.
- Guard, study, rest, and food interactions still use temporary activity
markers.
- Guard, study, rest, and food interactions now use typed world sites.
- `Escape` releases captured mouse input.
### Village simulation
The simulation currently creates three NPCs:
The simulation currently creates six NPCs:
- Amina
- Tarik
- Jasmin
- Elma
- Mirza
- Lejla
Each receives a random profession from:
@@ -283,39 +285,34 @@ Needs override ordinary work. Otherwise a utility-like score combines:
- profession preference;
- a small random contribution.
The visual NPC walks toward the task's marker. Arrival tells the simulation to
start work. Work progresses on simulation ticks. The village receives the
result only when the task duration completes.
The visual NPC walks toward the task's typed target position. Arrival tells the
simulation to start work. Work progresses on simulation ticks. The village
receives the result only when the task duration completes.
Starvation can reduce productivity and eventually kill an NPC. Dead visuals
stop moving, change appearance, and no longer collide.
### Current activity markers
### Current world targets
The main scene contains placeholder activity markers for guard duty, study,
and rest. The former farm and forest zones and their decorative geometry have
been deleted, and food storage now uses a typed pantry site.
The former farm, forest, food, guard, study, and rest markers have been deleted.
The runtime now uses semantic world targets:
**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, while
storage actions now route to a typed pantry site:
instances (berry bushes and trees), with no marker fallback. Non-resource
actions route through typed sites:
- patrol → guard marker;
- study → study marker;
- rest → rest marker;
- patrol → `ActivitySite` (`guard_post`);
- study → `ActivitySite` (`study_desk`);
- rest → `ActivitySite` (`rest_bench`);
- 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.
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.
Future resource expansion should add many finite `ResourceNode` instances rather
than broad resource zones: trees in foliage clusters, berry patches, animal
camps, and village stockpiles can be ranked by reachability, distance, safety,
profession, and NPC comfort range.
### Jajce scaffold
@@ -327,8 +324,7 @@ marker.
- 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;
- typed village pantry storage plus remaining guard, study, and rest activity
markers;
- typed village pantry storage and typed guard, study, and rest activity sites;
- a temporary baked navigation loop with 24 tested routes;
- a look-development scene and camera.
@@ -506,11 +502,11 @@ NpcVisual navigates through the active world
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 rest, study, and patrol; NPC and player
food/wood gathering use `ResourceNode` instances with no fallback, while food
transfer uses the typed pantry `StorageNode`.
- Action and profession IDs are stable and definition-backed, but several
action effects remain hard-coded.
- Temporary activity markers have been removed; NPC and player food/wood
gathering use `ResourceNode` instances with no fallback, food transfer uses
the typed pantry `StorageNode`, and patrol/study/rest use `ActivitySite`.
- 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.
+2 -2
View File
@@ -13,8 +13,8 @@ sources of truth.
visual slice. It must respect the architecture gates in the learning
roadmap.
4. [`RESOURCE_NODE_MIGRATION.md`](RESOURCE_NODE_MIGRATION.md) is a focused
migration plan. Phases 15 are complete; Phase 6 tracks replacement of the
remaining temporary activity markers.
migration plan. Phases 16 are complete; follow-up work should expand
resource discovery without reintroducing abstract resource zones.
5. [`ACTION_SYSTEM_ARCHITECTURE.md`](ACTION_SYSTEM_ARCHITECTURE.md),
[`ECONOMIC_EVENTS.md`](ECONOMIC_EVENTS.md),
[`FOOD_STORAGE_ARCHITECTURE.md`](FOOD_STORAGE_ARCHITECTURE.md),
+20 -8
View File
@@ -10,7 +10,7 @@
| **4a** | Wood target selection (NPC) | ✅ Complete |
| **4b** | Player parity (extraction contract) | ✅ Complete |
| **5** | Jajce world placement and runtime integration | ✅ Complete |
| **6** | Replace remaining activity markers | 🔶 Resource zones removed; activity targets pending |
| **6** | Replace remaining activity markers | ✅ Storage and activity sites authored |
### Key divergences from the original plan
@@ -61,9 +61,9 @@ environment is integrated. It is easier to debug target selection, reservation,
depletion, and task completion without terrain and navigation changes happening
at the same time.
The old resource zones have been removed. Temporary activity markers remain
only for actions whose real target type does not exist yet. They are not
fallbacks and are not part of the target architecture.
The old resource zones and temporary activity markers have been removed. Food
transfer targets `StorageNode`; rest, study, and patrol target `ActivitySite`.
These are not resource fallbacks and are not resource-search areas.
## Why this is the next systems step
@@ -522,10 +522,10 @@ Remove each old zone only when its replacement has:
- debug visibility;
- save representation.
**Progress:** the `TaskZone` container and obsolete `FarmZone`/`ForestZone`
nodes have been deleted from `main.tscn`. The surviving nodes live under
`LegacyActivityMarkers` to make their transitional role explicit. Task-to-marker
mapping still exists for rest, study, and patrol, so this phase is not complete.
**Progress:** the `TaskZone` container, obsolete `FarmZone`/`ForestZone` nodes,
and final `LegacyActivityMarkers` container have been deleted from `main.tscn`
and `JajceWorld`. Task-to-marker mapping has been replaced by typed site
queries.
The former `FoodZone`/`PantryMarker` is now an authored `StorageNode` at
`JajceWorld/WorldObjects/StorageSites/VillagePantry`, backed by
@@ -533,9 +533,21 @@ 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.
Guard, study, and rest are now authored `ActivitySite` instances at
`JajceWorld/WorldObjects/ActivitySites`. The adapter chooses the nearest loaded
site that supports the requested action. Capacity is currently presentation
metadata; reservation/enforced occupancy can be added when multiple NPCs
compete for the same social/workstation site.
**Exit:** temporary activity markers and task-to-marker mapping are deleted,
not merely unused.
**Status: complete for the marker-removal migration.** Future work should
extend target scoring rather than reintroducing zones: resources can be spread
as many finite `ResourceNode` instances across foliage, animal camps, berry
patches, and village stockpiles, then ranked by distance, reachability, safety,
profession, and NPC comfort range.
## Test scenarios
At minimum, exercise:
+4 -3
View File
@@ -12,10 +12,10 @@ same contract now runs against the integrated `JajceWorld` runtime.
The automated baseline verifies:
- the scene creates three simulated NPCs;
- the scene creates six simulated NPCs;
- four stable-ID ResourceNodes register;
- three fixed origins can reach the four remaining activity markers and four
ResourceNode interaction points (24 route checks);
- three fixed origins can reach the typed pantry, three typed activity sites,
and four ResourceNode interaction points (24 route checks);
- a two-tick working task completes;
- starvation still reaches death at its configured threshold.
@@ -24,6 +24,7 @@ The companion player-parity scenario verifies:
- player food extraction conserves the actual remaining amount;
- player wood extraction uses the configured yield;
- player depletion releases an NPC reservation.
- player pantry and guard interactions use typed world sites.
## Commands