Skip to content
wachtelhund edited this page Aug 4, 2026 · 1 revision

v0.6.0 — The AI gets a brain

The bot was open-loop: a build order and an attack timer, blind to everything you did. The canonical demonstration: park air units over its mineral line and it would ignore them forever. This release replaces the scripted reflexes with an actual decision architecture — no special cases, systems.

The architecture

Perception. Every think, visible enemies aggregate into 8-tile-cell sightings carrying a ground/air strength split and structure flags. Strictly fog-honest — the bot models only what its player could see.

Memory. Sightings persist after leaving vision and decay by difficulty (Hard remembers 30s, Normal 15s, Easy reacts only to what it literally sees). Seeing a spot empty clears its ghost. Scouting finally means something: what the 1:20 worker scout finds feeds every later decision.

Threat response. Enemy strength near any bot base triggers an interception force composed only of units that can actually hit that threat mix — air harass is answered by anti-air, not by melee staring upward — sized to outmatch the threat by 25%. If the threat still outguns the response, nearby workers flee the danger radius instead of dying at their patches.

Counter-production. Unit choices are scored against what the enemy has shown. If they fly and the bot owns no anti-air, anti-air becomes mandatory; heavy ground mass pulls splash weapons up the priority list.

Attack posture. Pushes launch when the bot's army outmatches the known enemy army by 20% (or nothing is known, or it's late game) — never while home is threatened. Attacks target the nearest remembered enemy structure rather than blindly marching at the spawn point, and a push that discovers it is badly outmatched retreats home instead of feeding.

Enforcement

tests/ai_defense.rs recreates the reported cheese: three enemy skywings parked over the bot's mineral line must take damage within 30 seconds. The old bot failed this test forever; it now passes at every difficulty above Easy. Full suite green, soak clean (0 invariant violations, shadow determinism intact).

Balance note

The smarter defense shifted Hard cross-race to 60/40 VC (ranged armies hold better) from 41/59 Kyth before — the races now trade the lead by map and difficulty with no runaway favorite. Defensive posture also makes bots more conservative, so evenly-matched games run longer.

Clone this wiki locally