1. ## "Poker" AI competition

Does anyone remember the Connect Four AI competition I held.. umm.. more than 5 years ago?

Connect Four: The Tournament Results

Anyway, I remembered that competition today and I thought it would be fun to hold another. This time the game is Poker... or a simplified version of it.

Rules
1. Each player is dealt a hand, which is a uniformly random real number between 0 and 1.
2. The highest number wins
3. The first player has to bet 1, which is the big blind.
4. The players then makes their decisions: check, fold or raise
5. When every player has either checked or folded, the player with the highest number takes the pot
6. Regular Hold'em rules apply for all-in
7. The data type of money is integer.

Code
To enter the contest, implement the following function:
Code:
```int make_bet(int my_id, float my_hand, const GameInfo&  game_info)
{
return INT_MAX; //Always all-in
}```
Where the struct GameInfo looks like this:
Code:
```struct GameInfo
{
int num_players;

int* money; //Chip count for each player (including myself)
bool* has_folded; //What players are still in play
int* has_bet; //What each player has betted
int curr_max_bet; //Current highest bet
};```
To check, the function make_bet must return (curr_max_bet - has_bet[my_id]). A smaller bet will be converted into a fold. A bet higher than money[my_id] will be converted to all-in.

You may use static variables to allocate lots of memory to keep track of your opponents previous moves. This page will probably be edited as people as questions etc.

Please write in this thread if you plan to enter, so that others know whether this is worth spending time on. The deadline for submissions is April 1st by PM.

2. My first impression of your game was "Oh, this is neat, he simplified poker so we can focus our AI on the betting". But with only one round of betting and no hand information, I don't really see it as poker. Meh, still interested, but I object a bit to calling it a "Poker" AI competition.

I have a question about the return value. You list "check, fold or raise" as the possibilities. Since there is only one round of betting and someone has to post a blind, the options would actually be "call, fold or raise".

You list

(has_betted[my_id] - curr_max_bet)

as the way to "check" (I'll assume you mean call). That would produce a negative number though unless you are the high better (such as when it gets back around to the big blind) in which case it would produce 0.

(curr_max_bet - has_betted[my_id])

sounds like what you probably meant, though it's late and perhaps I need to re-read?

"...const GameInfo& game_info)" so C++ only, right? And "has_betted" is awkward since "betted" isn't the proper past tense. Probably should be "has_bet".

Can we be guaranteed that num_players will remain constant throughout the entire run? If not then we can not keep track of other players reliably. If there are 6 players and player 1 is knocked out, then if num_players is reduced to 5 with player 1 being completely removed, all of our records become invalid.

How many players will be "at a table" at one time? I doubt all THAT many people are going to participate, so it's not like we'd end up with 140 AI players at the same table... but should we expect possibly more than 10 players to be "seated together"? Most I've ever played with is 11 at a table, though for Texas Hold'em it is theoretically possible to play with 22 players at a table (44 cards [22 players] + 1burn + 3 Flop + 1 burn + 1 Turn + 1 burn + 1 River), 23 if the dealer doesn't burn cards...

I like the simplicity of the design, but that simplicity also makes it impossible, from what I can tell, to get any information other than what players have bet and who won the hand. It's going to be more of a guessing game than anything.

3. Sounds good. I'm in.

4. Well, I tried.

5. Originally Posted by jdragyn
(has_betted[my_id] - curr_max_bet)

as the way to "check" (I'll assume you mean call). That would produce a negative number though unless you are the high better (such as when it gets back around to the big blind) in which case it would produce 0.

(curr_max_bet - has_betted[my_id])

sounds like what you probably meant, though it's late and perhaps I need to re-read?
You are right. It will corrected.

6. Will there be a test harness provided ahead of time?

7. I agree with jdragyn, using a float in stead of a real hand removes the interesting features of poker. It makes a lot of intelligent decisions completely worthless. Also, never knowing what the other players had makes it completely worthless.
Why not make a real poker AI? It's not that difficult to code the framework.

8. Since very little knowledge of poker is required here, can someone explain this part?

6) Regular Hold'em rules apply for all-in

9. Originally Posted by MK27
Since very little knowledge of poker is required here, can someone explain this part?

6) Regular Hold'em rules apply for all-in
I don't know what "regular" Hold'em rules are... but I'd imagine he's trying to say "No Limit" (even though in casinos a limit is more common).

That is to say at any point you can bet your entire stack of chips or up to whatever the second chip leader has in their stack (obviously you couldn't bet more than anyone else has)

I agree with the others, a simple Texas Hold'em simulation would not be that hard to write and it would make for a much more interesting competition.

10. A full simulation isn't necessary. I think this one is interesting enough.

A couple of questions:
1. Originally Posted by jdragyn
Can we be guaranteed that num_players will remain constant throughout the entire run?
2. What languages are acceptable?

11. >> Why not make a real poker AI? It's not that difficult to code the framework.
>> a simple Texas Hold'em simulation would not be that hard to write
Yes, it would be pretty difficult.

I'd love to try Texas Hold 'em if either of you want to write the simulator and start another contest, but I fear even the AI for the player would be too time consuming for this format.

The simplified version presented here provides the problem of how to bet. Adding in full hold 'em rules just adds the complexity of calculating odds to make a better hand, but with this version you still get to keep track of player tendencies and betting behavior.

>> Also, never knowing what the other players had makes it completely worthless.
I don't think it's worthless, but I do think providing information on who wins each round and all the values for all exposed hands would be beneficial.

12. Originally Posted by Daved
>> Why not make a real poker AI? It's not that difficult to code the framework.
>> a simple Texas Hold'em simulation would not be that hard to write
Yes, it would be pretty difficult.

I'd love to try Texas Hold 'em if either of you want to write the simulator and start another contest, but I fear even the AI for the player would be too time consuming for this format.

The simplified version presented here provides the problem of how to bet. Adding in full hold 'em rules just adds the complexity of calculating odds to make a better hand, but with this version you still get to keep track of player tendencies and betting behavior.

>> Also, never knowing what the other players had makes it completely worthless.
I don't think it's worthless, but I do think providing information on who wins each round and all the values for all exposed hands would be beneficial.
Well, the framework itself wouldn't be difficult. An actual AI might, as you may have to analyse the chances your hand will win, which is quite difficult. But you can have lesser AI's as well.
Why I think it's worthless that you don't get the other player's hands is that an AI might study the bet heights of the other players and compare them to how good the hand was. If this can ever be known, the AI would have to become more complicated.

Right now, all you have to do is calculate the chance your hand will win (hand_quality ^ (num_players - 1)), and simply study the bets of the other players to see if they are too high.
Really, you can't even figure out if you bluffed out an opponent or the opponent called but had a worse hand.

13. I agree that some additional knowledge of how the hand ends would be necessary, maybe Sang-drax can add that (remember that he asks for improvements and suggestions, this isn't set in stone).

At this point I'm the only one committed to playing, though. I doubt that he'll even bother if nobody else jumps in.

14. No you aren't the only one playing. I already sent sang-drax my file.

15. Oh, sorry. I didn't realize that's what your post meant.

I guess that means there's two of us.