Add edible plant resource nodes
This commit is contained in:
@@ -73,6 +73,11 @@ ENVIRONMENT_MATERIALS = {
|
||||
"color": unreal.LinearColor(0.55, 0.49, 0.28, 1.0),
|
||||
"roughness": 0.93,
|
||||
},
|
||||
"edible_plant_resource": {
|
||||
"path": f"{MATERIAL_FOLDER}/M_AGR_GZ_EdiblePlant_Resource",
|
||||
"color": unreal.LinearColor(0.22, 0.46, 0.18, 1.0),
|
||||
"roughness": 0.9,
|
||||
},
|
||||
"stone_resource": {
|
||||
"path": f"{MATERIAL_FOLDER}/M_AGR_GZ_Stone_Sandstone",
|
||||
"color": unreal.LinearColor(0.43, 0.40, 0.35, 1.0),
|
||||
@@ -87,6 +92,7 @@ ENVIRONMENT_MATERIALS = {
|
||||
RESOURCE_MATERIAL_BY_LABEL_PREFIX = {
|
||||
"AGR_GZ_Wood": "wood_resource",
|
||||
"AGR_GZ_Fiber": "fiber_resource",
|
||||
"AGR_GZ_EdiblePlant": "edible_plant_resource",
|
||||
"AGR_GZ_Stone": "stone_resource",
|
||||
"AGR_DemoWoodResource": "wood_resource",
|
||||
"AGR_DemoFiberResource": "fiber_resource",
|
||||
@@ -245,6 +251,27 @@ BIOME_RESOURCE_ACTORS = [
|
||||
"z_offset": 65.0,
|
||||
"rotation": unreal.Rotator(0.0, 114.0, 0.0),
|
||||
},
|
||||
{
|
||||
"label": "AGR_GZ_EdiblePlant_CoastalScrub_01",
|
||||
"class_path": "/Game/Agrarian/Blueprints/Resources/BP_EdiblePlantResourceNode",
|
||||
"location_xy": unreal.Vector(-31400.0, -7600.0, 0.0),
|
||||
"z_offset": 58.0,
|
||||
"rotation": unreal.Rotator(0.0, 21.0, 0.0),
|
||||
},
|
||||
{
|
||||
"label": "AGR_GZ_EdiblePlant_Grassland_02",
|
||||
"class_path": "/Game/Agrarian/Blueprints/Resources/BP_EdiblePlantResourceNode",
|
||||
"location_xy": unreal.Vector(6200.0, -26800.0, 0.0),
|
||||
"z_offset": 58.0,
|
||||
"rotation": unreal.Rotator(0.0, -48.0, 0.0),
|
||||
},
|
||||
{
|
||||
"label": "AGR_GZ_EdiblePlant_DrainageCandidate_03",
|
||||
"class_path": "/Game/Agrarian/Blueprints/Resources/BP_EdiblePlantResourceNode",
|
||||
"location_xy": unreal.Vector(-9400.0, 12800.0, 0.0),
|
||||
"z_offset": 58.0,
|
||||
"rotation": unreal.Rotator(0.0, 96.0, 0.0),
|
||||
},
|
||||
{
|
||||
"label": "AGR_GZ_Stone_Slope_01",
|
||||
"class_path": "/Game/Agrarian/Blueprints/Resources/BP_StoneResourceNode",
|
||||
|
||||
@@ -10,6 +10,7 @@ WORLD_FOLDER = f"{BLUEPRINT_ROOT}/World"
|
||||
WOOD_ITEM_PATH = "/Game/Agrarian/DataAssets/Items/DA_Item_Wood"
|
||||
FIBER_ITEM_PATH = "/Game/Agrarian/DataAssets/Items/DA_Item_Fiber"
|
||||
STONE_ITEM_PATH = "/Game/Agrarian/DataAssets/Items/DA_Item_Stone"
|
||||
FOOD_ITEM_PATH = "/Game/Agrarian/DataAssets/Items/DA_Item_Food"
|
||||
|
||||
PLACEHOLDER_MESH_FOLDER = "/Game/Agrarian/Environment/PlaceholderMeshes"
|
||||
PLACEHOLDER_MESH_SOURCES = {
|
||||
@@ -60,6 +61,18 @@ BLUEPRINTS = [
|
||||
"mesh": MESH_CUBE_PATH,
|
||||
"scale": unreal.Vector(0.9, 0.75, 0.45),
|
||||
},
|
||||
{
|
||||
"asset": "BP_EdiblePlantResourceNode",
|
||||
"folder": RESOURCE_FOLDER,
|
||||
"parent": unreal.AgrarianResourceNode,
|
||||
"defaults": {
|
||||
"yield_item_definition": FOOD_ITEM_PATH,
|
||||
"remaining_harvests": 8,
|
||||
"quantity_per_harvest": 1,
|
||||
},
|
||||
"mesh": MESH_CYLINDER_PATH,
|
||||
"scale": unreal.Vector(0.65, 0.65, 0.85),
|
||||
},
|
||||
{
|
||||
"asset": "BP_Campfire",
|
||||
"folder": STRUCTURE_FOLDER,
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
FILES = {
|
||||
"setup_item_definitions.py": ROOT / "Scripts" / "setup_item_definitions.py",
|
||||
"setup_playable_blueprints.py": ROOT / "Scripts" / "setup_playable_blueprints.py",
|
||||
"setup_ground_zero_demo_map.py": ROOT / "Scripts" / "setup_ground_zero_demo_map.py",
|
||||
"verify_playable_blueprints.py": ROOT / "Scripts" / "verify_playable_blueprints.py",
|
||||
"verify_ground_zero_resources.py": ROOT / "Scripts" / "verify_ground_zero_resources.py",
|
||||
"GroundZeroResourcePass.md": ROOT / "Docs" / "Terrain" / "GroundZeroResourcePass.md",
|
||||
"TechnicalDesignDocument.md": ROOT / "Docs" / "TechnicalDesignDocument.md",
|
||||
"AGRARIAN_DEVELOPMENT_ROADMAP.md": ROOT / "AGRARIAN_DEVELOPMENT_ROADMAP.md",
|
||||
}
|
||||
|
||||
EXPECTED = {
|
||||
"setup_item_definitions.py": [
|
||||
'"asset": "DA_Item_Food"',
|
||||
'"item_id": "food"',
|
||||
'"item_type": unreal.AgrarianItemType.FOOD',
|
||||
],
|
||||
"setup_playable_blueprints.py": [
|
||||
'FOOD_ITEM_PATH = "/Game/Agrarian/DataAssets/Items/DA_Item_Food"',
|
||||
'"asset": "BP_EdiblePlantResourceNode"',
|
||||
'"yield_item_definition": FOOD_ITEM_PATH',
|
||||
'"remaining_harvests": 8',
|
||||
'"quantity_per_harvest": 1',
|
||||
],
|
||||
"setup_ground_zero_demo_map.py": [
|
||||
'"edible_plant_resource"',
|
||||
'"/Game/Agrarian/Blueprints/Resources/BP_EdiblePlantResourceNode"',
|
||||
'"AGR_GZ_EdiblePlant_CoastalScrub_01"',
|
||||
'"AGR_GZ_EdiblePlant_Grassland_02"',
|
||||
'"AGR_GZ_EdiblePlant_DrainageCandidate_03"',
|
||||
],
|
||||
"verify_playable_blueprints.py": [
|
||||
'"/Game/Agrarian/Blueprints/Resources/BP_EdiblePlantResourceNode"',
|
||||
'"yield_item_id": "food"',
|
||||
],
|
||||
"verify_ground_zero_resources.py": [
|
||||
'"food": [',
|
||||
'"AGR_GZ_EdiblePlant_CoastalScrub_01"',
|
||||
"edible plant",
|
||||
],
|
||||
"GroundZeroResourcePass.md": [
|
||||
"Edible plants:",
|
||||
"`food` item",
|
||||
"Added `BP_EdiblePlantResourceNode`",
|
||||
"Edible plant nodes: `3`",
|
||||
],
|
||||
"TechnicalDesignDocument.md": [
|
||||
"edible plants",
|
||||
"`BP_EdiblePlantResourceNode`",
|
||||
"MVP `food` item",
|
||||
"forage patches",
|
||||
],
|
||||
"AGRARIAN_DEVELOPMENT_ROADMAP.md": [
|
||||
"[x] Add edible plant resource.",
|
||||
"`BP_EdiblePlantResourceNode`",
|
||||
"Ground Zero forage nodes",
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
def main():
|
||||
missing = []
|
||||
for label, path in FILES.items():
|
||||
text = path.read_text(encoding="utf-8")
|
||||
for snippet in EXPECTED[label]:
|
||||
if snippet not in text:
|
||||
missing.append(f"{label}: {snippet}")
|
||||
|
||||
if missing:
|
||||
raise RuntimeError("Edible plant resource verification failed: " + "; ".join(missing))
|
||||
|
||||
print("Agrarian edible plant resource verification complete.")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -17,6 +17,11 @@ EXPECTED_RESOURCE_LABELS = {
|
||||
"AGR_GZ_Fiber_Scrub_03",
|
||||
"AGR_GZ_Fiber_DrainageCandidate_04",
|
||||
],
|
||||
"food": [
|
||||
"AGR_GZ_EdiblePlant_CoastalScrub_01",
|
||||
"AGR_GZ_EdiblePlant_Grassland_02",
|
||||
"AGR_GZ_EdiblePlant_DrainageCandidate_03",
|
||||
],
|
||||
"stone": [
|
||||
"AGR_GZ_Stone_Slope_01",
|
||||
"AGR_GZ_Stone_Slope_02",
|
||||
@@ -67,6 +72,7 @@ def main():
|
||||
"Ground Zero resource verification complete: "
|
||||
f"{len(EXPECTED_RESOURCE_LABELS['wood'])} wood, "
|
||||
f"{len(EXPECTED_RESOURCE_LABELS['fiber'])} fiber, "
|
||||
f"{len(EXPECTED_RESOURCE_LABELS['food'])} edible plant, "
|
||||
f"{len(EXPECTED_RESOURCE_LABELS['stone'])} stone nodes."
|
||||
)
|
||||
|
||||
|
||||
@@ -23,6 +23,13 @@ EXPECTED = {
|
||||
},
|
||||
"yield_item_id": "stone",
|
||||
},
|
||||
"/Game/Agrarian/Blueprints/Resources/BP_EdiblePlantResourceNode": {
|
||||
"properties": {
|
||||
"remaining_harvests": 8,
|
||||
"quantity_per_harvest": 1,
|
||||
},
|
||||
"yield_item_id": "food",
|
||||
},
|
||||
"/Game/Agrarian/Blueprints/Structures/BP_Campfire": {
|
||||
"properties": {
|
||||
"fuel_seconds": 180.0,
|
||||
|
||||
Reference in New Issue
Block a user