I’ve been developing Spearhead AI, an experimental opponent for OpenRA Red Alert, with Codex assisting with implementation, logging and testing.
The package adds Spearhead AI as a separate lobby bot option when launched through the included mod launcher. The original bots remain available.
Scouting instead of omniscience
Spearhead’s custom combat planning uses scouting, remembered enemy sightings and normal GPS satellite information. It explores unknown areas to find neutral buildings, enemy forces and vulnerable approaches.
Reducing reliance on hidden information is a design goal. A complete audit of every inherited bot module is still pending.
Features
- Persistent scouting, small harassment groups and opportunities to attack weaker flanks.
- Attack decisions based on available forces, weapon effectiveness and known enemy resistance.
- MCV expansion, expansion funding and rebuilding after losing a forward base.
- Defence of threatened economic bases.
- Safer neutral-building capture and experimental APC engineer raids.
- Improved target selection, preservation of valuable wounded units, aircraft rearming and reactive anti-air defence.
- Naval access checks, coastal bombardment and escort support.
Benchmark results
The completed 40-game development benchmark recorded 31 wins and 9 losses: 77.5% against the original Rush, Normal, Turtle and Naval bots.
- v0.1.0 — Expansion recovery: 9 wins from 12 games.
- v0.2.0 — Economy and defence: 18 wins from 24 games.
- v0.3.0-preview — Expanded early scouting: 4 wins from 4 games.
This is a mixed-version development result, not a reliable win rate for v0.3.0-preview. The latest version’s four games were all on Bay of Pigs. One loss was manually confirmed after a spectator game was closed. Naval opponents also played land maps, and Rush remains an area for improvement.
The user package uses normal lobby starts, without the benchmark’s extra starting buildings.
Development and feedback
Logs track income, army value, losses, attack decisions and expansion placement. Human observations and these logs guide the changes. Spearhead is programmed AI; it does not train itself during matches or require an AI service while playing.
The current package, v0.3.0-preview, targets OpenRA release-20250330 on Windows. Compilation and OpenRA’s rule validation passed; installation on a clean second PC is still unverified.
Source, documentation and downloads:
Spearhead AI on GitHub
Feedback is welcome! Please include the map, factions, opponent bot, approximate game time and a replay when possible.