The data gathering and the poker player

This is the second article about the Poker Bot

Gathering the poker data

Eric and I started working with the two most interesting parts at this moment. Gathering the data and setting up a poker playing algoritm. After a lot of research on the poker networks we decided to go with Partypoker for primarily two reasons. We thought we could build a functioning data gathering unit for Party without to much trouble and there are lots and lots of players on Partypoker which would make it easier for the bot to stay under the radar.

The problem with gathering the data is that the client doesn’t really hand it out in any comprehensible way (for a computer that is, it is fairly easy for a person to read the output). What we needed to do was getting the information from the screen and into our bot. This is not really hard if you know how to do but it can be a bit slow if you do it badly. In online poker though it is not a problem because the need for speed is very limited compared to a first person shooter for example.

We have previously built a bot for a first person shooter and the first step there was of a similar type. We wanted the gun to automaticly fire at the exact time it was aiming at an enemy. It was a shotgun so it had a very big punch but a long reload time this is why you couldn’t afford to miss. What we did then was check the pixel where the gun was always aiming 50 times a second. Every time it changed color enough the gun would fire. Simple and effective it worked like a clock. In the poker bot though we needed something else, speed wasn’t really the thing but it needed to gather the images and understand them.

Getting the images was relatively easy, we chose to get them from the graphic memory. This is a very common method and I’m not going to discuss it much more then this. What you do is you make your bot read the graphics memory on your graphics card and look for the “screen” before it is published on your screen. Getting a snapshot out of there is rather simple and we decided to do 4 of those every second (you really don’t need that many but we wanted to be completely safe in case something was missed, it can happen sometimes that parts of the screen don’t get drawn).

What we needed out of the pictures was the numbers. We needed to know how much was in the pot, how much everyone bet, what our position was and most important what cards there were. For the digits and cards it was pretty easy. We got screenshots of all possible cards and digits and just let the bot compare them. Well, it was easy in theory but it took us a long while. One thing that made it a lot easier was when we turned on 4 colors for the cards. Can’t imagine we didn’t do it directly. The problem with this approach is that it is easy for the poker room to change their locations and look of the digits but we agreed that it was eqaully simple for us to update the pattern recognition then.

Playing the cards, the first steps

Getting started with the poker player part of the bot was harder, this is after all te unique part of the poker bot. The data gathering was all stuff that we had done in previous ventures. What we decided to do first was setting when to play a starting hand. We decided that it should always play KQ suited and better and then randomly play hands down to QJ off. We set a decreasing possibility for the bot to play the hands the lower they got with only 10% chance that the bot would play QJ off. This might seem like a stupid way of doing it and that we should consider position instead but it is a decent method and it looks more like an ordinary amateur if someone decides to snoop and it’s extremely easy to code and we felt that doing progress until we had a functioning beta was the most important.

When I say that we decided what hands the bot would play I’m a bit generous with the word play because even if the bot decided to play he didn’t know how to make bets yet. One of the ideas we had in the beginning was that it should play sit’n’go-tournaments. This might seem a bit weird but I’ll explain it later. For this reason we wanted the bot to be aggressive. We did it the easy way just as with deciding if it was going to bet. Here is an example, Preflop, with a hand the bot chose to play it will bet like this:

No previous raise:

  • 50% call
  • 20% raise with 3 times big blind
  • 20% raise with 2 times big blind
  • 10% raise with one big blind

With a previous raise:

  • 30% Fold ( we decided to do this choice here rather than in the do i bet algo)
  • 30% call
  • 30% all in (does it seem weird? It will get clear later on when you see the bot more clearly)
  • 10% Raise with as much as the previous player had raised.

Next article in the series: Post Flop – hell for bots

Deciding what to do post flop is dangerous grounds for a bot, this is where most of the better players beat the worse. IF you win the game after the flop only luck can save the worse player on turn and river. The thing with the bot is that we don’t build it to be a good player, we are building a surviving player and that is something totally different.

Continue reading…

1 Comment »

  1. Ron said

    Would really appreciate if you could explain just a little more how you read the screen from the video card, plz. I am making a bot for the game Warhammer, and would like to know how to get the screen without having to do a classic screen shot.


RSS feed for comments on this post · TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: