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
+27
View File
@@ -414,6 +414,31 @@ func _run() -> void:
not goat.is_in_group("resource_nodes") and ResourceNode.get_by_id(goat.animal_id) == null,
"The identity-backed goat should remain separate from finite resources"
)
_check(
goat.is_in_group("grass_interactors"),
"Dunja should bend camera-local grass through the shared presentation group"
)
var habitat_root := world.get_node("WorldObjects/AnimalHabitats")
var habitat := habitat_root.get_node("DunjaHabitat")
var routine_sites: Array[AnimalRoutineSite] = []
for site in AnimalRoutineSite.get_all():
routine_sites.append(site)
routine_sites.sort_custom(
func(first: AnimalRoutineSite, second: AnimalRoutineSite) -> bool:
return String(first.site_id) < String(second.site_id)
)
_check(
habitat_root.get_child_count() == 1 and habitat != null and routine_sites.size() == 2,
"Jajce should keep Dunja's two routine anchors inside one self-contained habitat scene"
)
_check(
(
routine_sites.size() == 2
and routine_sites[0].site_id == SimulationIds.ANIMAL_SITE_DUNJA_PASTURE
and routine_sites[1].site_id == SimulationIds.ANIMAL_SITE_DUNJA_SHELTER
),
"Dunja's pasture and shelter should expose deterministic stable IDs"
)
_check(world.has_node("WorldObjects/StorageSites"), "JajceWorld should expose StorageSites")
var pantry := world.get_node("WorldObjects/StorageSites/VillagePantry") as StorageNode
_check(pantry != null, "JajceWorld should include a typed VillagePantry StorageNode")
@@ -467,6 +492,8 @@ func _run() -> void:
for resource in resources:
destinations.append((resource as ResourceNode).interaction_point.global_position)
destinations.append(goat.get_interaction_position())
for site in routine_sites:
destinations.append(site.get_routine_position())
destinations.append(pantry.get_interaction_position())
destinations.append(woodpile.get_interaction_position())
for site in activity_root.get_children():