From 123775a28415b6d997b8ec3e56a44ad9c6d8ca30 Mon Sep 17 00:00:00 2001 From: autocommit Date: Wed, 15 Apr 2026 19:23:52 -0700 Subject: [PATCH] =?UTF-8?q?feat(ai):=20=E2=9C=A8=20Adjust=20AI=20heuristic?= =?UTF-8?q?=20logic=20to=20support=20the=20new=20'founder'=20unit,=20modif?= =?UTF-8?q?ying=20selection=20and=20targeting=20rules=20in=20simple=5Fheur?= =?UTF-8?q?istic=5Fai.gd?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Lilith Autocommit --- src/game/engine/src/modules/ai/simple_heuristic_ai.gd | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/game/engine/src/modules/ai/simple_heuristic_ai.gd b/src/game/engine/src/modules/ai/simple_heuristic_ai.gd index 04a53368..aaa59985 100644 --- a/src/game/engine/src/modules/ai/simple_heuristic_ai.gd +++ b/src/game/engine/src/modules/ai/simple_heuristic_ai.gd @@ -355,12 +355,12 @@ static func _decide_production( city_index: int, player: RefCounted ) -> Dictionary: var military_count: int = 0 - var settler_count: int = 0 + var founder_count: int = 0 for u: Variant in player.units: if u == null or not u.is_alive(): continue if u.get("can_found_city") == true: - settler_count += 1 + founder_count += 1 elif u.unit_type in MILITARY_COMBAT_TYPES: military_count += 1 @@ -379,9 +379,9 @@ static func _decide_production( if not hb_id.is_empty(): return _prod_building(city_index, hb_id) - # Priority 3: Expand — build settler if fewer than 3 cities and no settler in progress - if city_count < 3 and settler_count == 0 and city_index == 0: - return _prod_unit(city_index, "settler") + # Priority 3: Expand — build founder if fewer than 3 cities and none in progress + if city_count < 3 and founder_count == 0 and city_index == 0: + return _prod_unit(city_index, "founder") # Priority 4: Military — maintain 2 warriors per city var want_military: bool = military_count < maxi(2, city_count * 2)