Live data from Hacker News

Using genetic algorithms to find Starcraft 2 build orders

lbrandy.com

31–40 of 79 posts

Re: Using genetic algorithms to find Starcraft 2 build orders

#31

Starcraft 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.

"Micro", or managing your units in battle, is also vital. I've lost 4 bases worth of Zerg units against a 2 basing Terran through horrible micro.

I've had that happen more times than I can count. It's hard, because all the terran has to do is hit stim on his MMM ball and A-move. As zerg you have to pull off some Robert E. Lee shit to have a chance.

Re: Using genetic algorithms to find Starcraft 2 build orders

#32

Earlier quoted context omitted.

> 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 sen…

> 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. I believe that the fitness function used for evaluating build orders does this. It is very difficult to accurately evaluate how good a specific strategy is at a specific point in time, especially when you have imperfec…

Yes, but that's the fitness function you want to maximise (i.e. the end result you will get with each "individual"). I'm saying that you might want to use heuristics in maximising that, rather than a GA.

Re: Using genetic algorithms to find Starcraft 2 build orders

#33
post #31

Earlier quoted context omitted.

"Micro", or managing your units in battle, is also vital. I've lost 4 bases worth of Zerg units against a 2 basing Terran through horrible micro.

I've had that happen more times than I can count. It's hard, because all the terran has to do is hit stim on his MMM ball and A-move. As zerg you have to pull off some Robert E. Lee shit to have a chance.

My biggest problem is pushing into an army backed up by a planetary fortress. I think I need to wait for the Terran to push out more and then destroy his army in the field or drop into his main. Pushing the front of a Terran base is suicide.

Re: Using genetic algorithms to find Starcraft 2 build orders

#34

Starcraft 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.

"Amateur's discuss strategy, professionals discuss logistics" And more specifically, it's not about maximizing your rate of production, its about maximizing the difference between youres and your opponents (this is both RTS and real life war). That's the basis of rush tactics. You actually stunt your own rate of growth in the hopes of stunting your opponents even more.

Totally -- not to mention surviving long enough to let compound interest naturally magnify that difference.

As for the tactics or "logistics" -- if that means clicking 500 times/minute, then i really don't see the appeal :)

Re: Using genetic algorithms to find Starcraft 2 build orders

#35
post #22

Earlier quoted context omitted.

Indeed. Though the crucial difference is, that chess is a game of complete information, while StarCraft hides your enemy. It's much harder to do tree search without complete information. As a comparison, look at the recent progress made in computer Go that employs Monte Carlo simulations. (And Genetic Algorithms are closer to Monte Carlo than to tree searches.)

I believe it's only harder when you want to optimise for the outcome (winning), since it's hard to know what your opponent will do if you can't see them. However, if you optimise for total offensive/defensive power, I think you can do quite well with trees!

Not only trees but also linear or integer programming approaches. (That's where my theoretical background lies, by the way.)

Re: Using genetic algorithms to find Starcraft 2 build orders

#36

Earlier quoted context omitted.

"Amateur's discuss strategy, professionals discuss logistics" And more specifically, it's not about maximizing your rate of production, its about maximizing the difference between youres and your opponents (this is both RTS and real life war). That's the basis of rush tactics. You actually stunt your own rate of growth in the hopes of stunting your opponents even more.

Totally -- not to mention surviving long enough to let compound interest naturally magnify that difference. As for the tactics or "logistics" -- if that means clicking 500 times/minute, then i really don't see the appeal :)

StarCraft 2 has tastefully upgraded the UI so that you can do lots of things with less clicks than before in SC 1. (Of course, that means at the higher end, people will just do more now than they did. But it's quite a nice feeling on the beginner level, too. E.g. you can get a worker to work right after it's build. And there's also a button for finding idle workers.)

Re: Using genetic algorithms to find Starcraft 2 build orders

#37
post #21

I 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).

Yeah I was going to say, I'm a silver level and this strat does not work that well even in that tier.

Re: Using genetic algorithms to find Starcraft 2 build orders

#38

Earlier quoted context omitted.

That's what I was thinking too but my AI knowledge is a bit rusty. A genetic algorithm serves as a search algorithm that is finding a solution among a set of candidates. For example finding an answer to a sudoku. A GA can also be used to perform optimization. For example arranging the structure of a bridge to maximize the load it can support. The Starcraft build order as defined here is a planning problem, that is a…

I can't tell you if it's "right", as I haven't worked on this particular problem, and ML is hardly black-and-white. GAs might give good results, it's just that there is usually another algorithm that will give better results faster. Again, it might work very well, I just think that some sort of tree-based approach might be faster and more efficient.

Again, it might work very well, I just think that some sort of tree-based approach might be faster and more efficient.

While this is true in general, sometimes the nice thing about genetic methods is that pretty much all you have to do is write the fitness function, cross your fingers that the problem is a good fit for the method and go do some real work on another computer for a while.

Oftentimes other methods require more in the way of setup or planning, not the least of which is actually picking an appropriate method and mapping its implementation onto the problem space.

Some of the nastiest problems I've ever worked on have gotten that way because I went with a domain specific approach that was "optimized for the problem"; while the end results are usually very good (and, to be fair, run on the computer from zero-to-solved in no time flat), in a couple cases I've gone back and tried the "brute force" genetic programming approach, and though it took quite a bit more computer time, the programming effort was substantially smaller to end up with similarly good results.

The real problem, though, is that many of the problems people apply GA/GP to aren't well suited to the genetic approach, usually because the problem itself doesn't lend itself to incrementally improving solutions (problems like function regression can be tricky, because getting close to the correct functional form symbolically usually leaves you very far away from the correct form numerically, and sometimes the correct result is actually surrounded by a "wall" of completely and utterly unfit solutions that's very hard to break through). Genetic methods work well when the fitness landscape has lots of solutions that work fairly well, and quite a few that work great, not when there's literally one needle in some super-multi-dimensional haystack.

To be fair, the Starcraft optimization problem is probably somewhere in the middle, there are probably many good solutions to the problem, and many of these will be minor variations on other good solutions, so it's pretty likely that a GA will get to some good ones. But the search space is small enough that you're probably right, a heuristic-guided direct search would be more likely to pick out the best solutions faster.

Re: Using genetic algorithms to find Starcraft 2 build orders

#39
post #21

I 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).

Yeah I was going to say, I'm a silver level and this strat does not work that well even in that tier.

Are 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.
Post reply on HN