StarCraft AI

I managed to set BWAPI up (not the latest version though) and write
a couple of neat, simple scripts (the links lead to compressed videos):

(1) http://www.4shared.com/file/P4-lB-rD/starcraft_scouting_AI.html (*)
(1) http://www.4shared.com/file/yRaWx1Ul/scouting_AI.html
(2) http://www.4shared.com/file/pX1C5h00/capture_the_probe_AI.html

The first one isn't that cool. It's just a zergling exploring the map.

The second is better. I'm using influence mapping to measure the photon cannon
threat and then A* to find the best path to the enemy probe for my zergling.

What I'm looking for now is good resources on advanced RTS AI techniques,
both for micromanagement and macromanagement. Google did provide some
interesting results, but I'd like to know if anyone has something good to suggest.

(*) This was reported by envisional just because it contains the word 'starcraft' in the title... -.-
Last edited on
is this for SC or SC2?

is it meant to automate control of your units?
It depends exactly what techniques you're looking at implementing though. In terms of are you wanting to make some purely for star craft? Or are you looking for techniques in general, such as: Unit Building AI, Tactical AI, Economic AI or do you want to mess with more A*, D*, Dijkstra, Breadth and so on.
kfmfe04 wrote:
is this for SC or SC2?

SC.

kfmfe04 wrote:
is it meant to automate control of your units?

Yes.

I plan to write something specifically for StarCraft,
but I think I could adapt any generic RTS AI to fit
the game domain. An example of something I
found really cool and I'm planning to use is this:

http://www.teamliquid.net/forum/viewmessage.php?topic_id=160231

author wrote:
My career is in building learning systems and AI. One day I thought, huh, it looks like Starcraft 2 has a set vocabulary, and the game _is_ deterministic, to a certain point in the game. That means I can write a program that can learn how to perform a build order better, in order to make myself better.

I want to repeat this. I wrote a program that can learn how to optimize a build order.

So what I want to see if I can prove is if my program works, and get feedback on this.

The input is like so. I want to reach a certain point in the game. That point in the game may be 7 roaches. The build order optimizer tells you step by step instructions on how to get there, and then optimizes to become the fastest way to get there.

It uses genetic algorithms to find the build order that
creates the target units as fast as possible. In a small
map, I could spy on the enemy, see what he's going for,
decide on a counter attack and then use this technique
to build the counter attack force as fast as possible.

I'm looking for anything (tactical AI, strategic AI etc...)
apart from pathfinding, as I believe A* guided by
influence maps will be more than enough for this.

EDIT: Mmm... D* looks interesting too...
Last edited on
I'm making progress -> http://www.4shared.com/file/FIjat3IQ/simple_TvZ_AI.html

This is a demonstration of a terran bot that sets up a
base and then sends waves of marines to its enemy.

I use two main classes for this, a build manager and a battle manager.

The build manager has two states, Build and Idle.

While on the Build state, it processes a vector<BuildInfo>
and takes action depending on the current BuildInfo state
(Initial, Awaiting_Init, In_Progress, Completed, Error)
and the events got from the game. While on Idle, it waits
until notified by the battle manager to train more soldiers.

The battle manager also has two states, Assemble and Attack.

While on Assemble, it notifies the build manager to train
marines until there are 12 of them. Then, it switches to
Attack. While on Attack, it sends the assembled army to
attack the enemy location and waits. When the number
of marines drops below 6, it switches back to Assemble.

Note that this is in a very primitive phase. The building and attack locations are all
hardcoded. This means that the bot will only work on this particular map and for
these particular starting locations for the players. I guess that's the next thing I'll
fix, but I think I'll make a good refactoring first, as I have a lot of duplicate code and
there are a couple of things that could really be implemented in a more efficient way...
Last edited on
Topic archived. No new replies allowed.