Impressive StarCraft 2 AI More Fair To Fleshy Opponents

There was a discussion in the comments when the Alpha Go results were released. Some commentors were postulating that AI researchers are discounting more fluid games such as the RTS StarCraft.

The comments then devolved into a discussion of what would make the AI fair to consider against a human player. Many times, AI in RTS games win because they have direct access to the variables in the game. Rather than physically looking at the small area of the screen where a unit is located and then moving their eye to take in strategic information like exact location, health, unit level, etc, the AI just knows that it’s at 120x,2000y,76%,lvl5, etc instantly. The AI also has no click lag as it gets direct access to the game’s API, it simply changes the variables and action queue of a unit directly.

So we were interested to see [Matt]’s Star Craft AI that required the computer to actually look at the game board and click. [Matt]’s AI doesn’t see using OpenCV, which in its own way is forcing the computer to look in a way that’s unnatural to it. He instead wrote some code to intercept the behind the scenes calls to the DirectX library.

The computer is then able to make determinations about what it is looking at using the texture information and other pieces sent to the library. Unlike AI’s that get a direct look at the variables, it has to then translate this and keep its own mental picture of the map and the situation. If a building is destroyed, for example, it has to go over and look at that part of the map, test what it’s seeing against a control, and then remove the building from its list.

The AI’s one big advantage are its robot fingers. Even though this AI has to click on the interface, it doesn’t do it with a weak articulated fleshy nub like the rest of us. This allows the AI to get crazy Actions Per Minute (APM) in the range of 500 to 2000.

The AI has only been tested against StarCraft’s built in cheater bots. So far it can win most games against the hard level bots. If you want to see a video of what the AI is looking at, check after the break.

18 thoughts on “Impressive StarCraft 2 AI More Fair To Fleshy Opponents

  1. I would say that it also has a big advantage in being able to get all the information out of the screen in a single frame, and being able to move the viewport like that without getting a raging headache.

    1. i would guess that would be a problem will all ai systems vs. humans. and more generally is kinda why computers are better than us at anything that needs to process things quickly. The ai can ingest the data at a rate that no human can ever match.

      Now a really interesting ai test here would be to simulate some of the biological constraints that humans have. Like instead of being able to click the buttons instantly you add a delay. Like there is a physical limitation to how fast any person can physically depress a key then move to another key. Or even flick their eyeballs to focus from one thing to another. give the ai those same io constraints and that would be something to really see.

    2. I suspect if we were able to mount a camera in your eye and see all the micro-movements your eye makes “scanning” a single frame for information we’d feel just as disoriented. Worse than watching the blair witch project.

  2. This doesn’t strike me as having any real purpose. This kind of “fair” seems pointless. Perception of the game state is probably the most trivial of tasks with respect to everything else that’s going on.

    Watson was programmed with various delays and still kicked the crap out its opponents.

  3. “Warhammer 40K: Dawn Of War” had a rather extreme example of AI cheating, which could be demonstrated by setting up a base, turtle-style, with multiple defended entrance paths. The AI would mass forces until it thought it had enough to penetrate your defenses. Then it would send them, without fail, to the least heavily defended entrance. Regardless of the path length required to reach it. And regardless of whether the AI should technically be able to “see” your defenses. Which made the AI a real pain to play against, at least until I realized what was going on.

    It went so far that should your defenses change before the AI army entered combat, the AI would INSTANTLY change course for the new best entrance. Therefore, by moving a few units on a short path back and forth between two entrances, the AI could (depending on map layout) be forced to forever travel back and forth on a longer path trying to reach the current best entrance; effectively preventing any attacks at all. With a three-entrance base on an amenable map, just a half dozen units, and a bit of micromanagement, you could protect it against enemies eventually totaling hundreds.

    AI “cheats” because for many games, AI needs to do so. Maintaining a reasonable illusion of intelligence and fairness is all that’s necessary for the game designer.

    [Matt]’s done this in an interesting way, and I know it wasn’t trivial to accomplish a machine-to-machine interface in this manner – so well done on that. But if the “most interesting part of the AI is watching it play and abuse its ability to perform an absurd number of actions per minute (APM)”, and APM “in the range of 500 to 2000” is required to make it a fairly competent player, I’d say the end result is only trading methods of cheating. Also disappointing is that it wasn’t tested extensively against human opponents, preferably unsuspecting ones. If it could pass more often for a human player, even a poor one, that would be a truly satisfying outcome. It was only tested against his friends, who knew in advance it was an AI. And if the experience was in any way memorable for them, [Matt] neglected to mention. I feel cheated by that.

    1. I think the reason you are unsatisfied is the amount of effort and engineering required to build an actual AI that can best any human player at StarCraft 2 without cheating or API access, map and unit hacks, etc is extraordinarily difficult to do properly. Think Alpha Go but even more complex in many ways.

      It’s possible to do but as of right now, it seems to be a work in progress.

      1. There are contests where people build Starcraft 1 AIs and compete in tournaments. Most teams design it to do a strategy or two, and hope nobody implements a hard counter.

        You also get wacky abuses of the actions per minute to do things like manage mutalisks at the optimal spacing for maximizing damage output while minimizing vulnerability to splash damage.

        It’s all interesting stuff, but the point is pretty much never to make an AI that could actually be mistaken for human, even if it’s terrible. I’d love to see more folks try that.

    2. Then the designers/programmers of Dawn of war did it completely wrong. As it’s not that hard to make an extreme AI. After all, calculating what is the weakest entry point isn’t that hard. Which can be fine. But add some randomness in the mix, so it’s not that obvious that the AI is doing that. Also, do not switch target entry point during the attack, human players are very unlikely to do this.

      The difficulty in AI programming for games is in making the enemy behave in a natural manner, without making it look like abuse. Making a killer opponent is easy, making a fun to play opponent is hard.

      In the end, I see that I (and I think most player), enjoy an AI they can predict, and does not obviously cheat.

  4. I wonder what it would take to get Starbreeze Studio to release the source to The Outforce? Its AI is pretty decent. On each map it does have preferred lines of attack but it will probe for and exploit weaknesses.

    I found that out when I allowed my miners to eat a hole through a metal resource belt the first time I played the map. I’d concentrated my defenses at the open front, with a laser fence I could turn off to let my assault forces out. Then suddenly “Our base is under attack!” Huh? Where! Through the back door the miners had helpfully created. The next time a few turbine lasers in the rear of the base kept the enemy out.

    Another trick to force the AI to change its actions is to specify more players for the map than it’s supposed to have. A couple of the small four player maps get real interesting with 8 players shoehorned in. I used to pit the AI VS itself and watch it play for hours. With all AI players set on hard it could go a very long time, even longer with them all set on easiest because they’d hardly attack each other, so I usually chose random.

    Was a shame Infogrames forced o3games to publish The Outforce before it was finished, guaranteeing a flop. It had many innovative things no other RTS had at the time, like unlimited group sizes, up to the game limit. I loved putting 100+ fighters into a group to command to attack all at once. ‘Course that led to the tactic of crushing the AI by unit hogging, build so much that the AI wasn’t allowed to build a huge number. The cap could be increased using a console command, and with further refinement the cap would likely have been changed to per player.

  5. The only way to make this more fair would be building a physical body for AI to use as interface between it and computer running the game. That way it would have physical limitations similar to humans and would be hard-pressed to overcome them.

  6. Am I the only one impressed here? Difficulty goes like that chess >> go >> sc >> sc2 . There is tournament on classic sc AI, year by year, many different approaches tested – see the result. And sc2 is more complex than that (plus more favorable than sc for human being). Looking at video so definitely has to learn but still it was a nice game.

    I’m more worried about possible hacks for sc2 extending player possibilities which might harm the sport.

  7. SC2 has an issue that my son tells me about. Every year they would significantly add/change some units, and that would tip the balance in some other race’s favor. Last time he told me that Protoss are now the most powerful, because of Blink, and now 80% of top players are Protoss :) Next year it will be some other stupidity like that. Compared to that SC1 was much better for this sort of AI development.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.