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
+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.