feat(ai): Introduce SimpleHeuristicAI class with basic movement and target-tracking logic for wild creatures

Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
autocommit 2026-04-15 23:28:22 -07:00
parent ba116c791e
commit d8dd4de7d1

View file

@ -25,8 +25,8 @@ const FOUND_MIN_DIST_OWN: int = 4
## deadlock founders that spawned near each other (observed in arena
## smoke tests where start placement put both players on tile 0,0).
const FOUND_MIN_DIST_ENEMY: int = 1
const RETREAT_HP_FRACTION: float = 0.15
const DEFENSIVE_CHASE_RANGE: int = 8
const RETREAT_HP_FRACTION: float = 0.0
const DEFENSIVE_CHASE_RANGE: int = 12
const MILITARY_COMBAT_TYPES: Array[String] = [
"melee", "ranged", "cavalry", "siege",
]
@ -493,7 +493,7 @@ static func _decide_production(
# match enemy's FULL army when they're closing on us so we don't lose
# on parity once reserves arrive.
var enemy_mil: int = enemy_total if threatened else 0
var mil_target: int = maxi(4, city_count * 3)
var mil_target: int = maxi(2, city_count * 2)
if enemy_mil > 0:
mil_target = maxi(mil_target, enemy_mil + 1)
var want_military: bool = military_count < mil_target