ericgjackson / slumbot2019

Implementations of CFR for solving a variety of Holdem-like poker games
MIT License
137 stars 30 forks source link

Slumbot bet size too small #29

Closed matthewkennedy5 closed 1 year ago

matthewkennedy5 commented 1 year ago

Hi Eric,

I'm testing my bot against Slumbot using the API script, and getting errors like:

Error parsing action b200b1250c/kb750b18650b18750: Bet too small
{'old_action': 'b200b1250c/', 'action': 'b200b1250c/kb750', 'client_pos': 0, 'hole_cards': ['Ad', 'Jc'], 'board': ['8h', '4d', '2s']}
Action: b200b1250c/kb750
Client hole cards: ['Ad', 'Jc']
Board: ['8h', '4d', '2s']
Sending incremental action: b18650
-----------------
{'old_action': 'b200b1250c/kb750', 'action': 'b200b1250c/kb750b18650b18750', 'client_pos': 0, 'hole_cards': ['Ad', 'Jc'], 'board': ['8h', '4d', '2s']}
Action: b200b1250c/kb750b18650b18750
Client hole cards: ['Ad', 'Jc']
Board: ['8h', '4d', '2s']

So in this case, my bot made a bet of 18650, and slumbot responded with a bet size of 18750, which should be illegal. It seems to be happening with bet sizes near the all-in amount. I'm probably misunderstanding something here, but just wanted to double check.

Also, is there documentation of the action string format? Does client_pos = 0 mean that my bot is the dealer?

Thanks!

ericgjackson commented 1 year ago

client_pos = 0 means your bot is the big blind. (In heads-up, the small blind = the button = the dealer.) Sorry, that ought to be documented somewhere. And yeah, the action string format is not well documented, but should be.

Ah, there's a bug in the API script. This line (around line 170 of the file):

remaining = STACK_SIZE - street_last_bet_to

should be:

remaining = STACK_SIZE - total_last_bet_to

Slumbot's bet of 18750 is actually a legal bet because it is all-in. The bet sizes on the flop are the money put into the pot on the flop. In other words, Slumbot starts with 20,000 chips, already put 1,250 in preflop, so a bet of 18,750 on the flop is all-in.

ericgjackson commented 1 year ago

Just fixed that bug in sample_api.py and added a little more documentation of the protocol in the comments at the top.

matthewkennedy5 commented 1 year ago

Thanks! Makes sense