UC Berkeley StarCraft Class, Week 4
Friday, February 20, 2009 at 2:55PM
Sirlin in Blizzard, StarCraft Class

I was not able to attend the week 3 class, but here's the summary of week 4.

Professor Feng started with an analogy of the game Battleship (you know, that game where you say "H2," then the other guy says "You sunk my battleship!") What if you played a game of Battleship where the number of attacks you get per turn is equal to the number of ships you have left, he asked. Feng is pointing out the essential slippery slope nature of the game, that your ability to attack is reduced as you start fall behind (as opposed to many games where your ability to attack is unaffected by falling behind--I wrote about this here).

Perfect Micro

Then we explored the math behind this idea. To make it easier, we considered the damage done between two packs of marines assuming all marines are within range of each other in an idealized situation. One player has N1 marines versus the other player's N2 marines. Assume the first player has perfect micromanagement while the other player has the worst micromanagement possible. In perfect micromanagement, as many of your units as possible deal damage for as long as possible. In other words, you focus fire on a single enemy marine and kill him as soon as possible so that the enemy's damage output is reduced. You then immediately switch to a new marine, focus fire on him to kill, switch targets, and so on. Meanwhile, your opponent is attacking in the worst way possible: he spreads out his damage evenly amongst your marines, not killing any of them (thus allowing you to keep your overall damage per second high while his declines).

If each marine deals D damage per shot, then after volley 1, player 1 dealt N1D damage while player 2 dealt N2D damage. Player 1 killed N1D/K marines where K = the hit points of a marine. Player 2 killed 0 marines though.

After a second volley, player 1 still deals N1D damage and again kills N1D/K marines. Player 2 only has N2 - (N1D/K) marines left though, so he deals (N2 - (N1D/K)D damage and kills 0 marines again.

After m volleys of this, how many marines are left on each side? Player 1 will have the same number of marines he started with (N1) for a long time, then they will all suddenly die at about the same time. This is because the opponent is attacking in the least efficient way possible here, basically keeping player 1's marines alive as long as possible. Calculating player 2's remaining marines is more tricky though. Player 2 will deal this much damage after m volleys:

Summation from 1 to m of (N2 - N1D/Km)D. This solves to mD(N2 - N1(m+1)/2K).

Why does this matter? Perfect macro is not quite possible and even the built-in AI will probably not use the most inefficient attack possible. The point is to see how big the gap is between perfect and worst macro, so we know what kind of relationship we're dealing with. The answer is that the difference in damage dealt is proportional to the SQUARE of m, the number of volleys. You can also think about this as being proportional to the square of the time the battle takes. So the better micro player doesn't get a linear advantage here, he gets the much bigger "squared" advantage. Relationships in the economy of StarCraft have even bigger effects (exponential), but that's for another class.

Population Dynamics

Professor Feng then represented the problem in a simpler(??) way by ignoring the specifics of perfect micro. Instead, imagine we have two groups of units, A and B, and we know the two variables alpha and beta that are the death rates. Alpha is the rate at which A dies because of B and beta is the rate at which B dies because of A. We don't care about exactly every detail of alpha. It might involve micro, or shield regeneration, or distances/ranges, or terrain, and so on. We can actually determine alpha experimentally for specific situations by setting up tests in the game itself.

How much of A is left after time t is a function we'll call A(t). We'll call the initial value of A (at time 0) A0.
A(t) = A0 - integral of (alpha * (B(t))dt. Likewise...
B(t) = B0 - integral of (beta *A(t))dt.

What followed was a bunch of math involving double integrals and such, and I'll omit it here partly because it's too much trouble for me to present math equations here in a readable form, and partly because my notes on the derivation aren't perfect and if there's the tiniest error, I'll have to read a hundred comments about it, even though this isn't my math in the first place. I wish professor Feng had gone through this part more slowly. Even though I'm adept at calculus, it was hard to follow every step in quick, small writing on a whiteboard.

Anyway, the real point is the result of the calculation. A(t) = A0 - alpha*B0 + an integral. That integral is kind of a correction factor. If the battle ends very quickly, then the integral hardly matters at all. If the battle lasts a long time, then the correction factor dominates. Notably, that correction factor has a term of e ^ sqrt(alpha*beta*t). If this math stuff is hurting your head, Feng is trying to demonstrate here exactly how much population dynamics matter on different time scales.

On a time scale of 1 or 2 seconds, they don't really matter at all. The integral might as well not be there.
On a time scale of 10 or 15 seconds, the importance of the death rate (from micro, terrain, etc) is much higher.
On a time scale of 40 seconds (a long battle), it's extremely important. The correction factor is huge and dominates the calculation.

Examples

Feng then showed us two gameplay examples. In the first example, both Protoss players had large armies and started a battle. One player used his Arbiters' statis abilities to take many enemy units out of the battle temporarily (this included the enemy Arbiters, nice). The victim's death rate was now reduced a lot. There were a lot of units involved here, so the time scale of the battle was large. We saw how big of an effect this was, as the victim's remaining units got cut to shreds, then when the smaller force of statis'd units recovered, they got cut to shreds as well.

In another example from that same game, both players again had a lot of units on the verge of a battle. Here, one player was moving his units and the other attacking during this troop movement. The effect was that the player on the move had too many units that were too far away from the action and so his death rate (his ability to deal actual damage in a battle) was pretty low. The point here is that even when your troops show up after a few seconds, you're already sunk. Those were too many seconds where you took lots of damage without dealing enough back, which puts you behind, which spirals out of control. The longer the battle (because it involves more units), the bigger the disaster is.

Flux

This brings us to the concept of flux, the measure of how much your forces are actually able to deal damage. In English, it's the ratio of your "usefully attacking guys" to "all your guys" in a battle. For example, if you send 48 zerglings to attack a choke point that is blocked by 3 zealots, your flux is very low. You have a few few zerglings in front dealing damage while forty-something zerglings behind run around uselessly.

Another simple example is to imagine the enemy has a ranged units in a broad horizontal line formation, waiting for you. Your forces are above, and you move them directly down, single file, to meet this line. Your flux is terrible because your guys probably die one by one as they come in contact with many simultaneous hits from the enemy formation (it has much better flux).

Then Lore, a player who trained Professor Feng earlier in his gaming carreer took over the lecture for a while. He plays Zerg and talked about the mobility of Zerg. He said that if you look at the APM (actions per minute) of a match, and break down where all those actions are going, the Zerg use more actions on moving than the other races. Lore says this is partly because their units are weak and die relatively quickly, so that makes positioning them that much more important. Also, because Zerg have many (weak) units, it means that they are often getting in each other's way, so that requires more attention on movement. Finally, because Zerg units are so numerous, it's possible to split them up and attack on multiple fronts (more movement).

Lore then showed us a replay of a game he played last week, his Zerg vs. Terran. This replay had many examples of flux. The Zerg player often tried to flank the Terrans so that he could have multiple packs of hydralisks coming from different angles. The idea is that this maximizes the flux because the hydras are all suddenly in attack range, rather than stumbling around behind each other. That said, he often failed to pull of his flanks, but he at least showed us where he tried, and sometimes succeeded.

He had great success in stopping a huge Terran attack using burrow. He burrowed a pack of Hydralisks near his base and unburrowed them when the Terran's huge force was right there. This means that the hydras didn't have to take damage (and die) as they wandered into range. He basically had 100% flux right here, with all the hydras immediately dealing damage. he also happened to get the seige tanks to deal a lot of splash damage to each other because of this positioning.

Another technique he used (in combination with burrow!) was to send 3 overlords full of units on top of the tanks and drop them. This was yet another way to get good flux. His units went from out of combat to suddenly in combat in such a way that every single Zerg unit could immediately attack usefully.

Another instructor then talked about winning with Terran. He emphasized that Seige Tanks are crazily good because they have the longest range in the game. If you "keep the enemy off your tanks, you'll be fine." He also emphasized that Vultures are ridiculously good. He said they are the fastest units in the game, and their 20 damage shot isn't bad, while their ability to lay 3 mines each is amazing. He showed a replay of a game where the Terran player has a ton of tanks and vultures and when a battle happens, he doesn't even use the vultures to attack. Instead he just drives them around in front of the tanks for protection, so the tanks have enough time to kill whatever the threat is.

He also talked a lot about the "big ball" technique. Terrans want to keep their units together in a big ball of death that outranges and kills everything. Tanks + vultures was one example. He also stressed that this takes a while to setup, so before you roll around the map with your big ball, you need to harass the enemy, not to kill him, but to slow him down so that your big ball won't have to fight as much stuff later. Vultures are great at this harassment and you can also use them as part of the big ball itself later, as he showed in the video.

The instructors then joked that we have no time to cover Protoss, "but they are too easy to play anyway."

Conclusion

Professor Feng then closed by saying that the best things to attack as those that don't attack back. Population dynamics and slippery slope are so large, that you would do well to attack things that don't hurt you, so that your remaining force will be overwhelming later. Examples are attacking peons when possible, or supply depots that are out of range of Terran defenses. Zerg are often able to fly Mutalisks around the map, looking for anything that's not defended, and attacking that. Attacking units on the move also qualifies because if you have a large enough force or a large enough advantage in flux, it's possible to kill an enemy group without even losing anything. Just to make up fake numbers, your force of 20 against their force of 5 might not result in you having 15 left. The advantage is so large here that you could end up with 19 or all 20 of your units after killing those 5, so they basically qualify as "attacking something that can't hurt you."

Much of Sun Tzu's advice about when to attack and when not to has to do with these same concept of population dynamics and flux. If have either of those advantages, press them. If you don't, avoid fighting because you'll only lose everything if you do.

Article originally appeared on Sirlin.Net (http://oldsite.sirlin.net/).
See website for complete article licensing information.