Wednesday, July 20, 2016

Decision Making at the Poker Table: A Peek into the Brain of Poker-Fighter

Poker-Fighter is a fun Web-Game that allows you to play Risk-Free poker while getting immediate feedback on your decisions. It provides a great way for newbies to jump into the poker ocean and for experienced players to sharpen their skills and plug their poker leaks.


Poker Fighter Screenshot1



In this blog post I'll try to illustrate some of the techniques we used to transform the way great poker players analyze poker situations, into an artificial intelligent engine that provides useful poker advice. Stas Tishkevich (Stasia42) is my Co-Founder and the Poker Pro behind the game. He is also the owner of the Israeli Poker Academy, a first of its kind school for Poker enthusiasts.


Taking Decisions


So how decisions are made at a Poker table? When a player tries to decide if he wants to Check, Bet, Call, Fold or Raise, he needs to ask himself lots of questions:
  • What is the strength of my hand? Is it a made hand or a drawing hand?
  • How do my opponents perceive my hand strength as a result of my actions?
  • How do I assess the strength of the opponents? What range of hands can they potentially hold?
  • What level of thinking are my opponents at? Are they only thinking about their own hand, or are they good enough to think of what I'm holding too? 
  • How much money can I currently win or lose VS the specific opponent (Effective Stack Size).
  • What is the texture of the current board? Does it offer draws? 
  • Should I extract value from my hand now, or wait for later betting streets?
  • If I Raise the opponent's Bet, are there enough worse hands that can Call me?
  • And many many more....

Let's focus on Hand Strength on the Turn.

Poker Fighter Screenshot2


On the board in the picture, holding 3-5 would give us a Straight from A to 5. Even though a Straight is one of the best hands in poker, it is not invincible on this board. Any Flush beats us. I would say that holding 3-5 here is a Strong hand but not Very Strong. If the board would only have 2 diamonds instead of 3 diamonds, 3-5 would be the Nuts, and we would happily ship-it All-In. This would be a Very Strong hand. On the contrary, if the board would have 4 diamonds, any hand that holds one diamond is a Flush, which beats our Straight, and suddenly our Straight becomes a Weak hand. The point here is that the strength of the hand is not directly derived from the absolute rank of the hand, but it should be viewed as the following:

How many hand combinations are stronger than my hand?

The answer to this question is measurable, and that is something that can be translated to code in a software.

Let's translate more questions from earlier, to a language that a computer can understand:

1) How many hand combinations are weaker than my hand?  
2) What is the probability that my opponent holds one of them?
3) What is the probability that my opponent will Call my bet if he holds a worse hand?

These questions and others are what the "Brain" of Poker-Fighter asks himself in order to provide the correct advice in any given spot.

Poker Fighter Screenshot3


Board Groups


In the planning process of the decision trees for the Poker brain, we divided different board types to groups. The criteria include:

  • Connectedness - How connected are the cards on the board? This translates to the probability for holding Straights. It's much easier to hold a Straight on 5678 than on 468A.
  • Suitedness - How many cards of the same Suit exist on the board? This translates to the probability for holding Flushes. A board with 4 diamonds makes any hand with a single diamond a Flush. A rainbow board (4 different suits) doesn't allow any Flushes.
  • Card Uniqueness - How many cards of the same Rank exist on the board. 55KK is a completely different board than 26JA. Drawing to a Flush on a board with two pairs (55KK), will be very counterproductive, because there are only a few worse hands that will call your bets if you'll make your Flush. 
These criteria and others, translate into many branches of decision trees, that together build a single level of Poker-Fighter. 

I hope I've given you a little taste of the complex brain of Poker-Fighter.
In the future posts I'll touch more AI subjects like adapting to different player types and borderline spots. I will also talk about pure technical areas like software engineering of the game levels, techniques to save I/O, architectonic considerations for automatic scaling-out using Azure Services and much more.  


Guy Sela, 
Co-Founder and CTO @ Poker-Fighter


Guy Sela