feat: expand resource discovery to 18 finite ResourceNodes
Add 6 new resources: farm_crop_01 (farming), berry_bush_river_02 (river bank), berry_patch_mill_01 (mill foraging), tree_forest_grove_01/02 (deep forest), wood_pile_mill_01 (mill stockpile). Extend tests to 18 resources, >=9 food, >=9 wood, >=6 berry, farming context assertion.
This commit is contained in:
@@ -53,10 +53,10 @@ func _run() -> void:
|
|||||||
"Runtime should not retain duplicate flat-world objects"
|
"Runtime should not retain duplicate flat-world objects"
|
||||||
)
|
)
|
||||||
var resource_root := main_scene.get_node("JajceWorld/WorldObjects/ResourceNodes")
|
var resource_root := main_scene.get_node("JajceWorld/WorldObjects/ResourceNodes")
|
||||||
_check(resource_root.get_child_count() == 12, "Runtime should contain twelve Jajce ResourceNodes")
|
_check(resource_root.get_child_count() == 18, "Runtime should contain eighteen Jajce ResourceNodes")
|
||||||
_check(
|
_check(
|
||||||
simulation_manager.resource_states.size() == 12,
|
simulation_manager.resource_states.size() == 18,
|
||||||
"Simulation authority should bind all twelve Jajce resources"
|
"Simulation authority should bind all eighteen Jajce resources"
|
||||||
)
|
)
|
||||||
var village_root := main_scene.get_node("JajceWorld/VillageRoot")
|
var village_root := main_scene.get_node("JajceWorld/VillageRoot")
|
||||||
var path_strips := 0
|
var path_strips := 0
|
||||||
@@ -156,7 +156,7 @@ func _run() -> void:
|
|||||||
)
|
)
|
||||||
|
|
||||||
if failures.is_empty():
|
if failures.is_empty():
|
||||||
print("[TEST] Jajce runtime passed: 6 NPCs, 12 resources, typed sites")
|
print("[TEST] Jajce runtime passed: 6 NPCs, 18 resources, typed sites")
|
||||||
quit(0)
|
quit(0)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
@@ -124,13 +124,19 @@ func _run() -> void:
|
|||||||
"animal_camp_river_01",
|
"animal_camp_river_01",
|
||||||
"berry_bush_01",
|
"berry_bush_01",
|
||||||
"berry_bush_02",
|
"berry_bush_02",
|
||||||
|
"berry_bush_river_02",
|
||||||
|
"berry_patch_mill_01",
|
||||||
"berry_patch_river_01",
|
"berry_patch_river_01",
|
||||||
"berry_patch_south_01",
|
"berry_patch_south_01",
|
||||||
|
"farm_crop_01",
|
||||||
"tree_01",
|
"tree_01",
|
||||||
"tree_02",
|
"tree_02",
|
||||||
|
"tree_forest_grove_01",
|
||||||
|
"tree_forest_grove_02",
|
||||||
"tree_north_outskirts_01",
|
"tree_north_outskirts_01",
|
||||||
"tree_river_resource_01",
|
"tree_river_resource_01",
|
||||||
"tree_south_edge_01",
|
"tree_south_edge_01",
|
||||||
|
"wood_pile_mill_01",
|
||||||
"wood_pile_village_01"
|
"wood_pile_village_01"
|
||||||
],
|
],
|
||||||
"Jajce resources should preserve all stable and discoverable IDs"
|
"Jajce resources should preserve all stable and discoverable IDs"
|
||||||
@@ -142,6 +148,7 @@ func _run() -> void:
|
|||||||
var berry_context_count := 0
|
var berry_context_count := 0
|
||||||
var village_context_count := 0
|
var village_context_count := 0
|
||||||
var outskirt_context_count := 0
|
var outskirt_context_count := 0
|
||||||
|
var farming_context_count := 0
|
||||||
for resource in resources:
|
for resource in resources:
|
||||||
var node := resource as ResourceNode
|
var node := resource as ResourceNode
|
||||||
var id := String(node.node_id)
|
var id := String(node.node_id)
|
||||||
@@ -157,6 +164,8 @@ func _run() -> void:
|
|||||||
village_context_count += 1
|
village_context_count += 1
|
||||||
if id.contains("_outskirts_") or id.contains("_edge_") or id.contains("_river_"):
|
if id.contains("_outskirts_") or id.contains("_edge_") or id.contains("_river_"):
|
||||||
outskirt_context_count += 1
|
outskirt_context_count += 1
|
||||||
|
if id.begins_with("farm_"):
|
||||||
|
farming_context_count += 1
|
||||||
metadata_valid = (
|
metadata_valid = (
|
||||||
metadata_valid
|
metadata_valid
|
||||||
and node.comfort_distance > 0.0
|
and node.comfort_distance > 0.0
|
||||||
@@ -164,12 +173,13 @@ func _run() -> void:
|
|||||||
and node.safety_risk <= 1.0
|
and node.safety_risk <= 1.0
|
||||||
)
|
)
|
||||||
_check(metadata_valid, "Jajce resources should define discovery metadata")
|
_check(metadata_valid, "Jajce resources should define discovery metadata")
|
||||||
_check(food_count >= 6, "Jajce should expose at least six finite food resources")
|
_check(food_count >= 9, "Jajce should expose at least nine finite food resources")
|
||||||
_check(wood_count >= 6, "Jajce should expose at least six finite wood resources")
|
_check(wood_count >= 9, "Jajce should expose at least nine finite wood resources")
|
||||||
_check(animal_context_count >= 2, "Jajce food discovery should include animal-camp contexts")
|
_check(animal_context_count >= 2, "Jajce food discovery should include animal-camp contexts")
|
||||||
_check(berry_context_count >= 4, "Jajce food discovery should include berry contexts")
|
_check(berry_context_count >= 6, "Jajce food discovery should include berry contexts")
|
||||||
_check(village_context_count >= 1, "Jajce discovery should include at least one village stockpile")
|
_check(village_context_count >= 1, "Jajce discovery should include at least one village stockpile")
|
||||||
_check(outskirt_context_count >= 4, "Jajce discovery should include outskirts/river contexts")
|
_check(outskirt_context_count >= 4, "Jajce discovery should include outskirts/river contexts")
|
||||||
|
_check(farming_context_count >= 1, "Jajce food discovery should include farming contexts")
|
||||||
_check(world.has_node("WorldObjects/StorageSites"), "JajceWorld should expose StorageSites")
|
_check(world.has_node("WorldObjects/StorageSites"), "JajceWorld should expose StorageSites")
|
||||||
var pantry := world.get_node("WorldObjects/StorageSites/VillagePantry") as StorageNode
|
var pantry := world.get_node("WorldObjects/StorageSites/VillagePantry") as StorageNode
|
||||||
_check(pantry != null, "JajceWorld should include a typed VillagePantry StorageNode")
|
_check(pantry != null, "JajceWorld should include a typed VillagePantry StorageNode")
|
||||||
@@ -235,7 +245,7 @@ func _run() -> void:
|
|||||||
adapter.pantry_storage = pantry
|
adapter.pantry_storage = pantry
|
||||||
root.add_child(adapter)
|
root.add_child(adapter)
|
||||||
var food_candidates := adapter.get_resource_candidates(SimulationIds.ACTION_GATHER_FOOD)
|
var food_candidates := adapter.get_resource_candidates(SimulationIds.ACTION_GATHER_FOOD)
|
||||||
_check(food_candidates.size() >= 6, "Adapter should expose all authored food candidates")
|
_check(food_candidates.size() >= 9, "Adapter should expose all authored food candidates")
|
||||||
var candidate_metadata_valid := true
|
var candidate_metadata_valid := true
|
||||||
for candidate in food_candidates:
|
for candidate in food_candidates:
|
||||||
candidate_metadata_valid = (
|
candidate_metadata_valid = (
|
||||||
|
|||||||
@@ -406,6 +406,66 @@ safety_risk = 0.02
|
|||||||
comfort_distance = 16.0
|
comfort_distance = 16.0
|
||||||
discovery_priority = 0.75
|
discovery_priority = 0.75
|
||||||
|
|
||||||
|
[node name="FarmCrop_01" parent="WorldObjects/ResourceNodes" instance=ExtResource("2_resource")]
|
||||||
|
position = Vector3(-11, 0, 3)
|
||||||
|
node_id = &"farm_crop_01"
|
||||||
|
initial_amount = 8.0
|
||||||
|
yield_per_action = 2.0
|
||||||
|
safety_risk = 0.02
|
||||||
|
comfort_distance = 16.0
|
||||||
|
discovery_priority = 0.85
|
||||||
|
|
||||||
|
[node name="BerryBush_River_02" parent="WorldObjects/ResourceNodes" instance=ExtResource("2_resource")]
|
||||||
|
position = Vector3(28, 0, -2)
|
||||||
|
node_id = &"berry_bush_river_02"
|
||||||
|
initial_amount = 5.0
|
||||||
|
yield_per_action = 1.5
|
||||||
|
safety_risk = 0.22
|
||||||
|
comfort_distance = 28.0
|
||||||
|
discovery_priority = 0.2
|
||||||
|
|
||||||
|
[node name="Tree_Forest_Grove_01" parent="WorldObjects/ResourceNodes" instance=ExtResource("2_resource")]
|
||||||
|
position = Vector3(-8, 0, -22)
|
||||||
|
node_id = &"tree_forest_grove_01"
|
||||||
|
action_id = &"gather_wood"
|
||||||
|
resource_id = &"wood"
|
||||||
|
initial_amount = 14.0
|
||||||
|
yield_per_action = 3.0
|
||||||
|
safety_risk = 0.3
|
||||||
|
comfort_distance = 30.0
|
||||||
|
discovery_priority = -0.1
|
||||||
|
|
||||||
|
[node name="Tree_Forest_Grove_02" parent="WorldObjects/ResourceNodes" instance=ExtResource("2_resource")]
|
||||||
|
position = Vector3(-3, 0, -24)
|
||||||
|
node_id = &"tree_forest_grove_02"
|
||||||
|
action_id = &"gather_wood"
|
||||||
|
resource_id = &"wood"
|
||||||
|
initial_amount = 11.0
|
||||||
|
yield_per_action = 2.5
|
||||||
|
safety_risk = 0.32
|
||||||
|
comfort_distance = 32.0
|
||||||
|
discovery_priority = -0.2
|
||||||
|
|
||||||
|
[node name="WoodPile_Mill_01" parent="WorldObjects/ResourceNodes" instance=ExtResource("2_resource")]
|
||||||
|
position = Vector3(21, 0, 1)
|
||||||
|
node_id = &"wood_pile_mill_01"
|
||||||
|
action_id = &"gather_wood"
|
||||||
|
resource_id = &"wood"
|
||||||
|
initial_amount = 4.0
|
||||||
|
yield_per_action = 1.0
|
||||||
|
safety_risk = 0.03
|
||||||
|
comfort_distance = 14.0
|
||||||
|
discovery_priority = 0.8
|
||||||
|
|
||||||
|
[node name="BerryPatch_Mill_01" parent="WorldObjects/ResourceNodes" instance=ExtResource("2_resource")]
|
||||||
|
position = Vector3(14, 0, 3)
|
||||||
|
node_id = &"berry_patch_mill_01"
|
||||||
|
initial_amount = 5.0
|
||||||
|
yield_per_action = 1.5
|
||||||
|
safety_risk = 0.1
|
||||||
|
comfort_distance = 20.0
|
||||||
|
discovery_priority = 0.45
|
||||||
|
|
||||||
[node name="StorageSites" type="Node3D" parent="WorldObjects"]
|
[node name="StorageSites" type="Node3D" parent="WorldObjects"]
|
||||||
|
|
||||||
[node name="VillagePantry" parent="WorldObjects/StorageSites" instance=ExtResource("14_storage")]
|
[node name="VillagePantry" parent="WorldObjects/StorageSites" instance=ExtResource("14_storage")]
|
||||||
|
|||||||
Reference in New Issue
Block a user