feat: add deterministic goat routine

This commit is contained in:
Rijad Zuzo
2026-07-26 23:52:56 +02:00
parent f79c2bb630
commit e3aa3440a2
61 changed files with 1393 additions and 1057 deletions
+24 -7
View File
@@ -3,7 +3,7 @@
## Current contract
`SimulationStateRecord` is the versioned JSON boundary for the current
simulation. The current world schema is v10 and captures:
simulation. The current world schema is v11 and captures:
- simulation seed, tick interval, tick count, clock remainder, and elapsed
clock ticks;
@@ -14,7 +14,8 @@ simulation. The current world schema is v10 and captures:
- scene-independent resource state plus the definition facts needed while its
ResourceNode is unloaded;
- scene-independent animal identity, position, hunger, feeding history,
reservation, and availability state;
reservation, availability, current routine site, active travel destination,
and next routine tick;
- pantry contents, carried NPC inventory, the ordered economic event stream,
and its next stable event ID;
- directed relationship records with familiarity, trust, and the stable event
@@ -31,7 +32,7 @@ The top-level identity is:
```json
{
"schema": "the_steward.simulation",
"schema_version": 10
"schema_version": 11
}
```
@@ -179,6 +180,13 @@ species IDs, display name, authoritative world position, hunger,
World schema v9 preserves opportunity history while migrating to an empty
animal list.
SimulationStateRecord v11 preserves world-v10 animals and upgrades nested
`AnimalStateRecord` v1 to v2. The nested schema adds `routine_site_id`,
`travel_target_site_id`, exact `travel_target_position`,
`has_travel_target`, and `next_routine_tick`. Migrated animals receive an
idle, immediately due routine without inventing a destination; loaded-world
selection establishes the first real target later.
Current-schema parsing requires unique animal IDs that do not collide with
resource or storage IDs. An animal reservation must belong to an existing NPC
whose active feed task targets that exact animal. Every `animal_fed` event
@@ -255,9 +263,10 @@ after a JSON round trip.
## Animal authority
`AnimalCareSystem` owns `AnimalStateRecord` instances independently of the
scene tree and advances their hunger in stable-ID order. `AnimalNode` binds a
loaded presentation and interaction point to that authority; the simulation
position remains canonical while the node is loaded or absent.
scene tree and advances hunger and due routine selection in stable-ID order.
`AnimalNode` binds a loaded presentation and interaction point to that
authority; the simulation position and selected destination remain canonical
while the node is loaded or absent.
Animals are not `ResourceNode` instances and are not inserted into the
resource discovery grid. The first bounded slice uses a deterministic linear
@@ -266,6 +275,14 @@ care operation: reserve or select the exact animal, withdraw one real food
from `village_pantry`, reduce that animal's hunger, and append one exact
`animal_fed` fact. Failed withdrawal changes neither animal nor history.
The first routine consumer alternates Dunja between stable-ID shelter and
pasture markers without drawing RNG. `ActiveWorldAdapter` supplies the loaded
marker positions, the selected ID and exact position enter state, and
`AnimalNode` follows a real `NavigationServer3D` path while reporting factual
position changes. A mid-route save restores the same position and target;
unloading the scene node pauses presentation only, and reloading it resumes
from those facts. Hunger cancels travel before care targeting.
The persistent hungry/content presentation derives from authoritative hunger.
The short feed response is transient and is reset rather than serialized or
replayed after restore.
@@ -288,7 +305,7 @@ This phase does not yet provide:
- a save-slot menu, metadata, thumbnails, autosaves, or multiple profiles;
- migrations from any historical world schema other than the explicitly
supported v1v9 layouts;
supported v1v10 layouts;
- player inventory or player relationship records;
- broader relationship dimensions, line-of-sight/hearing evidence,
continuous or personalized memory decay, reinforcement, false beliefs, or