40 KiB
The Steward — Project Context
Agent-facing context for understanding the project quickly.
Snapshot basis: repository state on July 14, 2026. Treat the code as the source of truth when this document and the implementation differ.
See the documentation map for the authority and scope of each plan.
Quick orientation
The Steward is currently a small Godot prototype for an embodied village simulation. Its larger purpose is to become a learning laboratory for a performant, large-scale NPC simulation that can later power a systemic open-world RPG.
The current village is not intended to be the final game's scale. It is a controlled environment in which to learn and validate:
- NPC needs and decision-making;
- professions, work, inventories, and economic dependencies;
- actions, consequences, and world events;
- relationships, memories, rumours, and persistent history;
- emergent situations that can be surfaced as quests;
- simulation level of detail for a much larger population;
- readable world presentation and satisfying embodied play.
The desired game is not an omniscient city builder and not primarily a scripted quest RPG. The player exists physically inside the simulated society.
North-star vision
A systemic open-world RPG set around a city inspired by Jajce, Bosnia and Herzegovina, and its surrounding villages. Every important NPC participates in a simulated society, forms relationships, remembers events, and can affect history. The player can remain an ordinary citizen, pursue a profession, become a trader, criminal, warrior, or companion leader, command armies, and eventually lead a faction.
The world should generate situations. Quests should primarily communicate, frame, and track those situations rather than manufacture disconnected content.
Example:
- A harvest fails or a trade route becomes unsafe.
- Food scarcity raises pressure on households and professions.
- An NPC steals, migrates, changes work, joins a criminal group, or asks a relative for help.
- Witnesses form memories and spread partial information.
- Relationships, prices, safety, and faction attitudes change.
- The player learns about the situation through observation, conversation, rumours, employment, or authority.
- Any intervention changes the same world state that produced the problem.
The quest is therefore a view onto the simulation, not a parallel scripted reality.
Product pillars
1. Simulated lives
NPCs should be people rather than production modifiers. Their needs, professions, possessions, schedules, abilities, ambitions, and circumstances drive their choices.
2. Persistent history
Important actions create structured events. Events can become memories, knowledge, rumours, relationships, reputations, grudges, obligations, and political consequences.
3. Emergent narrative
Authored content should provide rules, cultures, locations, characters, archetypes, and exceptional story beats. Ordinary quests and conflicts should preferably emerge from unresolved world conditions.
4. Embodied freedom
The player walks through the same spaces, uses the same resources, and participates in the same institutions as NPCs. They can play at different social scales without being forced toward rulership.
5. Legible autonomy
Complexity is valuable only when players can understand its consequences. The game should expose why an NPC chose an action and show resources moving through the world.
6. Small stories inside a large world
The eventual map may be large, but emotional attachment comes from recognizable people and local consequences. Simulation scale must not turn everyone into an anonymous number.
7. Enjoyable action
Movement and combat should be satisfying independently of the simulation. Companions and armies should offer expressive, enjoyable control rather than only statistical resolution.
8. A recognizable setting
The core region is inspired by Jajce: dramatic elevation, a fortified urban center, rivers, a waterfall, wooded slopes, lakes, watermills, roads, farms, and surrounding villages. This is an inspiration rather than a requirement for a literal historical reconstruction.
9. Cozy presentation with real stakes
The presentation should feel warm, painterly, pastoral, and inviting while the simulation remains capable of scarcity, conflict, death, political ambition, and social change.
Build-in-public goals
Visual appeal and watchability are prototype requirements, not final polish. Each simulation feature should have a visible expression:
| Simulation state | Visible expression |
|---|---|
| Hunger | Looking for food, checking storage, eating, asking, stealing, or weakening |
| Profession | Recognizable tools, clothing, workplace, route, and animation |
| Task choice | Purposeful movement plus optional task/thought icon |
| Production | Items visibly gathered, carried, stored, processed, and consumed |
| Relationship | Greeting, helping, arguing, avoiding, mourning, or celebrating |
| World event | Visible consequences and a concise event/history feed |
| Settlement change | Construction, depletion, prosperity, damage, migration, or recovery |
Development clips should communicate cause and effect without requiring viewers to read console logs. A cinematic/debug toggle should eventually allow the same scenario to be shown both beautifully and analytically.
Visual direction
The target is an original stylized look characterized by:
- painterly natural colors and soft, warm lighting;
- readable, exaggerated terrain and building silhouettes;
- lush vegetation with restrained environmental motion;
- expressive, animation-friendly characters;
- appealing water, mist, smoke, weather, and seasonal variation;
- cozy settlements contrasted with a world capable of hardship;
- a clear elevated third-person view that makes NPC activity readable.
Avoid generic high-fantasy spectacle and avoid treating visual style as a reason to hide the underlying simulation.
Initial environment composition
The first public-facing environment should be a compressed simulation garden, not the complete region:
- a fortress or fortified landmark on an upper ridge;
- a small settlement descending toward water;
- a river, bridge, and waterfall or strong vertical water feature;
- a mill channel and a small cluster of watermills;
- farm terraces and a wooded work area;
- a trade road and distant silhouettes that imply a larger world.
Terrain3D should own broad landforms, ground surfaces, distant landscape, and large-scale vegetation placement. Roads, river surfaces, waterfalls, cliffs that require overhangs, bridges, walls, buildings, and other authored landmarks should use dedicated meshes or appropriate spline/modular tooling.
Core player loop
The intended loop is:
- Observe people, places, stores, and local problems.
- Understand needs, causes, relationships, and competing priorities.
- Influence people through work, trade, conversation, policy, reputation, leadership, or force.
- Act personally through movement, interaction, production, exploration, and combat.
- Witness consequences in the same people and systems.
- Adapt to new opportunities and problems created by those consequences.
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, 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.
Current technology
- Engine: Godot 4.7 project configuration
- Renderer feature: Forward Plus
- Language: GDScript (
gdformat,gdlint, headless Godot 4.7 scenarios, and GUT run through the local quality gate) - Main scene:
res://main.tscn - Terrain: Terrain3D 1.0.2 is installed and enabled
- Jajce runtime: reusable 512 m Terrain3D seed, greybox landmarks, stable ResourceNode placement, lookdev camera, and Terrain3D-derived runtime navigation with collision guardrails
- Lookdev baseline:
Jajce Lookdev 01is captured atdocs/baselines/jajce_lookdev_01.pngwithtools/capture_jajce_lookdev.gd - Runtime baseline:
Simulation Garden 01is captured as paired debug and cinematicmain.tscnimages plus an empty/restocked pantry close pair underdocs/baselines/withtools/capture_simulation_garden.gd - Terrain compatibility floor: Godot 4.4 according to the bundled extension
- Version control: Git
- Primary branch:
main - Commit convention: Conventional Commits
Terrain3D includes binaries, source, editor tooling, examples, and a demo/
directory. Most files under addons/terrain_3d/ and demo/ are third-party
plugin content, not game architecture.
Current playable state
World and player
main.tscninstances the reusable Jajce Terrain3D world.- The player is a
CharacterBody3Dwith a compact multi-part stylized visual, velocity-driven walk motion, and unchanged primitive collision. - WASD movement is camera-relative.
- The elevated third-person camera rotates with the mouse, uses smoothed follow/focus behavior, and exposes an opt-in presentation preset for reproducible runtime captures.
- Pressing
Enear a berry bush or tree extracts its configured yield into the village through the sameResourceNodecontract used by NPCs. - Guard, study, rest, and food interactions now use typed world sites.
Escapereleases captured mouse input.
Village simulation
The simulation currently creates six NPCs:
- Amina
- Tarik
- Jasmin
- Elma
- Mirza
- Lejla
Each receives a random profession from:
- farmer;
- woodcutter;
- guard;
- scholar;
- wanderer.
Each simulated NPC currently stores:
- stable integer ID for the session;
- name and profession;
- hunger and energy;
- strength and intelligence;
- current task and task state;
- task duration and progress;
- simulated position;
- home position and carried inventory;
- last action and mourning duration;
- starvation state and duration;
- death state.
The village currently tracks:
- food, initially
20; - wood, initially
10; - safety, initially
50; - knowledge, initially
0; - per-resource modifiers;
- per-resource priorities.
NPC task lifecycle
Task states are:
idle -> traveling -> working -> complete -> idle
|
+-> navigation_failed -> wander -> idle
NPCs currently choose among:
- gather food;
- gather wood;
- deposit carried food or wood;
- withdraw and eat food;
- patrol;
- study;
- sleep;
- rest;
- wander.
Needs override ordinary work. Otherwise a utility-like score combines:
- village priority;
- critical and low resource thresholds;
- profession preference;
- a small random contribution.
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 world targets
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. Non-resource
actions route through typed sites:
- 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.
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. The current resolver already combines
distance with resource safety_risk, comfort_distance, and
discovery_priority metadata.
Jajce scaffold
world/jajce/JajceWorld.tscn provides the reusable environment instanced by
main.tscn:
- a centered 512 m Terrain3D landscape split across four regions;
- deterministic shaped terrain data and six game-owned surface layers;
- fortress, houses, mill, bridge, shader river/waterfall, mist, and smoke;
- authored dirt path strips that make the current village task loop readable;
- compact silhouette props for the ridge landmark, guard, study, and rest sites, plus a physical pantry whose empty/low/stocked arrangement follows authoritative food storage;
- warm sky, fog, shadows, coherent wind-reactive foliage, and breeze-aligned chimney smoke;
- one sparse terrain-aware calligraphic gust field with two or three soft tapered strokes per burst;
- eighteen ResourceNodes preserving stable food/wood discovery IDs;
- typed village pantry storage and typed guard, study, and rest activity sites;
- a Terrain3D-derived baked navigation mesh covering the current playable loop;
- base collision/navigation guardrails that keep Terrain3D collision enabled, keep the old greybox ground out of runtime physics, require paths to reach their targets, and compare required navigation paths against the Terrain3D height field;
- a look-development scene and camera;
- reproducible lookdev and runtime capture scripts plus review notes under
docs/baselines/.
This is a runtime integration proof, not the final terrain composition. Terrain3D startup requires several physics frames before reliable NavigationServer path queries; the scaffold and runtime tests capture that synchronization requirement.
Current UI
A small village panel displays:
- food;
- wood;
- safety;
- knowledge;
- starving NPC count;
- selected village modifiers.
- a Tab-cycled NPC inspector with profession, needs, task state, destination, decision reason, utility scores, directed familiarity/trust, and the exact completed event that last changed trust;
- a compact selected-person history that separates up to four importance-ranked retained memories from the NPC's three latest objective personal actions;
- a cardless active
Village needline sourced from the real pantry target, food progress, and interested villager, with open/resolved detail only in that person's inspector.
NPC name/profession labels, definition-driven colors and props, carried-food visuals, compact task glyphs, and a brief amber blossom on real trust gains make active simulation state readable in the world. The F10 cinematic mode hides debug labels while preserving task glyphs and transient social reactions. An open pantry opportunity adds a restrained empty-bowl concern cue only to its interested villager; a real refill changes the pantry props, clears concern, and produces one brief pantry response.
Runtime architecture
simulation/SimNPC.gd
SimNPC is a RefCounted simulation model. It owns needs, task state,
profession identity, carried inventory, starvation, and death. Focused systems
select and execute actions against that state.
This separation from the visual node is an important architectural seed and should be preserved.
simulation/SimVillage.gd
SimVillage is a RefCounted aggregate for synchronized village resource
views, modifiers, and priorities.
simulation/SimulationManager.gd
SimulationManager is currently a scene-tree Node that:
- owns the village and NPC array;
- advances deterministic ticks through
SimulationClock; - creates NPCs;
- coordinates selection, travel, reservations, and task completion;
- emits village, task, and death signals;
- exposes the bounded player/simulation command API.
Focused RefCounted collaborators keep rule ownership visible:
- action systems own selection, execution progress, and target resolution;
VillageEconomyowns storage/inventory transactions and synchronized village resource views;SimulationEventLogowns deterministic event history and queries;EventKnowledgeSystemowns per-NPC known-event references, immutable first-acquisition time/provenance, actor/nearby evidence capture, bounded one-hop communication, deterministic recent-memory retention, and stable importance ranking for presentation/communication queries;RelationshipSystemowns directed relationship state, event-driven trust consequences, and deterministic social queries;FoodShortageOpportunitySystemprojects the first knowledge-gated unresolved condition into a persisted open/resolved record without changing resources or assigning work.
SimulationManager remains the scene-tree façade and signal boundary rather
than duplicating these responsibilities across additional manager nodes.
world/world_view_manager.gd
WorldViewManager bridges simulation data to visible NPC nodes. It:
- instantiates
NpcVisualscenes; - supplies active visual positions for simulation-owned target resolution;
- sends resolved travel destinations to visuals;
- reports arrival and navigation failure back to
SimulationManager; - synchronizes successful visual movement into authoritative NPC position;
- applies visual death state;
- turns authoritative relationship-change signals into observer-only transient presentation cues without queuing or persisting them;
- derives pantry stock props and interested-villager concern from authoritative storage/opportunity state, including state-only rebuilding after restore.
player/npc/NpcVisual.gd
NpcVisual is the active-world representation of an NPC. It currently:
- owns a
NavigationAgent3D; - obtains a navigation path;
- moves and rotates toward path points;
- reports arrival;
- presents definition-driven profession silhouettes, carried resources, task glyphs, walk motion, brief trust-gain blossoms, opportunity concern, and death state.
player/player.gd and player/camera_rig.gd
These implement camera-relative character movement, physical interaction proximity checks, ResourceNode harvesting, mouse capture, and the elevated follow camera.
world/ui/ui.gd
The UI subscribes to village, task, event, knowledge, relationship, and opportunity changes. It formats aggregate state and resolves known facts, relationship causes, and opportunity lifecycle details through manager queries without owning or recomputing simulation facts.
Current runtime flow
SimulationManager tick
-> ActionExecutionSystem advances needs/work
-> ActionSelectionSystem chooses an action for idle NPCs
-> npc_target_requested
-> WorldViewManager supplies the active visual position
-> ActionTargetResolver consumes ActiveWorldAdapter facts
-> SimulationManager stores/reserves the target
-> npc_travel_requested
-> WorldViewManager commands visual travel
|
v
NpcVisual navigates through the active world
|
+-- arrived_at_target signal
| |
| v
| SimulationManager marks NPC as working
| -> at a shared activity, one nearby worker may communicate one direct fact
| |
| v
| Later ticks complete work
| |
| v
| ResourceStateRecord.extract() -> NPC inventory
| -> VillageEconomy transfers inventory/storage as actions complete
| -> SimulationEventLog appends completed facts
| -> EventKnowledgeSystem captures actor/nearby knowledge
| -> RelationshipSystem applies evidence-gated social consequences
| -> FoodShortageOpportunitySystem may open or resolve a real need
| |
| v
| village_changed signal updates the UI
|
+-- navigation_failed signal
|
v
SimulationManager releases reservation, sets last_task, sends NPC to wander
Repository map
.
├── addons/terrain_3d/ Third-party Terrain3D plugin
├── assets/foliage/ Early tree assets
├── demo/ Terrain3D's bundled demo, not the game
├── docs/ Project context and plans
├── player/
│ ├── camera_rig.gd
│ ├── PlayerVisual.tscn
│ ├── player.gd
│ ├── player_visual.gd
│ └── npc/
│ ├── NpcVisual.gd
│ └── NpcVisual.tscn
├── simulation/
│ ├── SimNPC.gd
│ ├── SimVillage.gd
│ ├── SimulationClock.gd
│ ├── SimulationManager.gd
│ ├── actions/ Selection, execution, and target resolution
│ ├── definitions/ Stable IDs and custom definition resources
│ ├── economy/ Inventory and storage transactions
│ ├── events/ Ordered event history and queries
│ ├── knowledge/ Per-NPC facts, provenance, transfer, and retention
│ ├── opportunities/ Knowledge-gated unresolved-condition projection
│ ├── 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
│ ├── food_shortage_opportunity_test.gd
│ ├── jajce_world_scaffold_test.gd
│ ├── knowledge_retention_consequence_test.gd
│ ├── jajce_runtime_integration_test.gd
│ ├── npc_visual_lifecycle_test.gd
│ ├── relationship_consequence_test.gd
│ ├── resource_node_player_parity_test.gd
│ ├── simulation_definitions_test.gd
│ ├── simulation_state_serialization_test.gd
│ ├── unit/test_food_shortage_opportunity_system.gd
│ └── witnessed_knowledge_consequence_test.gd
├── terrain/jajce/ Dedicated Terrain3D seed data and assets
├── tools/
│ └── generate_jajce_terrain_seed.gd
├── world/
│ ├── jajce/
│ │ ├── JajceWorld.tscn
│ │ ├── JajceLookdev.tscn
│ │ ├── jajce_world.gd
│ │ ├── beauty_camera.gd
│ │ └── vfx/WindGustField.tscn
│ ├── resource_nodes/
│ │ ├── ResourceNode.gd
│ │ ├── ResourceNode.gd.uid
│ │ └── ResourceNode.tscn
│ ├── active_world_adapter.gd
│ ├── world_view_manager.gd
│ └── ui/ui.gd
├── main.tscn
└── project.godot
Important limitations and technical debt
These are expected prototype constraints, not necessarily isolated bugs:
- 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
ResourceNodeinstances with no fallback, food transfer uses the typed pantryStorageNode, and patrol/study/rest useActivitySite. - Current NPC, village, resource, storage, event, knowledge, relationship, opportunity, clock, and RNG state serialize through world schema v8. 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 usage definitions while ResourceNode scenes are unloaded.
- An explicit fixed-step clock converts frame delta into simulation ticks, but
orchestration still lives on the scene-tree
SimulationManager. - Automated coverage includes deterministic same-seed and save/restore continuation checks, player-parity/resource-contention, flat-map, and Jajce scaffold scenarios; broader gameplay coverage is still missing.
- Food and wood now move through finite sources, NPC inventory, and typed 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 retain direct or one-hop communicated knowledge of a food deposit or NPC pantry withdrawal with first-acquisition provenance. Current trust causes and the trigger of an open opportunity are lasting; other knowledge is capped and reviewed after one simulated day. NPCs do not yet have wider social dimensions, goals, line-of-sight/hearing evidence, personalized reinforcement/decay, false beliefs, or multi-hop rumours.
- One persisted
restock_empty_pantryopportunity can emerge from a known withdrawal plus current emptiness and critical hunger. It has exact NPC and player supply resolutions, but no generic opportunity definitions, capable- helper assignment, acceptance, rewards, free-form dialogue, or quest log. - The reason inspector exposes current decisions, utility rejections, one exact relationship cause, and a compact person-history view that distinguishes importance-ranked retained memories from objective personal actions.
- 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.
- There is no spatial query/index layer for large populations.
- SimulationManager still coordinates the tick lifecycle and bounded player-facing commands, while action rules, active-world queries, economic transactions, and event history have focused collaborators.
- Path failure and interruption emit a
navigation_failedsignal and send the NPC to wander; this is functional but not yet polished. - The old greybox navigation source has been replaced by a project-owned Terrain3D-derived navigation resource. The current bake is still a first playable-loop pass, so future terrain sculpting should rerun the bake tool and recheck reachability rather than hand-editing navigation polygons.
- Terrain3D and the bounded Jajce beauty baseline now run in the main game
scene;
Jajce Lookdev 01and the runtimeSimulation Garden 01are captured as reproducible presentation baselines. - Combat, companions, factions, politics, trade, generalized/multi-hop rumours, a general quest framework, and regional travel do not yet exist.
- Stylized player/NPC silhouettes, water, foliage, and VFX support the current build-in-public baseline, while blockout buildings and several work/resource props remain visibly prototype-grade.
Target simulation architecture
Separate definitions, state, systems, and presentation
Use four conceptual layers:
- Definitions — immutable data for needs, actions, professions, items, traits, event types, and locations.
- State — serializable runtime records for NPCs, inventories, relationships, settlements, factions, and history.
- Systems — clocks, scoring, action resolution, economy, relationships, events, rumours, and persistence.
- Presentation adapters — Godot nodes that render nearby state, accept player input, play animation, and provide UI.
Do not make the simulation core depend on Node3D, scene paths, animation,
physics frames, or a currently loaded map.
The authoritative-boundary decision is recorded in
ADR 0001. The current
ResourceNode binding and the WorldViewManager active-position bridge follow
this boundary; new inventories, schedules, relationships, and knowledge should
remain scene-independent records and systems.
Authority and active-world adapters
Persistent mutable state belongs in versioned, serializable simulation records. Systems mutate those records. Godot nodes:
- present nearby records;
- expose active-world interaction transforms and navigation results;
- translate player input into simulation commands;
- synchronize active position through an explicit adapter;
- never become the only owner of a persistent amount, reservation, action, or identity.
Target selection may consume facts supplied by the active world, but the presentation bridge must not author an NPC's decision or persistent target.
Stable identity
Every persistent entity should eventually have a stable ID:
- person;
- household;
- item stack or significant item;
- building;
- workplace;
- settlement;
- faction;
- location;
- event.
References between simulation records should use IDs rather than live node references.
Fixed and deterministic time
The simulation should advance with an explicit clock and controlled random source. Given the same starting state, seed, and player commands, a headless run should be reproducible.
This enables:
- debugging;
- automated scenario tests;
- balancing;
- replaying build-in-public demonstrations;
- comparing performance before and after optimization.
Scheduled work rather than per-frame thinking
At scale, agents should wake for relevant decisions or scheduled updates rather than running full reasoning every frame. Examples include:
- need threshold crossed;
- action completed or interrupted;
- new information received;
- path or workplace became unavailable;
- daily schedule boundary;
- relationship or faction event;
- periodic low-frequency maintenance.
Simulation fidelity levels
The eventual world needs multiple representations:
- Active: full node, physics, navigation, perception, animation, and combat.
- Local abstract: individual position and scheduled actions without continuous physics.
- Distant individual: data-only people resolving travel and work by time.
- Settlement aggregate: carefully chosen economic or demographic aggregation for populations that do not currently need individual detail.
Moving between levels must preserve identity and important state. Aggregation must not erase named relationships or unresolved history.
Action model
Actions should become data-driven definitions with:
- preconditions;
- candidate targets;
- utility considerations;
- expected duration;
- reservations;
- resource costs;
- effects;
- interruption rules;
- visible presentation hints;
- reason tracing.
The first implementation can remain utility-based. Do not add a complex planner until current action scoring and sequencing demonstrate a concrete need.
Events and history
Important outcomes should create structured facts rather than prose-only logs. A future event record might contain:
event_id
event_type
simulation_time
location_id
actor_ids
target_ids
witness_ids
cause_event_ids
resource_changes
relationship_changes
visibility/secrecy
tags
Memories, rumours, reputation, and quests should reference or transform these facts. Generated text is presentation; structured state remains authoritative.
Emergent quest principle
A quest candidate should normally require:
- a real unresolved condition;
- an NPC or institution that knows or cares about it;
- a plausible way to communicate it;
- one or more achievable interventions;
- consequences that update the source simulation.
Avoid creating a duplicate quest-only bandit, item, victim, or relationship when an existing simulated entity can provide the situation.
Performance principle
Design for scale, but optimize measured bottlenecks:
- keep headless benchmarks;
- record agent count, simulated duration, tick cost, and allocations;
- prefer event-driven/scheduled updates;
- use spatial partitioning for local queries;
- batch homogeneous work when profiling justifies it;
- avoid premature native extensions or data-oriented rewrites before the behavior model stabilizes.
Development strategy
The project has two interleaved tracks.
Living simulation
- deterministic clock and state;
- data-driven needs, professions, and actions;
- inventories and economic flow;
- events, history, relationships, and rumours;
- simulation LOD and performance;
- emergent opportunities and quests.
Living presentation
- Jajce-inspired terrain composition;
- attractive lighting, water, foliage, and weather;
- readable characters and professions;
- visible work, transport, and consequences;
- interaction UI and simulation inspection;
- combat feel, companions, and command feedback.
Every major systems milestone should produce a shareable visual behavior. Every visual milestone should support or reveal actual simulation state.
Immediate milestone: scaffold, architecture gate, then simulation garden
Food and wood migration, the minimal JajceWorld proof, and the mandatory
architecture gate are complete:
- explicit fixed-step simulation clock;
- seeded per-NPC decision and wander random streams;
- headless fixed-seed scenario with a final-state checksum;
- versioned JSON records for NPC, village, resource, clock, and RNG state;
- deterministic save/restore continuation with exact 64-bit RNG preservation;
- simulation-owned resource amount/reservation state with ResourceNode presentation binding and unload/rebind coverage;
- stable StringName action/profession IDs plus validated custom definition resources used by simulation, targeting, generation, and persistence;
- separate selection, execution, target resolution, active-world query, and visual travel responsibilities;
- authoritative active position and persisted travel destinations;
- checksum-invariant NPC visual unload/reload with reservation preservation.
The location-based food loop is complete and traceable: gathering creates carried food, depositing fills the pantry, withdrawal retrieves one unit, and eating consumes it. Each successful transfer creates a persisted structured event, and active NPCs visibly carry food through presentation derived from their inventory. The bounded save-slot slice is also complete, including validation, atomic replacement recovery, and active-visual rebuilding. Terrain3D runtime integration, the bounded Jajce beauty pass, and the first 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. 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 now keep current relationship causes lasting, cap other memories, and forget routine facts at deterministic daily-sized reviews without deleting the objective event. The selected-person inspector now shows lasting-first retained memories beside objective personal history, and real trust changes produce a short observer-only amber blossom without altering saved state.
The first bounded opportunity proof is complete. A positive NPC pantry withdrawal plus current pantry emptiness opens one need only for a critically hungry villager who knows that exact event. The schema-v8 record persists its stable trigger, interested villager, pantry/food target, status, and later resolution event; active evidence remains lasting. A real later NPC deposit or player harvest into the pantry resolves it without quest-only history, economy mutation by the generator, or AI assignment. The compact village/inspector UI shows this lifecycle without changing the elevated follow camera. The same facts now have a cardless world expression: empty/low/stocked pantry props, one interested-villager concern cue, and a brief refill response. Save/load rebuilds the stable state without replaying the response.
The outcome-defined pantry-crisis demo loop is complete. F11 reloads a fixed
authored start and packages a measured 20–30 second cinematic story with brief
captions: real withdrawal and consumption expose the shortage, a worried
informed villager remains at the empty pantry, and a trusted helper selects a
finite berry source, visibly carries its yield, deposits it, and causes the
physical recovery. A headless lifecycle scenario and an unassisted runtime
timing validator cover the complete path.
Milestone 7 remains in progress. The immediate next slice is the second
missing-wood consumer from a real task_blocked fact, including deterministic
interested-party death/staleness handling before common opportunity machinery
is extracted.
The remaining simulation-garden target still aims for:
- one attractive valley section;
- six named villagers;
- three visibly distinct workplaces;
- food and wood as location-based resources;
- visible gathering, carrying, storing, and consuming;
- hunger and energy;
- one understandable shortage crisis;
- direct player assistance and priority influence;
- day/night presentation;
- an in-game reason inspector;
- deterministic replay or scenario reset;
- save/load for the slice;
- a stable 20–30 minute session.
Safety and knowledge can remain present, but their deeper production chains should follow a complete food loop rather than grow in parallel.
Out of scope until the simulation garden works
- full regional map;
- large city population;
- multiplayer;
- procedural world generation;
- generations and inheritance;
- complete market simulation;
- kingdom-scale diplomacy;
- large battles;
- broad crafting catalog;
- fully generated dialogue;
- multiple large production chains;
- production-quality character customization.
These remain part of the vision, not the next implementation target.
Agent working guidelines
- Read this document, the learning roadmap, the ResourceNode migration, and the build-in-public plan before proposing a large architectural or world-production change.
- Inspect
git statusand preserve unrelated user changes. - Treat
addons/terrain_3d/anddemo/as third-party code unless a task explicitly concerns the plugin. - Preserve Godot
.uidand asset.importsidecars. They are tracked project metadata;.godot/is the disposable cache. - Keep simulation rules independent of visuals and loaded scenes.
- Prefer small vertical behavior slices over broad scaffolding.
- When adding a decision, add a way to inspect why it occurred.
- When adding persistent state, define how it saves and migrates.
- When optimizing, include a reproducible benchmark or measurement.
- Keep new systems data-driven only where it improves reuse or iteration; avoid abstraction without a demonstrated consumer.
- Use Conventional Commits.
- Update these documents when a decision materially changes the vision, architecture, milestones, or current-state description.
- Follow the authority order in the documentation map; do not let a focused visual or migration plan silently redefine system ownership.
Definition of “reusable for the future game”
A system is reusable when:
- it has no dependency on this prototype's scene paths or placeholder zones;
- definitions can be supplied as data;
- mutable state is serializable;
- behavior can be exercised headlessly;
- presentation communicates through an adapter or events;
- performance characteristics are measured;
- its public API is documented by real use, not speculative abstraction.
Reusable does not necessarily mean a separate Godot plugin. Extract a library only after the API has stabilized through use.
Glossary
- Active NPC: A fully represented nearby character with a Godot scene node.
- Agent: A simulated decision-making entity, usually an NPC.
- Event: A structured fact that something happened in world time.
- History: Persisted events and their enduring consequences.
- Memory: An NPC's retained interpretation or knowledge of events.
- Presentation adapter: Code that translates simulation state into scenes, animation, audio, UI, and player input.
- Quest: A player-facing framing and tracking mechanism for an opportunity or unresolved condition.
- Reason trace: Data explaining the inputs and scores behind a decision.
- Simulation garden: A small, attractive, controlled world used to validate deep systems and make them watchable.
- Simulation LOD: Changing computational fidelity based on relevance while preserving important identity and state.
- World event: A consequential state transition that may be witnessed, remembered, communicated, and acted upon.