
Show HN: AI Planning for Starcraft - primaryobjects
https://github.com/primaryobjects/strips#starcraft
======
ggreer
These planning algorithms are pretty cool, and they got me thinking about AIs
in RTS tournaments. RTS games seem like a perfect fit for human/computer
pairs. Automation would completely change micro. The computer reacts
instantly, has perfect accuracy, and never gets tired or distracted. It would
enable tactics that no human could perform unaided. The human would have fewer
distractions while making strategic decisions that current RTS AIs are
terrible at: Where to build, where to mass units, defense placement, etc.

I looked around a little, but didn't find any StarCraft-equivalent to Advanced
Chess[1]. If such a thing doesn't exist, it's a shame. The combination of
better strategy and ludicrous APM would completely change gameplay.

1\.
[http://en.wikipedia.org/wiki/Advanced_Chess](http://en.wikipedia.org/wiki/Advanced_Chess)

~~~
iopq
Well, it would have to beat a human's micro first.

Remember, it's not just doing predictable actions every time. A lot of it is
dancing back and forth and trying to bait your opponent.

So an AI might say "focus firing a stalker is the most efficient" and the
human player blinks it away. Then it chooses the next target and the human
player blinks that away as well. And so forth until the human player runs out
of healthy stalkers and simply walks away with hurt stalkers having done
enough damage.

The "correct" solution might have been actually to run past your opponent's
army and to surround it spreading the damage. Even when you blink out you're
still close to the enemy army because of blink's range.

There could be a mathematical model that predicts whether to run past or to
attack or to stutter-step, but humans do this based on experience. AIs are not
close to this level of sophistication.

~~~
ohaal
In many cases, simply having the higher APM should be enough to win:
[https://www.youtube.com/watch?v=mrbYd4OFrWE#t=18](https://www.youtube.com/watch?v=mrbYd4OFrWE#t=18)

Nevermind the fact that while the computer is doing this micro, it is also
able to do macro.

~~~
iopq
yeah, for kiting/splitting a bot can just do this easily

now think what the bot would have to do if it's controlling the banelings
KNOWING that the other person is going to control the marines away and it's
not as simple

------
Iv
Don't get me wrong, I find it very cool that people try to popularize STRIPS
planning among programmers and that automated planning gets more known.
However, please don't say that you can "solve" Starcraft this way.

To get a decent starcraft AI you will need more than the ability to make plans
to build battlecruisers: you will need the ability to choose the best plan for
the recognized situation, to take decisions under uncertainty and to make
compromises between objectives.

~~~
fit2rule
You can plan every single thing. Whats your real problem?

~~~
Iv
For chess to be called "solved" you would need to have a winning strategy for
every winnable position. The same is true for Starcraft.

What this person provides is a (very non-optimal) algorithm to build anything
within the tech tree of starcraft, but building is just one part of the game,
and the only easily pannifiable one.

------
noiv
Interesting. Although going over an abstract representation harms the
performance in a RTS game. I finally chose Nau's HTN planner to plan entire
villages in a few milliseconds. The core in JavaScript fits on one screen
page:

[https://github.com/agentx-
cgn/Hannibal/blob/master/source/si...](https://github.com/agentx-
cgn/Hannibal/blob/master/source/simulation/ai/hannibal/htn-planner.js#L112)

------
erikb
I'm very happy that another guy got interested in AI and is backing it up with
some code. Keep up the good work! But maybe join a free web AI course if you
are really interested in this topic. A* on a decision graph is really an old
thing for AI. Sorry to disappoint. It's one of the things you do for homework
if you visit an AI course.

------
pests
Note: This is not only related to Starcraft but planning problems in general.
Starcraft is just one of the examples.

------
ljk
usually players build multiple SCVs to speed things up. Is there a reason why
there's only one mining?

~~~
ericdykstra
A few people have made genetic algorithm programs to calculate optimal (in
terms of speed) build orders given certain conditions. Here's one I have used:
[https://code.google.com/p/evolutionchamber/](https://code.google.com/p/evolutionchamber/)

A genetic algorithm, of course, is much different than using AI to solve the
problem, but I think it's an interesting project nonetheless.

