13 Commits

Author SHA1 Message Date
admin 4b5fc858f8 feat: NPC mourning behavior on housemate death
When an NPC dies from starvation, their highest-familiarity companion enters mourning for 100 ticks (~half a day). Mourning NPCs skip work: they rest if energy is low, otherwise wander near home. Mourning_ticks counts down each tick through ActionExecutionSystem and is serialized for save/load continuity with backward-compatible default of 0. This gives the familiarity graph its first behavioral consequence.
2026-07-09 00:23:00 +02:00
admin 2c3890502a feat: wood consumption for patrol and study
Patrol and study now consume 1 wood from the village woodpile on completion, recording an item_consumed economic event. This gives wood a purpose and creates resource pressure between gathering and work-support activities. Familiarity serialization switched from raw Dictionary to sorted Array of {id, score} pairs for deterministic JSON checksum output across save/load.
2026-07-09 00:16:52 +02:00
admin fce5c533fe feat: seed household familiarity from shared home proximity
NPCs whose home positions are within 4m of each other gain mutual familiarity at baseline 0.5. Stored per NPC as a Dictionary keyed by other npc_id, serialized through NPCStateRecord with backward-compatible fallback for old saves. Household pairs form naturally from the home_positions configuration in main.tscn. Includes save/load round-trip test verifying familiarity persists.
2026-07-09 00:03:20 +02:00
admin 8a1913c5ae feat: structured narrative event feed with per-NPC inspector timeline
Add narrative event types (task_started, npc_slept, npc_died, resource_depleted) alongside economic transfers. EconomicEventRecord gains create_narrative factory and human-readable description method. SimulationManager records task-start and sleep/death events, exposes get_npc_events() for per-NPC history queries. Inspector now shows a Recent timeline of the last 5 events for the selected NPC, plus displays carried wood count. Relax EconomicEventRecord validation to accept non-economic events. Update roadmap with completed milestones.
2026-07-08 19:02:11 +02:00
admin 4604dc6d5a feat: add NPC schedules with sleep, meal, and work periods
Add ACTION_SLEEP with home-position targeting and energy restoration. Embed schedule periods (SLEEP/MEAL/WORK/DISCRETIONARY) in ActionSelectionSystem with TimeOfDay from SimulationClock. NPCs sleep at night when energy is low, eat during meal periods when hungry, and work/discretionary the rest of the cycle. Home position stored per NPC and serialized through NPCStateRecord with backward-compatible fallback. Cycle duration persisted through save/restore. Includes headless test for sleep period, work period, meal hunger, energy restoration, serialization round-trip, and home targeting without world adapter.
2026-07-08 17:44:39 +02:00
admin 036c9d5141 feat: score resource discovery by comfort and safety 2026-07-07 15:10:06 +02:00
admin 4463e524aa style: apply gdformat formatting across the entire project
Auto-format all GDScript files using gdformat from gdtoolkit.
This is a baseline formatting pass to ensure consistent style:

- Normalizes indentation and spacing
- Wraps long lines to 100 characters
- Removes trailing whitespace
- Standardizes blank lines between functions

68 files reformatted, 8 files left unchanged (3rd-party addon files
with parse errors excluded).
2026-07-05 23:06:23 +02:00
admin f9601a67d1 feat: add structured economic events 2026-07-05 18:04:11 +02:00
admin 6dbb395bd6 feat: add location-based food storage loop 2026-07-05 17:57:24 +02:00
admin a8ae331f51 feat: synchronize authoritative npc position
- NpcVisual emits position_changed signal during _physics_process
- SimulationManager.synchronize_npc_position() writes active position
  into SimNPC state on movement, arrival, and navigation failure
- WorldViewManager forwards position_changed and syncs before
  despawn/reload
- SimNPC stores travel_target_position and has_travel_target as
  versioned state; NPCStateRecord v2 persists them with v1 migration
- WorldViewManager.spawn_npc_visual() resumes travel for traveling NPCs
  via SimulationManager.request_current_travel()
- WorldViewManager.despawn_npc_visual() syncs position before removal
- WorldViewManager.reload_npc_visual() spawns a visual from persisted
  state without rerolling target selection
- tests/npc_visual_lifecycle_test.gd proves unload/reload preserves
  action, target, reservation, position, RNG state, and checksum
- simulation_state_serialization_test adds legacy v1 NPC migration test
  that does not invent an active travel target
2026-07-05 17:21:17 +02:00
admin f816f3976a feat: add simulation action definitions 2026-07-05 13:35:33 +02:00
admin 363620b731 refactor: move resource authority into simulation 2026-07-05 13:26:19 +02:00
admin 30cac28fc0 feat: add versioned simulation state records 2026-07-05 12:52:07 +02:00