Poker AI and Botting Discussion Forum
It is currently Sun Jul 05, 2020 7:14 pm

All times are UTC

Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Sat Sep 08, 2018 3:55 pm 
Junior Member

Joined: Thu Apr 05, 2018 2:57 pm
Posts: 23

I am currently working on a function that interprets the scraping info. In particular a link between player bet amounts and to what poker situation that corresponds.


Hero on the button and raises 3BB. Villain in big blind and 3bets to 6BB. Hero 4bets to 12bb ..villain goes to 25bb.

my scraper extracts this:

bets[hero] = 12bb
bets[villain] = 25bb

But how do you distinguish from the following situation: villain on the button, and raises 3BB, villain 3bets 9BB:

bets[hero] = 3bb
bets[villain] = 9bb

Apart from the amounts ofcourse. Guess what im asking is: How do you distinguish vs3bet and vs5bet situatuion.

Only thing i can come up with is based on amounts. If the raise of the button is large enough, its probably a 4bet and not the first in raise. But thats not exact. In theory the opening raiser could raise 12bb on the B and the BB could 3bet 25bb. Highly unlikely. But possible.

Other solution, would be, to build a model gradually. Instead of doing it in one pass. So first when heros first info.when we get 3bet..we add some info. Come to think of it..this is probably the way to go :lol:

Do you agree? Sorry for the complete RANT :P

PostPosted: Sun Sep 09, 2018 9:22 pm 
Senior Member
User avatar

Joined: Sun Mar 10, 2013 10:31 am
Posts: 137
Tre is many reasons to go your 2nd way. Not only impossibility of recognize some hands in one screenshoot.
Can describe my current system... but it is wery huge :) I am not sure of my English for this :)
Lets try.
1st. You need structure called class TableInfo
class TableInfo{
   void Clear();
   int table_size;
   double scale;

   std::string Stacks[9];
   std::string Nicks[9];
   std::string Bets[9];
   bool Dealers[9];
   bool Closed_cards[9];
   card_t Open_cards[2][9];
   card_t Table_cards[5];
   std::string pot;
   std::string tournament_info;
   bool Buttons[3];
   std::string window_name;
   int table_pos_x;
   int table_pos_y;
   cv::Rect ButtonRects[3];
   std::string ToString();

You write there all things you recognize from the table
2nd. class BotManager
it have some member functions
-void StartFrame(); you need to say him that new screenshoot appears; //I`ll say why you nedd to do it later
-void AddTableInfo(TableInfo* ti);
(you must know that there is more than 1 table at the screen)
You need to release your logic here.
For example If I not see buttons (not my move) I can remember table position and nicks. In frame when my buttons appear previous player or two nicks are FOLD or CALL
Then when your bot manager decide that he know all hand correctly and there is time to get it to your bot - most interesting things begin :)
He must see in SET OF QUESTIONS, may be he asked it before.
If there is no this question he must put this question in QUEUE
Thats all.
You need also DEMON in other thread. It gets question from queue (if exist) and ask your bot for the answer. It may take long time! For my bot it about 0.5sec now it is enougf for comfort play 6 tables. Sure you want not to freese your aplication for 0.5sec or more! (every second :) )
Sorry for bad english (

ps. in StartFrame() you need to delete wery old questions from the SET. for example 20+ sec old. And may some other old stuff of your bot manager

PostPosted: Mon Sep 10, 2018 10:53 am 
Senior Member

Joined: Fri Nov 25, 2016 10:42 pm
Posts: 122
You need to take into consideration all screenshots of table from the beginning of the hand and conclude what is the villain action.
E.g. the first time you see a raise, it is RFI or iso raise (iso raise if there is any limp). So you remember that action. If you see after that frame another raise it has to be a 3bet. you remember last action as 3bet. if you see another raise, it is 4bet and so on.
It is not possible to conclude actions from a single screenshot.

PostPosted: Mon Sep 10, 2018 5:51 pm 
Junior Member

Joined: Thu Apr 05, 2018 2:57 pm
Posts: 23
Thanks guys!

Got one question. Why do you need a Queue?

they way i have implemented: (at the poker client computer, i stack all tables..and let the poker client popup a table whenever an action is required. just like a normal poker player would do)

array [] tableinfo;


1. take screenshot
2. if action needed (buttons appear) goto 3, else goto 1:
3. analyze screenshot. (+record table number)
4 tableinfo[tablenumber] now stores the hand info. if this an ongoing hand -> add to model. otherwise start new model for this hand.
5. ask bot what to do for tableinfo[tablenumber]
6. do it

PostPosted: Tue Sep 11, 2018 6:05 am 
Senior Member
User avatar

Joined: Sun Mar 10, 2013 10:31 am
Posts: 137
It is too long if tables appear one by one.
And in my room there is no pokerhand number.
Lets see on timings.
Table appear = 0s.
Screenshoots do by the timer? lets say 0.5s. So 0.5s gone already.
Then you need to recognize screenshoot = 0.1s
Then ask your bot what to do. How long it will be?
If your bot rule based ok, it will work. It is fast enought.
But my simple bot takes 0.5s to make decizion.
+ may be pings (I do my bot on another computer)
So for me playing 6 tables hyperturbo is to slow without queue.
Also if I not make my move in current screenshot - it will aks what to do again? and again...

ps. What your program do while your bot is thinking? Just freeze? May be it rip already and you need to restart it? You dont know.
And there was many bugs fist time (at least I have), so program was die often :)
But as I say if your bot is wery fast - you need not all this stuff.

PostPosted: Tue Sep 11, 2018 9:44 am 
Junior Member

Joined: Thu Apr 05, 2018 2:57 pm
Posts: 23

1. my AI is rule based. So i think its fast enough. My previous bot (long time ago) could run 8 tables pretty comfortably this way. bot plays a lot of the decisions will be preflop (which are extremely fast).

2. My room also does not have a poker hand number. But you do really need that? I just scrape the tableNumber. Thats enough. Unless you want to make use of tracker database ofcourse.

3. yeah my program waits for the bot to reply. I dont think thats bad. My prev bot ran 2 years (before getting busted :lol: ). Just make sure
the bot part never crashes :D After a long period of debugging..i nearly never had a crash anymore.

I just completed the action model!


1. New hand? Init action model: add all actions from utg till Hero. Bot does hero action, add this action to model
2. Ongoing hand? Update model: Adding all player actions from hero+1 up to hero. Bot does hero action. Add this action to model.

Now its time to implement preflop strategy 8-)

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group