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.
This commit is contained in:
2026-07-08 17:44:39 +02:00
parent 6fdb9ba50f
commit 4604dc6d5a
12 changed files with 311 additions and 9 deletions
+1
View File
@@ -3,6 +3,7 @@ extends RefCounted
const ACTION_IDLE := &"idle"
const ACTION_DEAD := &"dead"
const ACTION_SLEEP := &"sleep"
const ACTION_GATHER_FOOD := &"gather_food"
const ACTION_GATHER_WOOD := &"gather_wood"
const ACTION_PATROL := &"patrol"