How Often Should You 12 Pool?
Last edited:
Nash Equilibrium Calculator
All numbers in the table are your win percentages in the given matchup. You can add or subtract strategies using the buttons on the bottom and right of the table, and you can change the name of each of the strategies by changing the name in the text box. The nash equilibrium percentages should automatically update as you edit the table.
Your Nash Eq.
Opponent Nash Eq.
Nash equilibrium calculations are done with a WASM version of the awesome lrslib library. In the case multiple equilibria are found, we only report the last one.
Introduction
When playing Starcraft 2 there is an inherent tradeoff between economy and protection from early game cheeses. In the zerg vs protoss matchup for example, the zerg can usually guarantee a win if they go for a "12 pool" build and the protoss opponent doesn't scout. Therefore, protoss players will usually scout by sending a worker across the map to see if the zerg player built an early spawning pool. However this worker has an economic impact on the protoss player's economy since it would mine a significant amount of minerals if left at home.
If a protoss player never scouts, a zerg player can gain an advantage by occasionally going for a 12 pool, and vice versa, if a zerg player never 12 pools then a protoss player can gain an advantage by never scouting. So, the question is, how often should the zerg player 12 pool and how often should the protoss player scout to protect themselves against exploitation by the opponent? It's not immediately obvious that there is guaranteed to be an answer but a theorem proved by John Nash in game theory says their must be! This "optimal" strategy is called a Nash equilibrium.
If you choose your strategy according to the Nash equilibrium, your opponent cannot gain an advantage by deviating from their nash equilibrium. In fact, often times it will be the case that if you choose your strategy according to the Nash equilibrium, regardless of what strategy your opponent picks, your win percentage will not change.
Simple Example - 12 pool vs worker scout
To get familiar with Nash equilibrium let's explicitly calculate it for the example given at the beginning of this post: a zerg player can choose to 12 pool or macro and a protoss player can choose to scout or not. To calculate the nash equilibrium strategy let's start by assuming what fraction of the time zerg wins in the following cases:
- 12 pool, no worker scout
- 12 pool, worker scout
- macro game, no worker scout
- macro game, worker scout
In this case I'll just assume some numbers:
- P(zerg win | 12 pool, no worker scout) = 100%
- P(zerg win | 12 pool, worker scout) = 20%
- P(zerg win | macro game, no worker scout) = 40%
- P(zerg win | macro game, worker scout) = 60%
P(zerg win | 12 pool, no worker scout) should be read as the probability that the zerg wins given that they 12 pool and the protoss does not worker scout.
Let's let x represent the fraction of games that the zerg goes 12 pool and y represent the fraction of games that the protoss worker scouts. If we are the zerg player, we want to know what is the probability that we win given x and y, or:
P(zerg win | x, y)
We can expand this since we already enumerated all the possibilties:
P(zerg win | x, y) = xy*0.2 + x*(1-y)*1 + (1-x)*(1-y)*0.4 + (1-x)*y*0.6
P(zerg win | x, y) = -xy + 0.6*x + 0.2*y + 0.4
Now, the Nash equilibrium should be a spot in this 2 dimensional space where neither player gains an advantage by changing their strategy. In this case the strategy for the zerg player is how often they 12 pool (or x) and the strategy for the protoss player is how often they worker scout (or y). So the Nash equilibrium would be something like a saddle point in this 2D space where if the zerg player deviates they don't win more and if the protoss player deviates the zerg doesn't lose more.
We can find this numerically by looking for a spot where both the x and y derivatives are zero:
d/dx(P(zerg win|x,y)) = -y + 0.6
d/dy(P(zerg win|x,y)) = -x + 0.2
If we set these both to zero we find x = 0.2 and y = 0.6, or the zerg should 12 pool 20% of the time and the protoss player should scout 60% of the time.
We can see this graphically by looking at the zerg win rate as a function of x and y:

It's a little hard to see, but the point at x = 0.2 and y = 0.6 is indeed a saddle point.
Equilibrium vs Exploitation
We previously calculated that the nash equlibrium for the zerg player is to 12 pool 20% of the time. If the zerg player does this, their strategy is unexploitable, however this does not mean that it is the best strategy. For example, if the zerg player is going up against a protoss protoss player who always scouts, then you know that y = 1 and your win percentage is
P(zerg win | x, y = 1) = -0.4*x + 0.6
and to maximize this you should set x = 0, i.e. never 12 pool (and you'll win 60% of the time).
This is called an exploitative strategy because you are exploiting the fact that your opponent is not playing near the nash equilibrium.
A similar concept occurs in high level poker. There, instead of talking about Nash equilibrium strategies they talk about "game theory optimal play", but it's the same thing. In poker, by following a game theory optimal play strategy you guarantee that no player can choose a strategy which beats you. However, if you are playing in a tournament and know that opponents are not playing game theory optimal play it is not your best strategy and instead you should play a different strategy to exploit your opponents weakness. Typically if someone plays game theory optimal and another player is playing exploitative (correctly), the exploitative player will gain a chip advantage and will likely beat the game theory optimal player due to the inherent randomness of the game combined with their chip advantage (Note: when facing the game theory optimal player the exploitative player should switch to playing game theory optimal too and only play exploitative against the other opponents).
In any real world game, things are much more complicated than this. Typically you may not know exactly what your win percentages in each scenario are. Furthermore these win percentages probably vary significantly based on the map, your opponent, etc. And often, the strategies will not be as binary as shown here. However, I think these simple models are a good way to hone your intuition about situations like this and can help you choose a better strategy overall.
Indifference Principle
You might have noticed something curious if you worked through the math in the previous sections. If you are the zerg player and playing at the Nash equilibrium, it doesn't matter what your opponent does, your win percentage will be fixed at 52%. In other words, if they scout 100% of the time you will win 52% of the time, if they don't scout 100% of the time you will still win 52% of the time. This is referred to as a weak nash equilibrium (as opposed to a strict Nash equilibrium where any player deviating will lose more).
This seems odd given that poker programs playing close to the nash equilibrium are able to beat pro poker players (see this news story). If a program is playing at the nash equilibrium (and it is a weak equilibrium, which almost all poker strategies are), shouldn't opponents always "break even"? The answer is that a weak nash equilibrium is indifferent only to those strategies with a non-zero probability. This is known as the indifference principle. For our simple example with the 12 pool and worker scout, all strategies had a non-zero probability in equilibrium, so if 1 player was playing at the nash equilibrium, it indeed didn't matter what the opponent did. However, if there are more strategies and some of them should never be played at equilibrium, then playing those strategies will lower your win percentage against an opponent playing at equilibrium. Equivalently, in poker there are often times where the percentage of time you should bet, fold, call, etc. are zero, and it is in these cases that the game theory optimal program or player will beat another player.
Real games
- If you know your opponent is playing far from their Nash equilibrium, then you should just exploit that. The best response to their strategy will be a pure strategy (see this question on math.stackexchange.com ). So, find the pure strategy which counters theirs and play it slightly more often than your nash equlibrium would suggest (here we avoid simply playing the same pure strategy over and over because in practice the opponents strategy will not be truly fixed if they keep getting countered).
- If you are not sure of your opponent's strategy you should just play at the Nash equilibrium and you guarantee that your opponent cannot gain an advantage through build orders.
Randomly selecting strategies
Although it's not really relevant for online play, it's fun to think about how you might randomly choose your strategy in game to make sure you actually hit your required fraction. If you have access to a clock the simplest method would be to look at the second hand at the start of the game. If your goal was to 12 pool 20% of the time, you can choose to 12 pool if it's below 60*0.2 = 12 seconds and otherwise play a macro game. You might also be able to select a strategy using some randomness in-game: for example from your starting location, the in-game tips before the game, which side of a building your SCV is on, etc.
Conclusion
Starcraft 2 is a very fast-paced mechanically demanding game with many decision points, so it's not immediately obvious that applying game theory may be helpful. In addition, it may not always be possible to exactly enumerate all the different possible strategy combinations, the win percentages are not only player dependent, but map dependent. However, with all that said, I think game theory can still be applied in certain situations and provides a useful model when determining strategy. For example, if a certain map isn't amenable to a certain strategy, just ignore it for that map. For standard maps against opponents who you have a rough idea of your win percentage vs various build orders, the nash equilibrium can give you a rough idea of how you should choose your build order.