10 ms·
Using genetic algorithms to find Starcraft 2 build orders
- CoryOndrejka 16y agoThis echoes the story of Eurisko, a genetic AI written by Stanford's Douglas Lenat to build Traveller "Trillion Credit Fleets." Eurisko destroyed the competition at the national championship 2 years in row. http://aliciapatterson.org/APF0704/Johnson/Johnson.html http://aliciapatterson.org/APF0704/Johnson/Johnson.html In both cases, using the GA allowed a player to more comprehensively search the opportunity space created by the game designers than the designers did during design and play testing. Really awesome stuff, though it sets up an intriguing arm's race between the game designers who can patch and Nerf elements to eliminate unbalanced strategies and the players who then explore the new rule set.
- olegkikin 16y agoIt's sad that they banned him. What kind of logic is this? Do they really think it would stop other players from doing the same?
- endtime 16y agoIIRC they didn't ban him - rather, they told him that if he kept competing they'd just cancel the competition. This was not out of spite, but because he was so dominant that it was discouraging the other players from even trying.
- electromagnetic 16y agoCreate an open 'fight the machine' competition and let them brawl it out. Problem resolved.
- JoachimSchipper 16y agoProbably, yes. Somewhat closed gaming groups can have fun with an imperfect game if everyone agrees not to abuse the holes in the rules. (After all, rules abuse does not necessarily lead to a more fun game.)
- andreyf 16y agoThis has been happening over the centuries with games like chess: after enough people spent time on them, openings began to develop. Now we've got iPhone apps to teach use SC2 openings: http://itunes.apple.com/us/app/build-calculator-for-starcraft/id381214248?mt=8 http://itunes.apple.com/us/app/build-calculator-for-starcraf... How long before there's an app to develop them in real-time, by optimizing for certain constraints?
- beagle3 16y agoI've been looking for material about Eurisko. Other than this championship, there appears to be no credible documentation of any of Eurisko's reported achievements. It might be super-duper, but the fact that he wouldn't let anyone else use it, and that those amazing feats have not been reproduced by others despite huge advances - might just mean that there's more myth to truth in the stories about Eurisko.
- jonoff 16y agoAdding to the mystery, I read the newyorker article (2009) linked from wikipedia on Eurisko, and it seems Lenat forgot the winning strategy Eurisko developed, or the first article is wrong. "Eurisko, however, had judged that defense was more important than offense, that many cheap, invulnerable ships would outlast fleets consisting of a few high-priced, sophisticated vessels. There were ninety-six ships in Eurisko’s fleet, most of which were slow and clumsy because of their heavy armor" - 1984 article "astronomical number of small ships like P.T. boats, with powerful weapons but absolutely no defense and no mobility, Lenat said. They just sat there. Basically, if they were hit once they would sink." - 2009 article
- Brashman 16y agoThis is pretty cool to see programs "solving" video games. Although, for the most part I don't think this will affect play much. All-in strategies like this tend to only work if the other player is unprepared. Granted, this is a very fast rush and perhaps still very difficult to scout and notice early enough to counter, but the Starcraft community does tend to go back and forth finding and countering new builds (Perhaps the next step is to use a program to find a counter to this). The two points about the build that the article mentions as counter-intuitive don't seem that strange to me since it is a rush (all-in) build. The extractor trick is well known and I would believe that it sacrifices economy long term but it gives you an extra drone (= more money) early on which is good for a rush. The double overlord is there to support the seven roaches that you build almost all at once. At the beginning of the game, you can only afford to build one unit at a time so you can also replenish supply one overlord at a time. As the game progresses and you start pumping out large number of units at a time, you have to also be producing multiple overlords simultaneously to keep up with supply. Although this is very early, the all-in rush to produce 7 roaches requires a fast increase in supply. To give an idea of how fast this is, the build ends at around 31 supply, about half of which is the attacking roach units. Max supply is 200 and mid-game is probably somewhere around 50-70 supply.
- icegreentea 16y agoI haven't looked into SC2 as much, but in the BW version of the the extractor trick, the cost-benefit tips at some point within the timespan of 'rushes'. That is, it'll be wonderful for very very fast rushes, but more 'patient' rushes are harmed by it. And at least for BW rushes, the trend seemed to be in the last bit before SC2 came out to trend towards more patient rushes. People weren't even looking for the win off the rushes anymore, but rather some sort of fast econ harrass to early map control. That mind set, where fast extractor tricks were optimal probably carried over a bit into the SC2 build making process.
- Brashman 16y agoYes, most high level play isn't really looking to do all-in rushes like this. The goal is more to "fast econ harrass to early map control" giving you an early advantage and allowing you to eventually win.
- seigenblues 16y agoStarcraft has always struck me as a game of compound interest, and the optimal early builds always seem to be just that: maximizing an instantaneous rate-of-production, which will correlate to maximizing your instantaneous rates-of-doing-damage It's always seemed like more of an economic strategy game than an actual "fronts of battle" kind of strategy.
- iron_ball 16y agoThat's true, but if you're evenly matched with your opponent, your initial economic curves will be identical, and then strategy and tactics come into play. Obviously it can be more valuable to strike the opponent's miners and factories than to engage his main army -- but real war is no different.
- NyxWulf 16y agoThat's actually not true. There are two ways to look at economic production in SC2. You can spend your time and money producing items that will do damage (e.g. units), or you can spend money on things that will increase your production rate (e.g. more barracks, hatcheries, etc). Then there is a tech tree to factor in, how far up the tech tree should you go. It's all about understanding how far up the tech tree you need to go. Say you are facing an opponent that is going to rush with level 1 units, if you know this, you can build defenses at choke points that will cost you much less than his units will cost to break through. At the same time you are rapidly climbing the tech tree to get more powerful units and spending less on the lower tier units. On the other hand, if he has just enough units to bust through your defenses, it's game over. That's how strategy comes into play in SC2. Often part of your early game strategy is figuring out how to disrupt the opponents supply chain (particularly along their critical path) while continuing to increase your own production capacity. Long post - but in general your economic curves are not necessarily the same. Early expand, versus more units and pushing, etc.
- gaius 16y agoWW1 and especially 2 were an economic strategy game. The Cold War was an economic strategy game.
- StavrosK 16y agoA GA sounds like exactly the wrong way to go about this. I think you could do much better with a heuristic algorithm than a GA in this case, and I think GAs (like neural networks) are very much overused just because they correlate well with natural processes. That said, I haven't played SC2, and I don't know what sort of complexity the building problem has.
- bigmac 16y agoI can't quite understand if you're saying GA's are neural networks, or just that both of them are overused. Either way, one of the big problems is that the heuristics for a heuristic algorithm must be designed by with human insights. In this case, and in many other cases where GA's have been applied successfully, a fundamental new insight is discovered by the algorithm. I do play some SC2. There are a bunch of built-in AIs that use heuristic algorithms, yet they are all easily defeated. The GA in this case is really about searching through an immense space to find good candidates. To give you a feel for the complexity of the building problem, consider this. There are custom maps where are all you do is practice your initial build order, with absolutely no opponent. It is pretty well accepted within the SC2 community that you should use these practice maps in order to get better. Another way to think about it is that this build order will probably cause Blizzard to tweak the game due to how fast the roaches come out. This game has been in development for 10 years, yet there are interactions of the building process that are not understood by the developers themselves.
- StavrosK 16y ago> I can't quite understand if you're saying GA's are neural networks, or just that both of them are overused. I was saying that both are overused. > one of the big problems is that the heuristics for a heuristic algorithm must be designed by with human insights By "heuristics" I don't strictly mean "rule-based", but you can do a good job in reducing the search space by a large amount if you program in some common sense that will discard obviously bad moves. It would be surprising if the devs did understand all the interactions, as it would mean that the search space is trivial. SC2 is not that much different from chess, and, to my knowledge, the best chess-playing AIs don't use genetics. They get much further with trees and precalculated start- and endgame moves.
- jtchang 16y agoI am a diamond level terran on ladder and have faced this rush build order before. To be honest it is a very strong build but most players will scout this very early. I would be more interested in searching the space for hard counters to build orders with certain match ups. Certainly it gets way more complex (and starcraft is).
- alnayyir 16y agoYeah I was going to say, I'm a silver level and this strat does not work that well even in that tier.
- 3pt14159 16y agoAre you sure you are timing it correctly, using it on the right map, and microing ok? It should decimate most Protoss players unless they scout, discover, forge up, delay possible cannons until last min, dual exp, and quick air or go all in sentries.
- NyxWulf 16y ago> It should decimate most Protoss players unless they scout.. It should (annhilate|destroy|overwhelm|<etc>) most Protoss players unless they scout... FTFY That usage of decimate is as grating to me as it is common. :/ I don't blame you, I'm just shaking my fists at the heavens in impotent rage.
- waterhouse 16y agoI sympathize and agree. For those who don't know, the word "decimate" comes from a practice of the Roman army in which they would kill one out of every ten soldiers as a punishment for mutiny. http://en.wikipedia.org/wiki/Decimation_(Roman_army) http://en.wikipedia.org/wiki/Decimation_(Roman_army)
- neilc 16y agoThat is the origin of the word, but I don't see why there is anything wrong with using it as the original poster did: "to cause great destruction or harm to" is a perfectly valid meaning of the word. http://www.merriam-webster.com/dictionary/decimate http://www.merriam-webster.com/dictionary/decimate
- codexon 16y agoThis is the type of non-obvious optimization that genetic algorithms excel at. This is not true. GA search is a hill climbing algorithm which is prone to finding local maxima. The less obvious a strategy is, the more likely it is that GA will miss it.
- richcollins 16y agoGAs are less likely than other learning techniques to get stuck at a local maxima because mutations and crossover can cause to them to search entirely new areas in the space (unlike ANNs for example).
- henning 16y ago> GA search is a hill climbing algorithm which is prone to finding local maxima GAs are not pure hill climbers. Variation operators introduce new solutions into the population at random. As long as premature convergence is prevented, GAs will probably explore the search space well. There's always a tradeoff between exploration and exploitation. > The less obvious a strategy is, the more likely it is that GA will miss it. This is a tautology that states "the harder a problem it is, the harder it is."
- codexon 16y agoGAs are not pure hill climbers. Variation operators introduce new solutions into the population at random. In searching for non-obvious solutions a GA is no better, probably even worse than an exhaustive search. You are essentially gambling to find the absolute maxima by increasing the mutation rate and population variance. GA is merely a heuristic to speed up searches by assuming the global solution is close to your randomly seeded population, something which is unlikely to be true in non-obvious solutions. Let's say you increase the mutation rate to the point where you are guaranteed find the "non-obvious solution". Well then you've essentially just created an insanely inefficient exhaustive search. This is a tautology that states "the harder a problem it is, the harder it is. No. For example in an exhaustive search, the obviousness of a strategy has no bearing on whether or not it would more likely be found.
- seles 16y agoI'm not going to say that this program is useless, but the example shown (7 roach) would have been near trivial to find by a mere human. Tricks like premaking the overlord, using extractor trick, etc. Have been around for over 10 years since the early days of Starcraft 1. Any person could come up with this build, the question is where did the idea to rush for 7 roaches come from? It sounds like that was manually set as the target goal by the creator. I have yet to see a programs which is better than human at finding optimal builds. But what programs do excel at is simulating a build so you can see how the timings work out, allowing you to find your own build by experimentation and tweaking. Sure a program can help automate some very minor fine tuning details (which would be easy to find but perhaps tedious).
- mfukar 16y agoYet nobody found it. The closest thing to a roach rush people found was the 5-roach build [1], which is slower and it suffers a lot economically if the rush fails. For the record, though, I've played against the 7-roach build a couple of weeks ago, and iirc that was a few days before EvolutionChamber was announced. So some people knew about it, maybe they found out about it from the creator, or played against him, who knows. [1] http://wiki.teamliquid.net/starcraft2/5_Roach_Rush_%28vs._Terran%29 http://wiki.teamliquid.net/starcraft2/5_Roach_Rush_%28vs._Te...
- seles 16y agoOnly because they never looked for it. Did this program decide to look for it on its own (having some idea of strategy, that would be impressive)? Or did the creator tell it to find fastest 7 roach build?
- robryan 16y agoI'd imagine you would assign each unit some kind of relative value to each other and then factor in a time weighing making earlier builds more desirable even if there unit score is lower.
- Aegean 16y agoThis was a very interesting read in that it gives a solid example on how designing a system can be outperformed by a natural selection approach. Us humans are inclined to design things and it is very easy to dismiss a random trial and error approach to achieve best results.
- dorianj 16y agoAnother unmentioned aspect of this is Blizzard's involvement. If this build is truly unstoppable in most cases, then Blizzard's balance team will simply nerf some aspect of Zerg to make it harder to abuse. For example, when the balance team determined that Reapers were too strong in early game, they made the tech required for them take longer to get.
- Artagra 16y agoI'm sure Blizzard will Nerf this. Early reapers, well executed, had about a 70% success rate. This has a 80% success rate at least, and is much harder to counter.
- justin 16y agoJust won 10 games in a row 7 roach rushing. This is awesome :)