diff --git a/src/game/engine/src/generation/hydrology.gd b/src/game/engine/src/generation/hydrology.gd index e99c7d46..13667bda 100644 --- a/src/game/engine/src/generation/hydrology.gd +++ b/src/game/engine/src/generation/hydrology.gd @@ -24,9 +24,13 @@ static func generate_drainage( var fill: Dictionary = _depression_fill(game_map, elevation, params) var acc: Dictionary = _accumulate_flow(game_map, rainfall, fill.flow_dir, fill.topo_order) HydrologyRiversScript.detect_lakes(game_map, elevation, fill.filled_elev, params) - HydrologyRiversScript.mark_rivers(game_map, acc, temperature, fill.flow_dir, fill.topo_order, params) + HydrologyRiversScript.mark_rivers( + game_map, acc, temperature, fill.flow_dir, fill.topo_order, params + ) HydrologyRiversScript.mark_deltas(game_map, acc, fill.flow_dir, params) - HydrologyRiversScript.classify_sources(game_map, elevation, moisture, temperature, fill.flow_dir, params) + HydrologyRiversScript.classify_sources( + game_map, elevation, moisture, temperature, fill.flow_dir, params + ) for axial: Vector2i in acc: var t: Variant = game_map.tiles.get(axial) if t != null: diff --git a/src/game/engine/src/generation/map_placer.gd b/src/game/engine/src/generation/map_placer.gd index 10677891..48b16707 100644 --- a/src/game/engine/src/generation/map_placer.gd +++ b/src/game/engine/src/generation/map_placer.gd @@ -91,7 +91,10 @@ func _get_wonder_candidates(game_map: RefCounted) -> Array[Vector2i]: var margin: int = 3 for axial: Vector2i in game_map.tiles: var tile: Variant = game_map.tiles[axial] - if BiomeRegistry.has_tag(tile.biome_id, "is_water") or BiomeRegistry.has_tag(tile.biome_id, "is_elevated"): + if ( + BiomeRegistry.has_tag(tile.biome_id, "is_water") + or BiomeRegistry.has_tag(tile.biome_id, "is_elevated") + ): continue var offset: Vector2i = HexUtilsScript.axial_to_offset(axial) if ( @@ -152,7 +155,8 @@ func place_resources(game_map: RefCounted, multiplier: float) -> void: var placed: int = 0 var min_resource_distance: int = 2 - # Build per-resource selection weights from quality: Q1->1.0, Q2->0.25, Q3->0.06, Q4->0.015, Q5->0.004 + # Build per-resource selection weights from quality: + # Q1->1.0, Q2->0.25, Q3->0.06, Q4->0.015, Q5->0.004 var res_weights: Array[float] = [] for res: Dictionary in all_resources: var q: int = res.get("quality", 1) diff --git a/src/game/engine/src/generation/map_shape_seeds.gd b/src/game/engine/src/generation/map_shape_seeds.gd index 2ceab0d3..0c171264 100644 --- a/src/game/engine/src/generation/map_shape_seeds.gd +++ b/src/game/engine/src/generation/map_shape_seeds.gd @@ -8,6 +8,9 @@ extends RefCounted const HexUtilsScript = preload("res://engine/src/map/hex_utils.gd") +static var _classify_rules: Array = [] +static var _classify_rules_loaded: bool = false + # -- Shape seed placement -- @@ -147,10 +150,6 @@ static func _place_seeds_plus( # -- Public utility: climate-driven terrain classification -- -static var _classify_rules: Array = [] -static var _classify_rules_loaded: bool = false - - static func classify_terrain(temp: float, moisture: float, elevation: float) -> String: ## Classify terrain from continuous climate values. Reads rules from climate_spec.json. ## Called by climate system each turn. Returns a biome_id matching terrain.json entries. @@ -163,7 +162,8 @@ static func classify_terrain(temp: float, moisture: float, elevation: float) -> for rule: Variant in _classify_rules: if not rule is Dictionary: continue - # Simple single-field rule: { "field": "temperature", "op": "<", "value": 0.10, "terrain": "snow" } + # Simple single-field rule: { "field": "temperature", "op": "<", "value": 0.10, + # "terrain": "snow" } if rule.has("field"): var val: float = _classify_field_value(rule["field"], temp, moisture, elevation) if _classify_check_op(val, rule.get("op", ""), rule.get("value", 0.0)): diff --git a/src/game/engine/src/generation/start_position.gd b/src/game/engine/src/generation/start_position.gd index 79da5bc2..66f7e7b8 100644 --- a/src/game/engine/src/generation/start_position.gd +++ b/src/game/engine/src/generation/start_position.gd @@ -278,7 +278,10 @@ func _score_all_start_candidates( continue if tile.is_natural_wonder(): continue - if BiomeRegistry.has_tag(tile.biome_id, "is_elevated") or BiomeRegistry.has_tag(tile.biome_id, "is_water"): + if ( + BiomeRegistry.has_tag(tile.biome_id, "is_elevated") + or BiomeRegistry.has_tag(tile.biome_id, "is_water") + ): continue var score: float = _score_start_position(game_map, axial, prefer_coast) if score > 0: