Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Environment is requesting player moves when there's only one player who is not all-in #15

Open
BigBadBurrow opened this issue Feb 11, 2019 · 2 comments

Comments

@BigBadBurrow
Copy link

BigBadBurrow commented Feb 11, 2019

I found a problem if all but one players are all-in, i.e. only one player has stack available. The environment continues to ask the player that isn't all-in for a move, which can then mean the agent can (needlessly) continue to raise against players who obviously wouldn't be able to call (so it creates a sidepot with only that player in), as you can see here:

    players:
    0 [  ],[  ] stack: 0
    1 [2�[31m♥�[0m],[8�[31m♦�[0m] stack: 0
    2 [J�[31m♦�[0m],[7�[31m♥�[0m] stack: 28665
    3 [  ],[  ] stack: 0
    Getting move from agent for player 1 (Agent: 2)
    Player 1 Move: [0,0]
    total pot: 11335
    last action by player 1:
    �[37m_ check�[0m
    community:
    - [9♣],[4�[31m♦�[0m],[A♣],[J�[31m♥�[0m],[  ]
    players:
    0 [  ],[  ] stack: 0
    1 [2�[31m♥�[0m],[8�[31m♦�[0m] stack: 0
    2 [J�[31m♦�[0m],[7�[31m♥�[0m] stack: 28665
    3 [  ],[  ] stack: 0
    Getting move from agent for player 2 (Agent: 3)
    Minimum raise: 25  As percentage is : 0.0008721437292865864
    Player 2 Move: [2,2867]
    Player 2 ('raise', 2867)
    total pot: 14202

Here you can see player1 checked because it's all-in, but the environment continued to ask player2 for a move, who then raised against a player who was already all-in, which obviously doesn't make sense. In fact, in this case it then repeated this again when the last community card was dealt.

In env.py there's this line:

if not self._current_player.playedthisround and len([p for p in players if not p.isallin]) >= 1:

Initially I though the >= should be changed to > 1 but there'd be a problem if player1 had raised and gone all-in, and then due to the above code change it wouldn't have asked Player2 for a move as there's now only one player that's not all-in.

I could of course program my agent to check if all other players are all-in and if so then disable the ability to raise, but I think the environment should handle this better. I'm just not sure how...

@VinQbator
Copy link

Can you test if you have similar issue with the https://github.com/VinQbator/holdem fork?

@VinQbator
Copy link

Should be fixed in my fork now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants