
Starcraft AI competition - chasingsparks
http://users.soe.ucsc.edu/~bweber/dokuwiki/doku.php?id=starcraft_aiide_2010
======
chasingsparks
I have not yet fully read the API. This is an unfounded idea but I am curious:
if we could hack it so that developers could shoot it out over the internet
prior to the combination, would anyone want a HN league?

~~~
onewland
This would interest me.

~~~
bweber
While you can't run the Broodwar API on battle.net, it is possible to run bots
on ICCup. But dont expect anybody to join the game, since you will not be
running the antihack.

------
csallen
While we're talking about StarCraft, I'm on the MIT team and we're hosting an
exhibition match against Caltech on Saturday. It'll be streaming if you want
to watch:
[http://www.teamliquid.net/forum/viewmessage.php?topic_id=105...](http://www.teamliquid.net/forum/viewmessage.php?topic_id=105576)

------
ivankirigin
Dreaming about this kind of thing is one reason I went into computer science.

~~~
tayssir
I often wished that I had a cyborg-mode: gaming with a very programmable
interface. (With basically something like Emacs and a REPL.) I could teach the
computer new things as I explored, and eventually start to play in a very
high-level way.

~~~
ivankirigin
A friend worked on a gaming company where you train an algorithm to play a
fighter in a mortal combat style game. The way you train it is by playing
against it. Then you release it into the wild to fight other AIs using your
style. When it came back, it was better than you, but not for long.

Product didn't go anywhere, but the architecture could easily be copied. It
would be ridiculously cool to build this into Star Craft. There would be so
many more people exposed to the AIs if all the knowledge needed to "program"
them was in the game play itself.

~~~
ramanujan
How exactly did the training work?

Thinking out loud, for a fighting game you have two obvious measurable
criteria (your health bar and the health of your opponent) which constitute a
2D coordinate system. Any action you take which is expected to reduce your
opponent's health more than your own is going to be a beneficial one (unless
it will push you to death, in which case you need to go for attacks that have
minimal cost to your own health).

The game state would be the positions of both players on the x-axis and the
health bars for both players. If you had jumping and kneeling, you might want
to record positions & momentums for both players in x & y.

Now a very simple kind of AI could look for periodic subsequences that could
return it to the same position while causing more damage to the opponent than
to itself. That is, do some sequence of moves (strike, jump, block, etc.) and
then return to the original game state except that both health bars have
changed.

Then do this again, as you've "reduced it to a previously solved problem".

This of course would be too simple a thing to do because the opponent's
responses would (a) be nonrandom and (b) he would not return to the exact same
position. So you would need to build up a statistical database of expected
countermoves to each moves (and update that for each new opponent). You would
also probably want a similarity function for game states.

I guess overall this shouldn't be too difficult to do if you recorded the game
states of many real games between two players, because the game rules don't
change over time. Once you've got a few difficult-to-counter loops that cost
them more health than they cost you, you can run them over and over again.

~~~
roundsquare
Also thinking out loud (out type?)

I agree with some of it... you'd need to keep track of the the location of
each player on the x-axis and y-axis, momentums, etc... Additionally you'd
want to keep track of the "visible" actions. For example, if the human hits
the soft punch button, you can see the fist cocking before the punch.
Similarly for other actions.

This gives you various points in the state space. The way I see doing this is:

1) Make the continuous variables discrete. You need enough granularity to have
good responses of course...

2) Use genetic programming to pick reactions in each state. However, the
reaction in each state is not a single action but a probability distributions
over various actions (move left, move right, jump, punch, kick, etc...).

The randomness is key. I spent some time talking to a guy who plays in
tournaments and he said that the absolute worst thing you can do is get into a
cycle or become predictable.

------
FooBarWidget
How is this possible? Isn't Starcraft closed source? Did they hack the
binaries to allow exposing an API or something? If so isn't this project
illegal? Or did Starcraft provide a C++ API all along?

~~~
haasted
The "Getting started" section of the page explains this.

Apparently it is possible to script Starcraft using a C++ API.

<http://eis.ucsc.edu/StarCraftAICompetition#GettingStarted>

~~~
FooBarWidget
Yeah but is this C++ API official or is it hacked into the binary by third
parties?

~~~
jncraton
The API is third party. I'm pretty sure they are using this:

<http://www.broodwarai.com/forums/index.php?showtopic=322>
<http://code.google.com/p/bwapi/>

------
metaguri
Wow, this looks awesome. Even if I don't make it into the competition, I'd
love to play with the APIs.

I've always wanted to get into RTS games but I am just not very good at the
mouse--I always get bogged down by failing to click on the right units and
issue the right commands at the right times, and I've fond that once you make
a few mistakes you usually don't recover, or you are back to square one.

Board games and turn-based games don't share this problem of course, but they
aren't quite the adrenaline pumpers either... not worse, just different :-)

------
chasingsparks
This is a cross-post from Slashdot. Nonetheless, this is VERY cool. For those
of you who missed the very interesting Mario competition, you have a while on
this one.

~~~
Dilpil
Speaking of the mario competition, is there a way to watch videos of
submissions?

~~~
GavinB
Here's one: <http://www.youtube.com/watch?v=DlkMs4ZHHr8>

Impressive stuff. Others in the video responses below.

~~~
tgittos
Robin's also released the source to his bot, if you want to run it locally:
<http://www.doc.ic.ac.uk/~rb1006/projects:marioai>

All you need to run it is the latest competition code:
<http://code.google.com/p/marioai/>

------
perplexes
The link looks broken. :/

~~~
chasingsparks
I guess the defense against slash-dotting could not be sustained.

~~~
bweber
The site has been transferred to a new sub-domain to handle the traffic

------
kentosi
On the one hand I'm surprised people are still playing this game. Then again,
given how long Starcraft II has been taking to come out, I guess these guys
have no choice but to enjoy what they have.

(PS - I'm not flaming them. I was an SC addict about 8 years ago untill WOW
came out and everyone seemed to have lost interest.)

------
Tichy
What has become of the Starcraft lectures, are there transcripts yet? I
suppose they would be mandatory viewing for coming up with a decent
strategy...

<http://academicearth.org/lectures/introduction-starcraft>

~~~
ShardPhoenix
I don't know about transcripts, but there are some pretty detailed summaries
(minus the mathematical derivations) available here:
<http://www.sirlin.net/blog/category/starcraft-class>

------
varaon
<http://www.broodwarai.com/index.php>

------
MikeCapone
I'd love to see some videos of these AIs playing against one another,
especially if there was a really widescreen video that could show a split
screen of what both AIs are doing at the same time.

~~~
bweber
All of the replay files will be made publicly available after the competition,
see the rules page.

------
tibbon
Wonder how it fares against the standard Starcraft AI?

~~~
eslifka
The standard starcraft AI was always pretty pathetic, even after Blizzard's
attempts to make it more challenging. My guess is that in the subset
competitions (1 - 3) the sc AI would get whipped, if it could even be coerced
into competing. (I don't think it could even do the micromanaging competition,
I think the units would just sit there until they were attacked. And even then
it would be the standard unit ai responding instead of the overall ai. It
might fair a little better in the tech limited tournament.) I think the
limited scope of those tournaments will allow the submitted bots to be highly
optimized. It might fare better in the overall competition though, since both
sides will be dealing with the full complexity of the game. But I still think
that by the tournament the submitted bots will be highly superior to the built
in ai.

~~~
tibbon
Wasn't part of the Warcraft and Starcraft bot's technique that they cheated
effectively and often knew things that a player couldn't have known (and
executed on things that a player couldn't have?) in order to stand any chance
at winning?

------
GrandMasterBirt
MMMM sounds cool. Would be nice to practice against some challenging AIs vs
the crappy one provided by SC that cheats to win :P Specially without perfect
awareness.

Would be awesome if the AIs had a difficulty tweak that allowed them to be
used in actual SC games :)

