man looking at screen with StarCraft on it

Can your bot actually win this fight?

Aug 6th 2025

Why hello Reader,

10 marines, 2 marauders, and a siege tank against 13 zerglings, 3 hydras and a queen.

Who wins?

Honestly, I don’t know, but that’s OK because that’s what a combat simulator is for! 😂 With it inside your bot, it answers a very important question: Should I engage in this fight or not? Answer wrong and your bot is left with a big ol’ L as your army gets wiped. Let’s look into the magic of this AI crystal ball.

🔁 In Case You Missed It

video preview

In the round of 8 of Probots, there is a masterclass of an unstoppable AI meeting an immovable ProBot. Eris in its newer Random bot form of changeling is arguably one of the strongest bots in the roster but took a tumble out of the bracket from Zozo. How? Changeling when it gets going is difficult to stop even for most humans, so Zozo just aims to stop it from getting going. Using early cheese tactics that exploit early game blind spots and punishing its weak early defence.

It a great example that shows how to snatch victory through a targeted approach, and is worth checking for your own ideas.

Combat simulation is like running a battle in your head—but at machine speed. Basically Doctor Strange in Infinity War, running millions of possible outcomes before making a move. It makes a prediction of the fight based on your current units versus the enemy’s.

Roughly, it works like this:

Take each unit’s health × DPS, sum it up for your side and theirs.
If your total is higher, you win.
(#Oversimplified)

Of course real combat has more complexity:

  1. Unit types & counters: Marines vs banelings ≠ marines vs zerglings
  2. Range differences: Siege tanks start shooting before zerglings reach them
  3. Positioning: Melee units can’t all attack the same target
  4. Timing: Distance affects how fast units can join the fight
  5. Special abilities: Splash damage, healing, armour bonuses

Under the hood, a framework like ARES uses a Rust-powered combat simulator (via sc2-helper) to crunch all that complexity.

It works like this:

  • Units are filtered and grouped.
  • The sim takes into account range, travel time, focus fire, and damage bonuses.
  • It steps through a mock battle, second by second.
  • Then it returns a verdict: who survives, and by how much.

ARES layers on an interpretation of that result, not just win/loss, but how much you win or lose by.

That nuance lets your bot decide if it’s worth engaging now, waiting for reinforcements, or baiting into better terrain.

Smart bots don’t need to fight every battle—just the right ones.

🛠️ In the Workshop

PiGBot now has a combat simulator of its own, making it more aggressive in the early game, pressing an attack when it thinks it has the advantage. Now if only I could get it to predict the probability of finishing this project before the end of the year 🙃

🗒️ ./run Notes: How to add a combat simulator

You’ve got a few ways to make your bot smart about combat. You can use machine learning to train a model on past combat data, or do good old fashioned algorithm like we’re going to do.

If you’re using the ARES framework, you can just Can_Win_Fight mediator to just it plug right in. But if you’re rolling your own, here’s how to hook up the sc2-helper combat sim to your bot.

Step 1: Import the simulator

The combat sim is written in Rust, but we access it in Python like this:

  1. Import the simulator
  2. Create an instance: sim = CombatSimulator()
  3. (optional)sim.enable_timing_adjustment(True) – include distance
  4. (optional)sim.workers_do_no_damage(True) – ignore worker DPS
  5. Run it: winner, health_left = sim.predict_engage(my_units, enemy_units)

It gives you a simple True or False for whether you’ll win.

Step 2: Go beyond win/loss

That raw answer isn’t really helpful. So we rate the win based on how much health is left:

If health ≥ 90%, it’s a VICTORY_EMPHATIC
If health ≥ 60%, it’s a VICTORY_DECISIVE
If health > 20%, it’s a VICTORY_MARGINAL
(Same idea for losses…)

Now your bot can make smarter calls

What this Combat Simulator Can’t Do:

  • Terrain: No high ground, choke points, or ramps
  • Micro: No kiting, spell usage, or advanced tactics
  • Positioning: Assumes “reasonable” unit spread
  • Special Cases: Bunkers, loaded units, some abilities

It also has some quirks when it comes to scenarios like “45 SCVs killing a Mutalisk” so its not perfect but if you make a better one, let me know!

Community Wisdom

Email Preference:
Unsubscribe | Update your profile | 113 Cherry St #92768, Seattle, WA 98104-2205