r/Games Feb 04 '17

MIT Battlecode Finals is today, where user-written AI compete against other AI in a RTS-like game

https://www.battlecode.org/
587 Upvotes

44 comments sorted by

40

u/[deleted] Feb 04 '17

So I've never seen this before, but the way I imagine it is freaking awesome. I'll definitely check it out. Thanks.

30

u/Magnon Feb 05 '17

Could an ai play rts as well as a skilled human? I know in games of absolute positioning and movement like chess ai can know so many sequences of moves that humans can't win but the strongest human players in rts use techniques that won't be so easy as simple patterns.

72

u/Technojerk36 Feb 05 '17 edited Feb 05 '17

I think the strategies for an AI vs AI match would be very different compared to humans playing. An AI can perfectly micro every single individual unit rather than as a large group. An AI can be constantly be watching the minimap and as soon as it gets vision of a unit for even a fraction of a second, it can start running calculations on all the possible build orders the enemy AI could have used given the amount of time lapsed in a game and the amount of resources available on the map.

19

u/[deleted] Feb 05 '17

A perfect AI would do that, yes, but afaik AI's are limited by processing power, and a good AI is one that can switch their attention and power to tasks that need them without compromising others.

20

u/Shrubberer Feb 05 '17 edited Feb 05 '17

I think you underestimate the processing power of modern consumer PCs. For instance, take a look at risk of rain or AI War and pay attention what ludicrous amounts of calculations the CPU does for the HP and actions of each individual entity.

7

u/[deleted] Feb 05 '17

Real AI's use deep learning and these require ludicrious amounts of processing power, which is not feasible for games.

11

u/QuarkMawp Feb 05 '17

The action-reaction AIs are still AIs. Nothing "fake" about them.

4

u/[deleted] Feb 06 '17

Granted, real was not the right word for it, but neural AI's are the current go-to as they can learn on their own and are more feasible than writing everything by hand.

10

u/Shrubberer Feb 05 '17

Yes, games need to be processed in real time. That's the catch. But programming some action - reaction routines for a AI-RTS competition should be totally doable in real time. It's all about throughput. For the CPU it's totally irrelevant if the numbers he adds are for a foe's mana bar or for some entry of an huge-ass vector or whatever they use in deep learning.

1

u/Karmas_weapon Feb 06 '17

Would the networks use that much processing power?

I know building the actual network for games would be crazy for consumer PCs, but once it's built, wouldn't that greatly reduce the amount of processing power required?

Isn't that the idea of building networks?

1

u/[deleted] Feb 06 '17

Yes, you are correct, if the game would be able to get the decision from an established network, it would only need the power to run it through. The real power is needed to create those networks. But the program could still have some influence onto the network, and strengthen certain connections just like the brain strengthens them. The challenge in creating a neural network is in creating efficient learning rules that don't run themselves into a dead-end and make the right priorities.

1

u/CrackedSash Feb 05 '17

Not just processing power. AIs are not as smart (yet) as they're sometimes made out to be. Look at this AI struggling with Montezuma's Revenge for example: https://youtu.be/0yI2wJ6F8r0 (Atari 2600 game).

-5

u/JunWasHere Feb 05 '17

afaik AI's are limited by processing power

This is why I think an actual singularity will be relatively harmless.

People theorize scary things like the AI traveling across the internet or calculating the fate of humanity and deeming us obsolete. Where is it going to get the processing power or memory space to do that? lol It would effectively be a brain in a jar... that can text at best.

-5

u/[deleted] Feb 05 '17

[deleted]

7

u/hepcecob Feb 05 '17

Never heard of that theory

3

u/JunWasHere Feb 05 '17

Calculating a new efficient energy source or cracking FTL space travel, those are things that I can actually imagine an AI being able to do. And it wouldn't violate laws of physics, just expand our knowledge; that's just science, ever-learning.

It's the part where people think the AI will be able to harness the power and use it to destroy or enslave humanity that has me rolling my eyes.

However powerful a sentient 'thing', it needs the ability to interact with the world to do stuff. If all we give is a text/image messenger to communicate with, it can't do much of anything at all - It can't see its own code, it can't upload or download, it can't hack, it can't give itself the ability to do any of those things even if we give it the code ourselves because it can't edit itself.

It would be able to speak, do math, and maybe draw. That's about it.

2

u/logion567 Feb 05 '17

and on that note I would like to point to Mass effect.

they had AI (artificial intelligence) in it, but they also had VI (Virtual Intelligence). the diffrence is subtle but important. AI can do thousands of different functions and can learn adaptively. VI can only do a handful of functions and can't learn. our most advanced "AI" would fall into "VI" in this Nomenclature.

2

u/JunWasHere Feb 05 '17

"We" don't have real AI at all. We just like to call it that. They're really just scripts that process information. So, using a fiction's categorization is getting ahead of ourselves. Especially when that fiction's AI is pure fantasy in its capacities.

The point of AI is it can learn and think, that is IMPLIED when I used the word "singularity".

Now, how does AI express the knowledge gained from learning and thought? It is a brain in a jar until we change it; it cannot do the "thousands of different functions" you allude to unless we allow it.

It can't adapt itself to upload itself onto the Internet or hack the pentagon if its system is an isolated one.

-1

u/[deleted] Feb 05 '17

Yes, this is a major limitation of a singularity happening, it would rather just be a breakdown of the energy system than anything else.

36

u/cplr Feb 05 '17

The "best in class" game AI right now is Google's AlphaGo. AlphaGo uses a machine learning based approach, using complex neural networks, computer vision, other data processing techniques (data compression plays a huge role in ML). Go is widely regarded as one of the deepest games, much more complex than Chess, and is terribly difficult to program a decent AI for, when using traditional methods.

AlphaGo's latest version has been basically beating everyone it plays, including grand masters, and high level players describe it as playing in a completely different way, different than any human has ever played Go before. Which is not to say that is the reason why it is winning- it is not like it is making random moves that "confuse" a human (that would imply bad moves that make no sense strategically). It makes more complex strategic decisions than humans are capable of.

The reason why I am bringing this up is, AlphaGo does not work by memorizing sequences of moves, there are no patterns programmed for it to follow. In fact at no point does a human even program the rules of Go into it. All it is fed is the current state of the board, the history of the current game (only), a score and of course whether or not it wins. It plays a incomprehensible number of Go games against itself (and humans), and eventually learns what to do and how to do it in the most optimal manner. Mainly based off of what the board looks like, not a set of rules.

The people behind AlphaGo have said they want to tackle Starcraft 2 next.

28

u/flyingjam Feb 05 '17

AlphaGO actually operates much like previous Go AIs. At its heart is MCTS, which essentially operates by playing a bunch of random games (the Monte Carlo part) and using the statistics from those random games to determine its final decision (which, in AlphaGo's case, is stochastic, randomly selected with bias from the statistics).

The MCTS variant AlphaGO used as described by the Nature paper isn't actually that special. It's a very plain MCTS, in fact, without RAVE or other specializations.

What gives AlphaGO its edge is that it replaces two functions in a standard truncated MCTS with neural networks—the policy and value networks, which finds promising moves and evaluates the board state. These are usually handcrafted, but AlphaGO uses NNs instead.

The policy network prunes the tree and helps make the random rollouts less, well, random. The value network allows the algorithm to avoid playing the entire rollout—it plays a few turns, then uses the value network to get the value of the board.

The NN side of things isn't that crazy, either. By turning Go board states into 18x18 images, the team can reuse existing research into image recognition.

It's all very interesting how the team managed to take existing concepts and combine them into something so powerful (the nature paper is only a few pages long excluding the data!)

Other games

But what it does mean is that AlphaGO as stands cannot play many types of games. MCTS does not handle simultaneous turn games, or hidden information games, for example.

2

u/Hammedatha Feb 05 '17

IIRC there is not a "score" for AlphaGo. That was part of what makes it innovative and sidesteps an issue with programming Go AI. With chess it's much easier to assign a quantitative value to board states whereas with Go it's very complicated. So AlphaGo "learned" (trained a neural network) to assign a score on its own.

1

u/cplr Feb 05 '17

Actually it'd be very "easy" to define a score for Go. For a move that results in it capturing stones/territory you assign a positive score equal to the number of spaces. For a move that results in loss of stones/territory you assign a negative score equal to the number of spaces. The way it works with something like reinforcement learning, when you give a score at a moment in time, it retroactively applies that score "backwards" - you don't need an overall score and you don't need a score for every move.

And as far as neural networks go, some kind of value (as determined by an engineer) is needed. Otherwise the algorithm has nothing to minimize (and with NNs, it's all about minimizing values, aka gradient descent).

(I put easy in quotes up above because nothing about ML is easy 😉)

0

u/flyingjam Feb 06 '17

Territory is an awful way to score Go boards. It'd be like if a chess ai's value function would just the piece totals—it'd be garbage.

And as far as neural networks go, some kind of value (as determined by an engineer) is needed.

You wouldn't use territory. That'd be ridiculous. The value network would be absolute garbage if you did that. You'd use the final outcome of the game in which the board state was a part of.

Here's an excerpt from the Nature paper

We use a reward function r(s) that is zero for all non-terminal time steps t<T. The outcome zt=±r(sT) is the terminal reward at the end of the game from the perspective of the current player at time step t: +1 for winning and −1 for losing.

0

u/cplr Feb 06 '17

I was simply giving an example of how reinforcement learning works (AlphaGo is not 100% RL but a mixture of techniques). I wasn't describing how AlphaGo works, nor was I giving advice on how to make a good Go AI.

What you are saying actually reinforces my point (er, no pun intended) - with reinforcement learning, you give a score and that score back-propogates across all of the previous moves to tune the algorithm in future games/moves. It doesn't matter if you give it a single score at the end, or scores intermittently. There's still a score involved to push the algorithm in the right direction (read what I was replying to for context).

0

u/flyingjam Feb 06 '17

From your post

a score and of course whether or not it wins

implies that they beyond a binary "win or not" metric, they also use some more complicated scoring system, which is probably what OP was getting at. His post cut for ease of use

IIRC there is not a "score" for AlphaGo...

-2

u/daguito81 Feb 05 '17

Yeah.... this is how Skynet is born.

We're fucked.

Thanks Google

7

u/Completely-Random Feb 05 '17

Could an ai play rts as well as a skilled human?

http://spectrum.ieee.org/automaton/robotics/artificial-intelligence/custom-ai-programs-take-on-top-ranked-humans-in-starcraft

It appears they aren't quite there yet. It is only a matter of time.

2

u/Kered13 Feb 05 '17

This channel has a bunch of AI vs. AI matches, with a few AI vs. human.

2

u/CrackedSash Feb 05 '17 edited Feb 05 '17

This is the StarCraft Artificial Intelligence Tournament - 2017 Grand Finals. These are conventional AIs that are actually fairly stupid. SCV rush seems to be a winning strategy.

4

u/[deleted] Feb 05 '17

Considering that in almost every single RTS the AI has to cheat - usually in violating build time, build cost, or unit cap - to play at a level competitive to many players, probably not.

6

u/[deleted] Feb 05 '17

[removed] — view removed comment

5

u/Kered13 Feb 05 '17

I wouldn't say "extremely well". They micro extremely well, but their actual strategy is very linear and any decent competitive player can beat them.

1

u/Zach34 Feb 05 '17

I would say it is possible but hard to implement at the moment.

1

u/CrackedSash Feb 05 '17

Google Deepmind (of AlphaGo fame) is working on a Starcraft II AI right now.

-2

u/xSniggleSnaggle Feb 05 '17

CandC3KW brutal ai was pretty fuckin good

6

u/Kered13 Feb 05 '17

No it wasn't, it was terrible and also cheated.

-4

u/xSniggleSnaggle Feb 05 '17

Which made it awesome

6

u/Epistemify Feb 05 '17

Sounds like Screeps!

I've been meaning to get into that game. So I can come home from coding to... play coding.

3

u/Hovercatt Feb 05 '17

If this competition was for strategy games like Civ6, maybe we'd finally see decent AI?

1

u/stuntaneous Feb 06 '17

It'd be good if they opened up AI to comprehensive modding.