Weird bet behavior

16 views
Skip to first unread message

Bruno Mendes

unread,
Feb 20, 2011, 9:48:03 PM2/20/11
to opent...@googlegroups.com
I might be wrong, but I recall reading that in No Limit texas hold'em if a player has already raised, let's say $5, then if you want to raise again you must do it with at least another $5 or more.

While testing a few possibilities here I got this log:
"Player turn!
Agt 2 (Human/Player) bets $0,04
Agt 1 (FuzzyBot/SimpleBluffBot) raises $0,02
Amnt to call: 0.02
Current bet size: 0.04"

So my bot was able to raise half of my bet in a no limit texas holdem game.

After that I decided to test the 'minimum bet', which was supposed to be the value of the bigblind.
Maybe another missing validation, because I was able to raise 0,01 in a game with BB of 0,02.

--
Atenciosamente,

Bruno Mendes

10º período em Engenharia da Computação
Escola Superior de Tecnologia
Universidade do Estado do Amazonas
(92) 91269828
(92) 36570670

Felipe Kurkowski

unread,
Feb 20, 2011, 10:49:22 PM2/20/11
to opent...@googlegroups.com
You are right. This is a bug in the correctPlayerErrors method
inside PublicGameInfo.java. I fixed it myself for own usage and
forgot to send the patch. Navigate to the method and swap the
equivalent case label with the code below:

case Action.BET:
case Action.RAISE:
    if (getAmountToCall(s) <= 0.0) {
        return Action.betAction(affordableBet(act.getAmount(), player));
    } else {
       // deal with anyone who is all in when trying to call
       if (getAmountToCall(s) > player.getBankRoll()) {
           return Action.callAction(player.getBankRoll());
      }

      double toAdd = 0;
      if (act.getAmount() < minRaise) {
          toAdd = minRaise - act.getAmount();
      }

      // check we can afford to raise everything
      if ((act.getAmount() + act.getToCall()) > player.getBankRoll()) {
          Double raise = affordableBet((act.getAmount() + act.getToCall() + toAdd), player) - act.getToCall();
  return Action.raiseAction(getAmountToCall(s), raise);
      }

      return Action.raiseAction(getAmountToCall(s), act.getAmount() + toAdd);
}

Bruno Mendes

unread,
Feb 20, 2011, 11:06:22 PM2/20/11
to opent...@googlegroups.com
Thanks for the quick reply Felipe,

Still has few bugs, ass can be seen through this commented log:

Game Started!
Stage Event 0!
Agt 2 (Human/Player) posts small blind $0,01
Agt 1 (FuzzyBot/SimpleBluffBot) posts big blind $0,02
Deal Hole Cards event!
Player turn!
Agt 2 (Human/Player) raises $0,02 (corrected value from 0,01 to 0,02 -> big blind size)
Agt 1 (FuzzyBot/SimpleBluffBot) raises $0,02
Player turn!
Agt 2 (Human/Player) raises $0,02 (corrected value from 0,01 to 0,02 -> big blind size)
Agt 1 (FuzzyBot/SimpleBluffBot) raises $0,02
Player turn!
Agt 2 (Human/Player) raises $0,02 (corrected value from 0,01 to 0,02 -> big blind size)
Agt 1 (FuzzyBot/SimpleBluffBot) calls $0,02 
Stage Event 1!
Player turn!
Agt 2 (Human/Player) bets $0,01 (bug)
Agt 1 (FuzzyBot/SimpleBluffBot) calls $0,01 
Stage Event 2!
Player turn!
Agt 2 (Human/Player) bets $0,01 (bug)
Agt 1 (FuzzyBot/SimpleBluffBot) raises $0,04
Player turn!
Agt 2 (Human/Player) raises $0,04 (corrected value from 0,01 to 0,04 - previous bet amount)
Agt 1 (FuzzyBot/SimpleBluffBot) raises $0,04
Player turn!
Agt 2 (Human/Player) raises $0,04 (corrected value from 0,01 to 0,04 - previous bet amount)
Agt 1 (FuzzyBot/SimpleBluffBot) folds

I'm still quite lost in the project code so I wasn't able to find where to fix this issue myself, but tommorrow I'll give it another try.

2011/2/20 Felipe Kurkowski <felipek...@gmail.com>

Felipe Kurkowski

unread,
Feb 21, 2011, 12:11:51 AM2/21/11
to opent...@googlegroups.com
Hmm, it turned out to be an error in my code. It was only verifying
the minRaise amount in raise situations. Fix below.

case Action.BET:
case Action.RAISE:

    double toAdd = 0;
    if (act.getAmount() < minRaise) {
        toAdd = minRaise - act.getAmount();
    }

    if (getAmountToCall(s) <= 0.0) {
        return Action.betAction(affordableBet(act.getAmount()+toAdd, player));
    } else {
        // deal with anyone who is all in when trying to call
if (getAmountToCall(s) > player.getBankRoll()) {
   return Action.callAction(player.getBankRoll());
}

bluegaspode

unread,
Feb 21, 2011, 2:52:10 AM2/21/11
to opent...@googlegroups.com
Hi Felipe and Bruno,

I'm happy to apply the patch, when a testcase is provided.
Have a look at DealerTest.testBigBlindRaise as a good start. If you
manipulate some values there then the playerLog tested in the last
line should still show the correct/adjusted amounts.

Remember that if your Bot does not respect 'gameInfo.getMinRaise' when
choosing its own bet-sizes it might get into trouble later if you use
it in any nonvalidating environment.

Cheers
Stefan

bluegaspode

unread,
Feb 21, 2011, 2:53:44 AM2/21/11
to opent...@googlegroups.com
Oh and of course I'm also happy when one provides other simple Bots to
test against.
'SimpleBluffBot' I already like just based on it's name :)

Bruno Mendes

unread,
Feb 21, 2011, 9:38:22 AM2/21/11
to opent...@googlegroups.com
Hi Stefan,

Happy to hear that, but it is actually a dummy bot that only cares about his opponent and not his own cards, but turned out to be too random in my opinion.
Basically there is a Fuzzy Inference System, FIS, (a very very very simple one), which takes as input the player stack size and the 'bluff factor', the later is a variable that tries to model 'the bluff history against the opponent', a number from 0.0 to 1.0. So each time the opponent folds after a raise the bluff factor goes up - increasing the chances of the bot bluffing again -, otherwise it goes down - decreasing the chances of the bot bluffing again - in a linear manner. My motivation for using a FIS instead of normal programming is because it is easy to build a non-linear and more-realistic output funcitons. The output of the FIS is a crisp value between 0 to 100, which represents the bot 'bluffability' for that turn.
Then I generate a random number from 0 to 100 and test it against the output of the FIS (simple percentage simulation), if it passes (generated > output) the bot bluffs, else it either check/call (for really small amounts) or folds (for bigger bets).
No interesting results from him yet, it was just my 'proof of concept', I needed to build my own bot. When I feel comfortable with it I'll try to release it as an example bot.

2011/2/21 bluegaspode <blueg...@googlemail.com>
Reply all
Reply to author
Forward
0 new messages