Infinite APM? Artosis on DeepMind and StarCraft - Part 1

Esports continues to grow across multiple spaces. Provided by Adela Sznajder/DreamHack

Note: This is part one of a two-part series. The second part is here.

Can an AI like AlphaGo achieve similar results in StarCraft as in Chess and Go?

With the amazing performance of AlphaGo beating the best Go player in the world, Lee Sedol (and Lee also striking back), Google DeepMind's next game to tackle has been the talk of the town. The probable next game according to the people in charge? The original StarCraft.

This doesn't surprise me at all, as StarCraft is the most strategically deep competitive video game in the world. It is really the natural next step after Chess and Go.

While Chess, and especially Go, are known as games with near infinite possibilities on the ways that they can play out, StarCraft should be even harder to create an AI for. With three distinct races and countless professionally played maps, it already seems extremely tough. But then add in the fact that it's a Real Time Strategy game, where both players are playing at the same time, and the fact that it's a game of incomplete information. Hiding what you are doing and figuring out what your opponent is doing are huge parts of the game, something that should be very hard for a computer to figure out.

Beyond all of this, there are some real problems with creating an AI to beat the best players at StarCraft. Because the game is played in real time, with both players playing simultaneously, speed is an important factor when analyzing StarCraft.

Let's say for a moment that we have an infinitely quick and precise AI playing StarCraft. This would completely break the entire game, and it would look nothing like it is intended, as it was intended to be played by humans.

An AI with perfect micro-management (control of units) and near-unlimited speed would make many units obsolete. Here's a couple of examples:

Splash (Area of Effect) damage units.

Splash damaging units are ways to punish your opponent for moving around with a large army. Units in StarCraft automatically clump up when walking around the map, and Splash damage is the most efficient way to punish this. While every professional will micro their units to minimize this damage somewhat, an AI could completely nullify it. For instance:

The Zerg Lurker is a long ranged splash unit that sends out a row of spikes, hurting everything in its path. The damage starts near the Lurker and travels forward with the animation of spikes going ahead. Any professional Terran player can technically kill a Lurker (a very expensive, high-tech unit) with a single Marine (the cheapest and most low-tech unit for Terran).

In a fast moving game though, this is completely unrealistic. There is far too much to be done, and the player would get too far behind if they tried to do this even one time. Instead, professional Terran players will spread their groups of Marines out into an arc to minimize damage to the group, as the width of the Lurker shot is not that high. A perfectly fast AI could engage multiple Lurkers with its Marines and take no damage what-so-ever, all while keeping up with other tasks with its insane speed.

Each race has multiple units with splash damage for which many examples like the one above can be made.

Melee and short-ranged units.

Units without ranged attacks (Melee units) and units with short range would lose value against a perfectly fast and precise AI. These units again rely on the fact that more is going on than can be perfectly handled, and could be shown as nearly useless compared to their actual value by an AI. Some examples:

The Protoss Zealot is a very tough melee unit of the lowest tech (or tier). It costs as much as 2 Terran Marines, which are a much more brittle unit, but have a ranged attack. With no micro-management at all, a Zealot easily dispatches 2 Marines. With perfect micro-management, 2 Marines beat the Zealot. Obviously as the game progresses, micro like this is undo-able. There is just too much to do.

"Kiting" is an important basic micro-management move for ranged units against melee or lesser-ranged units. It is the act of firing then running away until the cooldown (amount of time until you can attack again) on your attack has finished, then attacking again, before running again, repeated as many times as you like. With kiting, a professional Terran player can easily kill many, many Protoss Zealots without taking any damage with the much cheaper and faster Terran Vulture.

The Vulture vs Zealot scenario is an extreme example of the effectiveness of kiting. Normally it is just used as a way to gain some extra damage off of your weaker ranged units. You do it a certain amount with your units all game long, based upon your analysis of how much is needed to get as favorable a trade as possible while not falling behind elsewhere in the game. Every bit of micro-management, in fact, is like this. Because of limited speed and many pressing tasks, you have to be careful with your judgment on the amount of micro to use. An incredibly fast AI would not need to find any such balance, sacrificing almost nothing for the additional damage.

Targeting is a very important skill for ranged units against certain types of Melee units. In the Terran vs Zerg matchup, Zerg players need to keep the Terran's Science Vessel (an important spell caster which causes Splash damage) count as low as possible One popular way is to use their flying Melee unit, the Zerg Scourge. The Scourge is a very weak unit that runs into other flying units and explodes, dealing massive amounts of damage. Because of its low health, you have to be fast and clever to get connections. One of the most common ways to get these connections involves using StarCraft's in-game AI against itself.

The Zerg player will bring either Mutalisks or Zerglings with the Scourge towards the Terran army. Terran units prioritize both Mutalisks and Zerglings over Scourge, and thus will fire upon them until they are gone before targeting any Scourge. Thus, the Zerg player brings just enough units to draw fire so that the Scourge can complete their suicide run. This also works well with a massive attack, when there are very many targets for the Terran army to kill off before the Scourge, forcing Terran into a tough position. A perfectly fast and precise AI would simply gun down the Scourge the moment they were in range, as they are the real enemies here. Human players can sometimes do this, but again, at the cost of microing the rest of their army.

"Decisions about what is important to hotkey and how to efficiently move from area to area are always important."

So there are some examples that would become game-breaking in regards to speed and precision for micro-management. Several times I talk about the trade-off that professionals will make when deciding how much to micro something. I should talk more about those trade-offs and how unlimited speed and focus could destroy the basis of the game.

StarCraft has lots of limitations on what can be done with a given action. Here are some examples:

- 12 units may be binded to a hotkey, of which there are 10 (number keys, 1-0)

- Only 1 building may be bound to a single hotkey

- There are 3 Positional Camera hotkeys (F2, F3, F4). These recall you to a position on the map.

- Game hotkeys cannot be remapped. For instance, even though many commonly used keys like A for Attack maybe be on one side of the keyboard, some keys are very far away, such as M for Terran Marines, or, perhaps most importantly, P for Protoss's Pylons and Probes, 2 things constructed almost nonstop throughout the game.

- Grouped Spell-casters (such as Science Vessels for Terran or High Templars for Protoss) will all cast the same spell if told to within the same control group. I.E, if you have a group of 5 High Templar on one hotkey (very common) and tell them to Psi Storm an area of the map, every High Templar will attempt to do so.

- Units can be selected by either clicking and dragging your mouse cursor, double clicking a unit (which will make as many as possible up to 12 of that unit selected), using CTRL+Click (which functions the same as double clicking), or SHIFT+CTRL+Click (which will add units to what you already have selected in the same way as CTRL+Click selects them).

- Moving the screen can be done with Arrow Keys (never used in professional play), dragging the mouse to the edge of the screen (not used often in professional play), clicking on the mini-map, double tapping a Hotkey (centering on the hotkeyed units or building), or by using a Positional Camera Hotkey.

- Mouse Speed must be balanced between being fast enough to quickly select, drag, and click the mini-map, and being slow enough that steady, quality micro can be executed.

These are all very important to know to truly understand how professional StarCraft is played. Decisions about what is important to hotkey and how to efficiently move from area to area are always important. One of the easiest ways to see how good a player is, is to measure how quickly and how often that player switches their screen and performs new actions on the new screen.

With perfectly precise and fast micro and speed of mouse movement, the AI destroys the balance that a regular professional must maintain. Let's look at two ways a professional gamer might choose to macro (create his army) during the game. We'll use a Terran with three Barracks (the building that creates infantry, such as Marines) as an example.

"These effects and others caused by a perfectly fast and precise AI would completely destroy the game in the form it is played now. It would be akin to entering a race car into a foot race. "

Buildings on hotkeys - No matter where the Terran player is, his hotkeys can do all his production. The hotkey usage could look something like this: 1m2m3m, where the number corresponds to that Barracks, and m = build Marine.

Clicking minimap - Normally the Terran player's Mouse cursor would be near the middle of his screen. This macro could look something like this: Drag mouse to minimap, pointing to where Barracks are located. Drag mouse to Barracks. Click first Barracks, M. Click second Barracks, M. Click third Barracks, M.

Now clearly, example one is superior on terms of speed to macro. The problem comes later in the game. What if you are at maximum supply with a Marine-based army, and have 10 Barracks to macro with. Well, if the army consists of 120 units (which it definitely could in some games, sometimes even more), then that would use up all 10 hotkeys. 10 Barracks also use up 10 hotkeys. For the human player, both of these situations offer huge problems to overcome.

To attack with 10 groups of units, consisting mostly of Marines, your keystrokes could look like this (get ready for some lingo!): 1a Click t, 2a Click t, 3a Click t, 4a Click t, 5a Click t, 6a Click t, 7a Click t, 8a Click, 9a Click, 0 Click.

If the human would rather keep the macro aspect of the game on hotkeys, which would be a simple 1m2m3m4m5m6m7m8c9c0c, then the attack would involve lots of drag boxing.

A minimum of 10 (and undoubtedly more than 10) drag boxes would have to be made around the units. Each selection would then have to see the mouse cursor move to where it must attack, which could be off of the current screen (which now includes screen scrolling, or clicking on the minimap, both of which use a long mouse movement), then a then click.

Because of units not being neatly organized, the "T" seen above in the hotkey based approach (for the important ability STIM) might require another dragged box. (NOTE: there are other ways that things can be hotkeyed and moved, but it gets way too complicated here to explain completely here). The problem here is the amount of time each option takes. An AI with perfect speed and precision would be able to do these movements so quickly that it would look like StarCraft II (a game which allows much more fluidity of hotkeys, allowing all buildings to be on one hotkey and all units to be on one hotkey) inside of StarCraft I. It would be something that no professional is able to accomplish. The very balance of StarCraft exists within the realms of human speed and control.

These effects and others caused by a perfectly fast and precise AI would completely destroy the game in the form it is played now. It would be akin to entering a race car into a foot race. Usain Bolt is fast, but not 300mph fast. This is all considering, though, that the problem of getting the AI to play strategically correctly has been solved.

This is all the LEAST important piece of it, but definitely something that should be said. This would all be a shortcut way to beat human professional players without being strategically good enough. Its not about programming something that can micro perfectly -- it's more about programming an AI that can understand strategy and make the right decisions. that's where the interesting stuff really begins. That's pretty tough, though.

Want more from Artosis? Follow him on Twitter by clicking here.