feat(ai): Implement early-game AI unit priority logic to prioritize warriors over defensive units in military production

Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
autocommit 2026-04-16 00:19:22 -07:00
parent af338877a1
commit ca44c25695

View file

@ -455,13 +455,11 @@ static func _decide_production(
if not rush_unit.is_empty():
return _prod_unit(city_index, rush_unit)
# Priority 0: Emergency garrison — no military at all means the next
# enemy stack wins uncontested before any wall is finished. A single
# warrior buys ~10 turns of breathing room at a fraction of walls'
# cost (20 vs 70). Only triggers when the player has zero military
# units across all cities, which in AoD arena matches is the turn-1
# state since starting roster is founder + scout (no combat unit).
if military_count == 0:
# Priority 0: Early military floor — reach 2 warriors before committing
# to walls (70 prod, ~35 turns) or founder (70 prod). Two warriors at
# 20 prod each get us to a baseline garrison by ~T20 at 2 prod/turn,
# so walls land around T50 with a usable army rather than T35 with none.
if military_count < 2:
var emergency_unit: String = _pick_buildable_military_unit_id(
city, player
)