Hacker News new | comments | show | ask | jobs | submit login
Starcraft 2 Automated Player (stanford.edu)
381 points by nostromo 2218 days ago | hide | past | web | 43 comments | favorite



I hope people notice this cool feature in the documentation: trash talking! Turing would be proud.

> The AI maintains a set of personas it adopts when fighting humans. These are designed to intimidate the person with the AI's ability to type very complicated and computationally intensive sentences in the middle of battles. Currently this feature is not well developed since it does not affect the win-loss ratio much and I've decided not to unleash the AI on hapless Battle.net players, but I may revisit it eventually.


^ My favorite strategy when I'm defeated and my teammate is still kicking. Try to get a rise out of the enemey just as my teammate executes a drop!


Every AI I've ever seen or written has always sidestepped inconveniences such as a limited number of actions per frame and a limited field of view. Getting this working in a game as complex as Starcraft 2 is ridiculously impressive.

The thread-like programs is an interesting approach, too. I wonder if the author plans to treat stale state using Bayesian belief models instead of assuming it's still correct until a scheduled poll checks it.


For some reason snippyhollow's comment was `dead`ed:

> For the use of Bayesian models in StarCraft AI, see my last 3 papers http://emotion.inrialpes.fr/people/synnaeve/index.html#publi... :)


Note that this is not just another AI for Starcraft: it actually plays the game like a human, by "looking at the screen", and issuing keyboard and mouse orders.


With 1k-2k APM, _with_ grouping commands by contrast to BWAPI (Broodwar API) which does not allows for group commands (20 units attack move = 20 actions with BWAPI, only 2 actions here). And low-level SC2 AI which is at least one order of magnitude less micro-intensive than Broodwar's.


True, but it's still interesting that it's essentially using the same "API" into the game as a player uses. While a computer can obvious do rote tasks much faster than a human, if you limited this AI's actions per minute to something semi-reasonable like 500, it could be a sort of proof of concept for the ridiculously high skill ceiling of Starcraft 2. This is especially true for battle micro.


It seems more like it is a DirectX wrapper, i.e. it gets all the DirectX calls and can insert any user events there.

Getting the DirectX graphic calls and using them is probably a much easier approach than to just looking at the final screen.


Yes, this is why I used quotes for "looking at the screen". This is probably easier, but it's still harder than just getting the game info from the engine.

The interesting thing about this approach is that it can be applied to automate almost any computer task, by intercepting graphic primitives.


DirectX calls are probably (or might be) still higher level than just graphic primitives. So maybe this approach only works for DirectX based games under certain circumstances.

When I first read your comment, I was actually thinking about something similar as Sikuli. Sikuli might actually work for some primitive scripting events in games.


This is true, Sikuli can be used to hack together things like auction house scripts but OCR can be an issue.


If you're looking at automating tasks, have you seen AutoMate and similar products?

http://www.networkautomation.com/

They're very impressive, not just mouse and keyboard "macros".

I've heard people use these to implement computer game "bots" (in particular Magic: the Gathering online trade bots)


For the record, this is how a lot of video game cheats work and it SUCKS. Aimbots in FPS games for example exist 100% out of the game executable so there is no way to stop it. The only option you have as a dev is to detect the behavior and ban with righteous fury.

It's both incredibly cool and wildly frustrating at the same time.


There's a lot of detection that can be done beyond just the behavior. The problem basically reduces to virus detection (and the ensuing arms race). You check all running programs for something that looks like this kind of bot. Right now it's probably easier to just detect the APM or jerky screen view, but in the long run that's the best way to shut these down.

Personally I'm really hoping Blizzard doesn't go after things like this too actively on SC2. It's unfortunate that there's no offline place for bots to play against each other, because the competitions that arise are really fun. There's definitely less money to be made here than in, say, WoW.


Personally I'm really hoping Blizzard doesn't go after things like this too actively on SC2

At a cerebral level, I love to see bots in development for RTS's. Beyond the cool factor, it could wind up developing all sorts of new strategies and spur more high-level discussion. That said, it would really destroy the battle.net experience if bots became prolific.


Ah yeah, I phrased that badly. My intent was to emphasize that the cheat exists solely outside of the game executable. Blizzard runs an incredibly cool, and secretive, program called Warden to do exactly what you said (amongst other things). Details are sparse but my understanding is that every 30 seconds a unique copy is downloaded and run looking for cheats. For small time developers, cough cough, it's a painful problem.


While they are outside the game executable, they are typically injected into the game's memory space, and detour actual game functions.


Hey Matt, if you're reading this - why not post replay files to show off it's abilities. Or send to HuskyStarcraft for him to cast, I think that would be awesome.


Matt has a reddit account. Also, from what I understand, this AI is a modification from work he has done making players for Warcraft 3 and Dota.

Regarding releasing replays:

>>"I'm also aware that Blizzard programmers might find the project interesting but Blizzard as a whole is obligated to not like the idea; this is also reason I've never released a replay, as this would be a clear indication I've played the bot on Battle.net (not to mention they might have a detector or two for things with 5000+ apm)."

http://www.reddit.com/user/techmatt


Wouldn't it be possible to limit the AI's APM to somewhere a human/pro-gamer could achieve to prevent it from being detected?


Won't that mean it'll lose the only advantage it has?


The replays would be awesome. Then you don't have to deal with the jumping camera.


Or send to Day9!


It would be interesting to see how it would fare against a top level human, but I'd be more interested to see how it would fare against other AI implementations.

There could be a whole separate community for SC2 AI competitions - a bit like there exists with chess.


There are Broodwar's AI competitions with the use of BWAPI, they don't win against good-to-top humans yet. (Btw, Broodwar is way more balanced than SC2.)http://code.google.com/p/bwapi/


Yes, a game that's been out for 13 years is way more balanced than a game that's only been out for 1 year.


Yea - like someone like Whitera or TLO - husky should totally try and cast an AI vs Pro game


Suggestions: (1) emulate the time required to move the mouse, (2) reduce the number of times that objects are focused as a human player would do by keeping track of recent commands and not repeating them especially when there is no attacking/defense occurring, (3) emulate human reaction delay. The goal should be that it shouldn't cause convulsions when watching it due to the rapid changes in focus. This is incredibly awesome, though.


Actually if you see pro players play, they jump around in a very similar fashion. That pattern similarity was one of the most impressive things about this.


Kudos to Matt Fisher on an heroic undertaking. Internal states of D3D devices can be substantial on modern hardware, e.g. 100+ renderer calls in that single frame alone. And there are many impressive components in this AI: translating texture glyphs into literal meaning, the scene 'tree' gamestate, rational action choice based on a combo of said extracted gamestate and what I can only assume is his secret play strategy honed over countless hours of battle...

Here is one who is unwilling to sit idly by while an official API arrives from the vendor. And for that he should be applauded. But it begs the question: when will Blizzard release an official SC2 API? Or is there a way to take Matt's work and create a 'sandbox' battle.net solely for bot enthusiasts?


This is really cool. The closer-to-human aspect is great, and the graphics approach is definitely interesting. I love the idea of an AI whose difficulty could be largely tuned by implementing a max APS.

Added the code to my (long) list of things to read!


Fantastic! I've played around with BWAPI for Starcraft (1) AIs, but I like this approach.

So, when's the first SC2 AI competition? The nice thing about SC1 though is that there's no problem running 4 instances in VMs all on the same laptop.


I'd be very interested in using something like this to unlock ridiculous achievements on steam.


I still haven't gotten the "An engineer disarms a landmine after you spot it" achievement on Brink...


I wish it said what rank it played at... did I miss that bit?


I believe he says somewhere that he didn't have it play against real players on battle net so far, but that he can beat AI up to insane, exclusive. I was happy to find out that he's a Stanford PhD student though, and that his office is right above mine :) So I need to drop by tomorrow and convince him to... properly evaluate the algorithm... for science.


My gut says he already tested it on Battle.net, that'd be the first thing I'd do... It's probably not a good idea to make that public though, as the legality of this AI is still uncertain.


>as the legality of this AI is still uncertain.

I know it's just a StarCraft AI, but that sentence still sent a chill down my spine, and visions of Ghost in the Shell / similar SF.


Ask him to post a few replays. I'd like to see this thing in-game.


Based on his description of beating Very Hard opponents I'd guess it is gold to platinum level at the current stage.


I can beat Very Hard opponents with ease but am stuck in silver :-). Furthermore, he states that his AI is weak to early agression. This is not a problem for him because the builtin AI never cheeses, but it happens all the time on ladder and will severely impact his rank.

Nonetheless, I'm totally blown away by the project! Amazing work!


Wow best research project ever!


This could be used as a cheat :/




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: