About the Poker AI
Heads Up: Hold'em has a custom made Artificial Intelligence (AI). Since it is only playing against one person (you) and not trying to simulate a table full of other characters, we've been able to optomize it to play well, and try and take your chips as best it can.
About the AI Personalities
They're all different. Some are more likely to bluff, different ones will bet bigger or smaller, some slow play a great hand more often. But you'll have to play and see which does what!
The AIs names and their chip protectors are inspired from the names of people in our poker group and from our family.
"Poker Pete" The designer & inspiration for this iPhone app.
Pete sent lots of advanced poker concepts to Mike who boiled it down to things like "if X and Y, odds to bet are doubled"
"Maniac Mike" The programmer
of this iPhone app.
And probably the best simulation of the player's style. Bet big or go home...and I usually go home.
Now that Peter Photoshop-ed that chip protector, I have to try and find something like that :)
"Luckbox Larry" He's the one actual
professional poker player.
"Decent Dan" Good player and photographer (if you're in the Seattle area).
"Grandma Sue" One for mom--not a poker player, but she's a Grandma and she can show this off on her iPhone.
"Beginner Bec" For Mike's wife.
Does the AI player cheat or peek at the cards?
NO! ABSOLUTELY NOT! That wouldn't be any fun from either a playing or programming standpoint. It's been a lot of fun making a poker AI that is now quite a lot better player than I am. (Though I'm a better player than when I started working too!)
How does the AI player work?
The computer runs many simulated hands based on the 'known' cards (its own cards plus board cards) to determine a baseline strength of his own hand. It then adjusts the baseline hand strength using many factors such as board texture, player aggression, and betting patterns. There is also a large degree of weighted randomization to make the AI player more difficult to 'read.' It knows how to buff, slow-play, continuation bet, protect its hand, recognize draw-heavy (scary) boards, recognize the player's betting tendencies, and more...
Each of the different personalities weights these differently to give a good variation in play styles.
The Beginner is the one exception. It started as a test opponent for the regular AI, and was included since it is good beginner play. It's so simple, the source code is included at the bottom of this page.
Sometimes the AI player makes horrible plays!
Don't we all? Failed bluff attempts can look very foolish. Over-valuing medium-strength hands can also look very foolish sometimes. Every poker player has done this, and so does the computer ones.
If you notice any ways you're able to consistently read or take advantage of the AI, let us know so we can keep improving!
Beginner AI Code
This is for the programmers and the curious.
//-------------------------------------------------------------------
//Returns -1 to fold, 0 to call, or # to raise/bet that amount.
//-------------------------------------------------------------------
- (NSInteger)actionIfBeginnerToCall:(NSInteger)toCall pot:(NSInteger)pot minRaise:(NSInteger)minRaise round:(NSInteger)round turn:(NSInteger)turn myStack:(NSInteger)myStack theirStack:(NSInteger)theirStack {
float handStrengthPct = realHandStrengthPct; //calculated when cards dealt.
[self setChanceBetSmall:40 medium:30 big:20 huge:5];
//First actions preflop
if (round==1 && turn<=2) {
//Nearly out, just go all in always to end the game or double-up.
if (myStack<bigBlind*3) return myStack;
//Always bet if a pair or an ace.
if ((h1%13)==(h2%13) || h1%13==0 || h2%13==0) {
[self setChanceBetSmall:10 medium:30 big:40 huge:5];
return [self betWithMinRaise:minRaise pot:pot myStack:myStack theirStack:theirStack];
}
}
//Decent hand, raises 1/2 the time.
if (handStrengthPct>0.70 && rand()%2==0) return [self betWithMinRaise:minRaise pot:pot myStack:myStack theirStack:theirStack];
//Randomly call or raise, ignoring hand strength.
if (rand()%20==0) return 0;
if (rand()%20==0) return [self betWithMinRaise:minRaise pot:pot myStack:myStack theirStack:theirStack];
//Call or fold depending on hand strength.
if (toCall>0 && handStrengthPct>0.5) return 0;
//Fold if not strong, but never fold the small blind
if (toCall>smallBlind && handStrengthPct<0.5) return -1;
return 0;
}




