feat(scenes): Implement auto-play logic to prioritize early military units during selection and deployment

Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
autocommit 2026-04-15 17:54:42 -07:00
parent 2f97791391
commit 3d73ad76c2

View file

@ -744,6 +744,16 @@ func _next_building(city: Variant, player: Variant, city_count: int, has_settler
# Forge FIRST — doubles production from 2 to 4, accelerates everything after
if not city.has_building("forge"):
return "forge"
# Count military BEFORE economic buildings — ensures attacks start by ~turn 60
# instead of ~turn 150. Prior build order (walls/marketplace/worker before any
# warrior) pushed first warrior to turn 51 on seed 1; enemy expanded past us.
var early_mil: int = 0
if player != null:
for u: Variant in player.units:
if u.is_alive() and u.get("can_found_city") != true and u.get("can_build_improvements") != true:
early_mil += 1
if early_mil < 2:
return "" # warrior — rush two before any defensive/economic building
# Then walls for defense
if not city.has_building("walls"):
return "walls"