feat: add physical animal care delivery

This commit is contained in:
Rijad Zuzo
2026-07-31 00:19:41 +02:00
parent 7d410d8193
commit ead75fca68
25 changed files with 1469 additions and 191 deletions
+39 -6
View File
@@ -53,6 +53,8 @@ SimulationManager tick
compatibility path for isolated adapters;
- checks simulation-owned ResourceStateRecord availability;
- reserves and returns stable resource target IDs;
- reserves the exact loaded animal before returning the pantry pickup waypoint,
then resolves only that same claim for the delivery leg;
- skips full-capacity activity sites based on authoritative NPC target claims;
- returns typed activity-site, storage, or wander positions without owning
presentation.
@@ -88,13 +90,16 @@ The manager publishes the latest `ActionSelectionResult` for presentation; the
UI does not recompute decisions. Each idle selection re-derives the capable
helper instead of consulting persisted assignment state. At completion it
atomically pays any definition-backed stored-resource cost before applying the
action effect. A late shortfall suppresses the effect and records a
action effect. `feed_animal` is the one bounded compound exception: pantry
arrival withdraws the exact cost into inventory and requests the already
claimed animal as the second destination; goat arrival then enters normal
working completion. A late shortfall suppresses the effect and records a
`task_blocked` fact. The manager also captures actor/nearby knowledge before
forwarding newly recorded events into `RelationshipSystem`. When an NPC arrives
beside a worker at the same non-storage activity site, the manager may transfer
one direct known fact and applies its consequence only to that newly informed
listener. An open opportunity's exact trigger receives bounded priority in
that conversation before normal lasting/recent ranking. It exposes
forwarding newly recorded events into `RelationshipSystem`. When an NPC
arrives beside a worker at the same non-storage activity site, the manager may
transfer one direct known fact and applies its consequence only to that newly
informed listener. An open opportunity's exact trigger receives bounded
priority in that conversation before normal lasting/recent ranking. It exposes
knowledge, provenance, relationship, and cause queries without moving social
authority into UI. After consequences are known, it protects current causal
facts, enforces the recent-memory cap, and runs age review from authoritative
@@ -103,6 +108,8 @@ simulation ticks.
### VillageEconomy
- owns storage and NPC-inventory transfer operations;
- supports exact all-or-nothing pickup and carried-inventory removal for the
animal-care cost;
- keeps `village.food` and `village.wood` synchronized as aggregate views;
- validates and pays definition-backed completion costs;
- emits completed transaction facts without owning their history.
@@ -164,6 +171,32 @@ State restore clears active feedback and re-derives the prompt from current
simulation and loaded-world facts. The HUD is separate from development
overlays so the embodied action remains legible in cinematic mode.
## Compound animal-care delivery contract
NPC `feed_animal` remains one task and one exact animal claim across two travel
legs. `ActionTargetResolver` first chooses and reserves the nearest eligible
loaded animal but returns `ActiveWorldAdapter`'s pantry interaction position
when the caretaker lacks the definition cost. Pantry arrival atomically moves
the missing amount into `SimNPC.inventory`; the existing inventory signal makes
the carried-food prop visible. The resolver then looks up only the claimed
animal and requests its current loaded interaction position.
The second leg is derived from carried inventory rather than a separate saved
phase. Pickup occurs only when the completed saved waypoint still matches the
current pantry waypoint. A compatible older route with empty inventory and a
goat destination is first redirected to the pantry instead of withdrawing
remotely. An older already-working feed state with no carried food recovers the
same route on its first resumed tick and preserves its work progress. Before a
successful pickup publishes inventory, event, or village signals, the saved
destination already names the exact goat; synchronous observers therefore
cannot capture carried food with a stale pantry waypoint. At the goat,
completion removes the exact cost from the matching NPC inventory, mutates only
that animal, releases its claim, and records the inventory-to-animal fact. If
pantry contention loses, no partial transfer is allowed, one `task_blocked`
fact names the pantry shortfall, and only that caretaker's goat claim is
released. Player feeding remains the bounded direct pantry-to-animal path
because player inventory is still deferred.
## Active-position contract
NpcVisual emits active position changes after successful movement.