feat: add provenance-aware npc communication

This commit is contained in:
Rijad Zuzo
2026-07-11 19:58:47 +02:00
parent 81409650df
commit 9a479ba182
18 changed files with 938 additions and 70 deletions
+20 -14
View File
@@ -414,8 +414,9 @@ Focused `RefCounted` collaborators keep rule ownership visible:
- `VillageEconomy` owns storage/inventory transactions and synchronized
village resource views;
- `SimulationEventLog` owns deterministic event history and queries;
- `EventKnowledgeSystem` owns per-NPC known-event references and captures
actor/nearby evidence when a witnessable event is recorded;
- `EventKnowledgeSystem` owns per-NPC known-event references, immutable
first-acquisition provenance, actor/nearby evidence capture, and bounded
one-hop communication;
- `RelationshipSystem` owns directed relationship state, event-driven trust
consequences, and deterministic social queries.
@@ -476,6 +477,7 @@ NpcVisual navigates through the active world
| |
| v
| SimulationManager marks NPC as working
| -> at a shared activity, one nearby worker may communicate one direct fact
| |
| v
| Later ticks complete work
@@ -521,12 +523,13 @@ NpcVisual navigates through the active world
│ ├── definitions/ Stable IDs and custom definition resources
│ ├── economy/ Inventory and storage transactions
│ ├── events/ Ordered event history and queries
│ ├── knowledge/ Per-NPC references to known objective events
│ ├── knowledge/ Per-NPC facts, provenance, and bounded transfer
│ ├── persistence/ Validated local save-slot storage
│ ├── relationships/ Directed social consequences and queries
│ └── state/ Versioned simulation-state records
├── tests/
│ ├── action_system_boundaries_test.gd
│ ├── communicated_knowledge_consequence_test.gd
│ ├── deterministic_simulation_test.gd
│ ├── food_storage_loop_test.gd
│ ├── jajce_world_scaffold_test.gd
@@ -568,7 +571,7 @@ These are expected prototype constraints, not necessarily isolated bugs:
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, knowledge, relationship,
clock, and RNG state serialize through world schema v5. F5/F9 provide one
clock, and RNG state serialize through world schema v6. F5/F9 provide one
validated local quicksave; a save menu, metadata, and player-transform
persistence remain deferred.
- Simulation-owned resource records retain live amounts, reservations, and
@@ -582,12 +585,13 @@ These are expected prototype constraints, not necessarily isolated bugs:
village storage. Other village metrics remain aggregate values rather than
located items.
- NPCs have home positions, schedule periods, carried food/wood, and directed
familiarity/trust. They can retain direct proximity-witness knowledge of a
food deposit, but do not yet have wider social dimensions, goals, line of
sight/hearing evidence, memory decay, false beliefs, or communication.
- The reason inspector exposes current decisions, utility rejections, and one
exact relationship cause plus the latest known fact, but deeper historical
decision traces are not yet retained.
familiarity/trust. They retain direct or one-hop communicated knowledge of a
food deposit with first-acquisition provenance, but do not yet have wider
social dimensions, goals, line-of-sight/hearing evidence, importance/decay,
false beliefs, or multi-hop rumours.
- The reason inspector exposes current decisions, utility rejections, one exact
relationship cause, and the latest known fact with its speaker when
communicated, but deeper historical decision traces are not yet retained.
- Active navigation is used as if all agents are local; no simulation LOD exists.
- Unloaded traveling NPCs preserve their state but do not yet advance through
abstract travel time.
@@ -827,10 +831,12 @@ simulation-garden runtime capture are complete.
The first relationship and knowledge consequences are also complete:
food-deposit events become separate known facts for their actor and nearby
living NPCs; only an informed hungry familiar NPC gains directed trust. The
exact event remains visible as both known fact and relationship cause, and that
trust can redirect ordinary work toward helping a starving acquaintance. One
provenance-aware NPC-to-NPC fact transfer is the next systems slice.
living NPCs; only an informed hungry familiar NPC gains directed trust. At a
shared non-storage activity, an already-working direct knower can tell one fact
to an arriving nearby villager. The same event remains visible as known fact
and relationship cause, the inspector names the speaker, and the listener's
future work can change without duplicating event history. Importance and
retention for known facts is the next systems slice.
The remaining simulation-garden target still aims for: