From 587af9c5db52ab14bf8e9a722fae8e27c4856944 Mon Sep 17 00:00:00 2001 From: Claude Code Date: Thu, 26 Mar 2026 04:32:36 -0700 Subject: [PATCH] =?UTF-8?q?docs(age-four):=20=F0=9F=93=9D=20Update=20clima?= =?UTF-8?q?te=20behavior=20rules=20in=20climate=5Fspec.json=20for=20Age=20?= =?UTF-8?q?of=20Four=20game?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Lilith Autocommit --- games/age-of-four/data/climate_spec.json | 243 +++++++++++++++++++---- 1 file changed, 206 insertions(+), 37 deletions(-) diff --git a/games/age-of-four/data/climate_spec.json b/games/age-of-four/data/climate_spec.json index dc43793a..08945908 100644 --- a/games/age-of-four/data/climate_spec.json +++ b/games/age-of-four/data/climate_spec.json @@ -1,67 +1,236 @@ { "terrain_classification": { - "comment": "Ordered rule list — first match wins. Used by classify_terrain() at map gen and runtime.", + "comment": "Ordered rule list — first match wins. Mirrors biome_classifier.gd _classify_land(). Water/volcanic/cave handled outside these rules.", "rules": [ - { "field": "temperature", "op": "<", "value": 0.10, "terrain": "snow" }, - { "field": "temperature", "op": "<", "value": 0.25, "terrain": "tundra" }, - { "field": "elevation", "op": ">", "value": 0.80, "terrain": "mountains" }, - { "field": "elevation", "op": ">", "value": 0.60, "terrain": "hills" }, { + "comment": "Wetland override: saturated moisture on lowland", "and": [ - { "field": "temperature", "op": ">", "value": 0.60 }, - { "field": "moisture", "op": "<", "value": 0.25 } - ], - "terrain": "desert" - }, - { - "and": [ - { "field": "moisture", "op": ">", "value": 0.75 }, - { "field": "elevation", "op": "<", "value": 0.48 } + { "field": "moisture", "op": ">", "value": 0.70 }, + { "field": "elevation", "op": "<", "value": 0.40 }, + { "field": "temperature", "op": ">", "value": 0.40 } ], "terrain": "swamp" }, { "and": [ - { "field": "temperature", "op": ">", "value": 0.65 }, - { "field": "moisture", "op": ">=", "value": 0.35 } + { "field": "moisture", "op": ">", "value": 0.70 }, + { "field": "elevation", "op": "<", "value": 0.40 }, + { "field": "temperature", "op": "<=", "value": 0.40 } ], - "terrain": "jungle" + "terrain": "bog" + }, + + { + "comment": "Very high elevation: ice or alpine tundra", + "and": [ + { "field": "elevation", "op": ">", "value": 0.85 }, + { "field": "temperature", "op": "<", "value": 0.10 } + ], + "terrain": "ice" }, { "and": [ - { "field": "moisture", "op": ">=", "value": 0.55 }, - { "field": "temperature", "op": ">=", "value": 0.25 } + { "field": "elevation", "op": ">", "value": 0.85 } ], - "terrain": "enchanted_forest" + "terrain": "alpine_tundra" }, - { "terrain": "grassland" } + + { + "comment": "High elevation (0.70-0.85): alpine meadow or alpine tundra", + "and": [ + { "field": "elevation", "op": ">", "value": 0.70 }, + { "field": "moisture", "op": ">", "value": 0.30 } + ], + "terrain": "alpine_meadow" + }, + { + "and": [ + { "field": "elevation", "op": ">", "value": 0.70 } + ], + "terrain": "alpine_tundra" + }, + + { + "comment": "Mid elevation (0.55-0.70): montane forest, cloud forest, or alpine meadow", + "and": [ + { "field": "elevation", "op": ">", "value": 0.55 }, + { "field": "canopy", "op": ">", "value": 0.40 } + ], + "terrain": "montane_forest" + }, + { + "and": [ + { "field": "elevation", "op": ">", "value": 0.55 }, + { "field": "moisture", "op": ">", "value": 0.70 }, + { "field": "temperature", "op": ">", "value": 0.30 } + ], + "terrain": "cloud_forest" + }, + { + "and": [ + { "field": "elevation", "op": ">", "value": 0.55 } + ], + "terrain": "alpine_meadow" + }, + + { + "comment": "Hot lowland (temp > 0.55): tropical biomes or desert", + "and": [ + { "field": "temperature", "op": ">", "value": 0.55 }, + { "field": "moisture", "op": ">", "value": 0.70 }, + { "field": "canopy", "op": ">", "value": 0.60 } + ], + "terrain": "tropical_rainforest" + }, + { + "and": [ + { "field": "temperature", "op": ">", "value": 0.55 }, + { "field": "moisture", "op": ">", "value": 0.40 } + ], + "terrain": "tropical_dry_forest" + }, + { + "and": [ + { "field": "temperature", "op": ">", "value": 0.55 }, + { "field": "moisture", "op": ">", "value": 0.20 } + ], + "terrain": "savanna" + }, + { + "and": [ + { "field": "temperature", "op": ">", "value": 0.55 } + ], + "terrain": "desert" + }, + + { + "comment": "Temperate (temp 0.25-0.55): forest, grassland, or chaparral", + "and": [ + { "field": "temperature", "op": ">", "value": 0.25 }, + { "field": "canopy", "op": ">", "value": 0.50 } + ], + "terrain": "forest" + }, + { + "and": [ + { "field": "temperature", "op": ">", "value": 0.25 }, + { "field": "moisture", "op": ">", "value": 0.70 } + ], + "terrain": "temperate_rainforest" + }, + { + "and": [ + { "field": "temperature", "op": ">", "value": 0.25 }, + { "field": "moisture", "op": ">", "value": 0.30 } + ], + "terrain": "grassland" + }, + { + "and": [ + { "field": "temperature", "op": ">", "value": 0.25 } + ], + "terrain": "chaparral" + }, + + { + "comment": "Cold (temp 0.10-0.25): boreal forest or tundra", + "and": [ + { "field": "temperature", "op": ">", "value": 0.10 }, + { "field": "canopy", "op": ">", "value": 0.30 } + ], + "terrain": "boreal_forest" + }, + { + "and": [ + { "field": "temperature", "op": ">", "value": 0.10 } + ], + "terrain": "tundra" + }, + + { + "comment": "Extreme cold fallback", + "terrain": "polar_desert" + } ] }, "terrain_transitions": { - "comment": "Hysteresis rules for _ideal_terrain(). Each terrain defines conditions to leave it. First match wins; if none match, terrain persists.", - "jungle": [ - { "condition": "moisture < 0.35", "becomes": "plains" }, - { "condition": "temperature <= 0.65", "becomes": "forest" } + "comment": "Hysteresis rules for _ideal_terrain(). Each terrain defines conditions to leave it. First match wins; if none match, terrain persists. 'classify' means re-run full classification.", + "tropical_rainforest": [ + { "condition": "moisture <= 0.70 OR canopy <= 0.60", "becomes": "tropical_dry_forest" }, + { "condition": "temperature <= 0.55", "becomes": "forest" } + ], + "tropical_dry_forest": [ + { "condition": "moisture <= 0.40", "becomes": "savanna" }, + { "condition": "moisture > 0.70 AND canopy > 0.60", "becomes": "tropical_rainforest" }, + { "condition": "temperature <= 0.55", "becomes": "forest" } + ], + "savanna": [ + { "condition": "moisture <= 0.20", "becomes": "desert" }, + { "condition": "moisture > 0.40", "becomes": "tropical_dry_forest" }, + { "condition": "temperature <= 0.55", "becomes": "chaparral" } + ], + "desert": [ + { "condition": "moisture > 0.20 AND temperature > 0.55", "becomes": "savanna" }, + { "condition": "moisture > 0.20 AND temperature <= 0.55", "becomes": "chaparral" } ], "forest": [ - { "condition": "moisture < 0.35", "becomes": "plains" }, - { "condition": "temperature > 0.65", "becomes": "jungle" }, - { "condition": "temperature < 0.25", "becomes": "boreal_forest" } + { "condition": "canopy <= 0.30", "becomes": "grassland" }, + { "condition": "temperature > 0.55", "becomes": "tropical_dry_forest" }, + { "condition": "temperature <= 0.25", "becomes": "boreal_forest" } + ], + "temperate_rainforest": [ + { "condition": "moisture <= 0.50", "becomes": "forest" }, + { "condition": "temperature > 0.55", "becomes": "tropical_rainforest" }, + { "condition": "temperature <= 0.25", "becomes": "boreal_forest" } + ], + "grassland": [ + { "condition": "canopy > 0.50", "becomes": "forest" }, + { "condition": "moisture <= 0.30", "becomes": "chaparral" }, + { "condition": "temperature > 0.55", "becomes": "savanna" }, + { "condition": "temperature <= 0.25", "becomes": "tundra" } + ], + "chaparral": [ + { "condition": "moisture > 0.30", "becomes": "grassland" }, + { "condition": "temperature > 0.55 AND moisture <= 0.20", "becomes": "desert" }, + { "condition": "temperature <= 0.25", "becomes": "tundra" } ], "boreal_forest": [ - { "condition": "moisture < 0.25", "becomes": "plains" }, + { "condition": "canopy <= 0.20", "becomes": "tundra" }, { "condition": "temperature >= 0.25", "becomes": "forest" }, - { "condition": "temperature < 0.10", "becomes": "classify" } + { "condition": "temperature <= 0.10", "becomes": "classify" } ], - "enchanted_forest": [ - { "condition": "moisture < 0.35", "becomes": "classify" }, - { "condition": "temperature > 0.65", "becomes": "jungle" }, - { "condition": "temperature < 0.25", "becomes": "boreal_forest" } + "tundra": [ + { "condition": "canopy > 0.30 AND temperature > 0.10", "becomes": "boreal_forest" }, + { "condition": "temperature >= 0.25", "becomes": "grassland" }, + { "condition": "temperature <= 0.10", "becomes": "polar_desert" } ], - "plains": [ - { "condition": "moisture >= 0.35 AND temperature >= 0.25", "becomes": "grassland" }, - { "condition": "moisture < 0.20 OR (temperature > 0.60 AND moisture < 0.25)", "becomes": "classify" } + "polar_desert": [ + { "condition": "temperature > 0.10", "becomes": "tundra" } + ], + "swamp": [ + { "condition": "moisture <= 0.60", "becomes": "classify" }, + { "condition": "temperature <= 0.40", "becomes": "bog" } + ], + "bog": [ + { "condition": "moisture <= 0.60", "becomes": "classify" }, + { "condition": "temperature > 0.40", "becomes": "swamp" } + ], + "montane_forest": [ + { "condition": "canopy <= 0.30", "becomes": "alpine_meadow" }, + { "condition": "elevation <= 0.50", "becomes": "classify" } + ], + "cloud_forest": [ + { "condition": "moisture <= 0.60 OR temperature <= 0.25", "becomes": "alpine_meadow" }, + { "condition": "elevation <= 0.50", "becomes": "classify" } + ], + "alpine_meadow": [ + { "condition": "elevation <= 0.50", "becomes": "classify" }, + { "condition": "moisture <= 0.20 AND elevation > 0.70", "becomes": "alpine_tundra" } + ], + "alpine_tundra": [ + { "condition": "moisture > 0.30 AND elevation <= 0.85", "becomes": "alpine_meadow" }, + { "condition": "elevation <= 0.50", "becomes": "classify" } ] },