Skip to main content

MicroRTS Game AI Agent(RL)

Modified CoacAI with Adaptive Aggression Parameter
Created on February 20|Last edited on March 25


My Performance Report for the RTS Game Bot

Introduction

When I started this project, I looked at the original CoacAI code to see what worked well and what needed improvement. I wanted to make my bot (MyValorAI) better at the RTS game by making smarter decisions about attacking, using workers in more efficient way, and improving how units fight. This report explains what I noticed, what I changed, and how well my bot performed.

What I Observed

  • The original code made units attack in the same way every time, regardless of the situation
  • Workers weren't always doing useful things - sometimes they stood around or weren't gathering resources efficiently
  • Units would often fight in poor positions or against the wrong enemies

Changes I Made to MyValorAI

  1. Adjustable Aggression Level: I added a slider-like setting (from 0.0 to 1.0) that controls how aggressive my bot is. When set low, it's more careful about picking fights; when set high, it attacks more boldly.
  2. In the code, this helps decide when to attack based on comparing my army strength to the enemy's. My bot now considers the difference between its units and enemy units before deciding to commit to a fight.
  3. Better Worker Management: I improved how workers are assigned tasks by keeping better track of which workers are busy and which ones are free. This helps them gather resources in an efficient way and respond better when needed for defense.
  4. I also added logic to make sure bases don't have too many workers assigned to them, spreading workers out more effectively.
  5. Smarter Combat: I worked on how units choose their targets in battle. Now they consider:
    • Which enemies they can potentially eliminate
    • Which enemies are most damaged
    • Which positions give advantage in battle
  6. Units also know when to back off if they're taking too much damage.

Tournament Results

After testing against several other bots in a round-robin tournament (5 iterations), here's how the bots performed:

Overall Performance Summary

BotWinsLossesDrawsWin Rate (%)
CoacAI223088.00
MyValorAI214084.00
WorkerRush1411056.00
NaiveMCTS1213048.00
LightRush520020.00
RandomAI02500.00


Head-to-Head Results

Botvs MyValorAIvs CoacAIvs RandomAIvs LightRushvs WorkerRushvs NaiveMCTSTotal Wins
MyValorAI1-4 (926)5-0 (257)5-0 (241)5-0 (940)5-0 (491)21
CoacAI4-1 (973)5-0 (312)5-0 (241)5-0 (943)5-0 (746)24
RandomAI0-5 (308)0-5 (336)0-5 (724)0-5 (261)0-5 (317)0
LightRush0-5 (250)0-5 (250)5-0 (634)0-5 (185)0-5 (282)5
WorkerRush0-5 (671)0-5 (681)5-0 (302)5-0 (205)4-1 (867)14
NaiveMCTS0-5 (620)0-5 (957)5-0 (270)5-0 (259)1-4 (941)11

Numbers in format: Wins-Losses (Avg. Game Length in time units)

What These Results Tell Me

  • My bot dominated most opponents, winning all matches against four out of five competitors
  • It was effective against LightRush with very quick victories (241 time units average)
  • The bot struggled against CoacAI, winning only 1 out of 5 matches
  • Even with the losses to CoacAI, my bot still ranked 2nd overall in the tournament
  • WorkerRush games lasted the longest (940 time units average), showing my bot needed more time to counter this strategy

Next Steps

Looking ahead, I want to focus on:
  1. Figuring out why my bot struggles against CoacAI and fixing those specific issues
  2. Testing different aggression levels to see what works best in different situations
  3. Improving how ranged units position themselves in battle
  4. Creating specific strategies for different map types



Run set
22
Run set 2
22