diff --git a/src/game/engine/scenes/tests/auto_play.gd b/src/game/engine/scenes/tests/auto_play.gd index 54f2de10..ee5b4382 100644 --- a/src/game/engine/scenes/tests/auto_play.gd +++ b/src/game/engine/scenes/tests/auto_play.gd @@ -388,7 +388,10 @@ func _manage_production(city: Variant) -> void: func _next_building(city: Variant, player: Variant, city_count: int, has_settler: bool) -> String: ## Return the next building/unit to produce, or "" for warrior. - # Walls first (defense) + # Forge FIRST — doubles production from 2 to 4, accelerates everything after + if not city.has_building("forge"): + return "forge" + # Then walls if not city.has_building("walls"): return "walls" # One warrior before expanding @@ -396,14 +399,20 @@ func _next_building(city: Variant, player: Variant, city_count: int, has_settler for u: Variant in player.units: if u.is_alive() and u.get("can_found_city") != true: military += 1 - if military == 0: + # Maintain military: at least 1 warrior per city + if military < city_count: return "" # build warrior # Expand to 3 cities if city_count < 3 and not has_settler: return "settler" - # Economic buildings (cycle through all available) + # Alternate: build next available building, then warrior, repeat + # Check how many buildings this city has vs warriors the player has + var city_buildings: int = city.buildings.size() + # If we have more buildings than warriors, build a warrior + if military <= city_buildings and military < city_count * 3: + return "" # build warrior + # Otherwise build next available building var econ_buildings: Array[Array] = [ - ["forge", ""], # no tech needed ["brewery", "brewing"], ["library", "scholarship"], ["marketplace", "trade_routes"],