Wednesday, June 15, 2011

frozen synapse and poker

This GDC talk is a fantastic overview of poker and what makes it so compelling. As I was playing Frozen Synapse, I saw a lot of those same elements at work. Frozen Synapse is largely a battle of imperfect, asymmetrical information. In poker, you know what your hand is, but you can only guess at what your opponents are holding. In FS, you know where your troop locations are, and what your next move is, but you can only guess where your enemy is and how they will act next turn.

As a result, a lot of Frozen Synapse strategy ends up being nearly-pure game theory. In a zero-sum game (where +1 for me means -1 for you; this sums to zero, hence “zero-sum”) game theory basically states each player will act optimally to minimize loss and maximize gain. Multiplayer FS relies on this principle heavily because both players are hidden from each other unless there is a direct line of sight, and moves are hidden from each other until they are executed simultaneously.

The best strategy is to:
1) figure out your best move,
2) figure out your opponent’s best move, and
3) compare the two positions and find the “equilibrium” - the state in which you are making the best possible moves, given your opponent’s best possible moves.

Here’s a heavily annotated video of one of my few multiplayer Frozen Synapse victories.

You can visualize it as a probability cloud surrounding each unit according to their maximum range in a move, colored according to the color of their owner (green for you, red for an enemy). A better position (such as behind cover, or with a long line-of-sight) will have a higher probability, which you can visualize as a darker color. A inferior position (next to a wall when a rocket unit has line of sight, out in the open when there are machine gun units in play) will have a lower probability of occupation, and thus a lighter color. You want to assume the enemy units will occupy the dark-red parts of our theoretical cloud, and you want to hold the dark-green parts of the cloud. Thus you will try to deny the enemy access to the dark-red sections while making sure your dark-green positions can’t be compromised. Again, this is similar to poker, where you share information about the community cards, and you try to visualize the likelihood of your opponents hand beating yours against the value of the pot. Instead of community cards, there is the level layout. Instead of the value of the pot, it’s the risk to your units.

The random placement of units and walls can sometime determine the outcome of a match before it starts.

There is also the issue of emotional control. Planning out two sets of optimal moves for four troops on each side, using that information to re-compute the optimal counters to optimal moves, and then double checking to make sure you’ve reached an equilibrium (minimizing losses and maximizing gains) can be long and difficult. If you’re losing, you might want to throw in the towel. If you’re frustrated (or drunk) the patience required to figure out the optimal move can seem beyond your abilities. In poker, as noted in the GDC talk, this is just called “tilt” - everyone can work out the probabilities and expected values of a hand. It only takes patience, which you might not have if you just lost a hand or have been drinking heavily.