Poker-AI.org

Poker AI and Botting Discussion Forum
It is currently Mon Nov 13, 2023 6:35 pm

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Sun Jul 20, 2014 7:19 pm 
Offline
New Member

Joined: Tue Jul 08, 2014 11:37 pm
Posts: 4
Hi everybody,

This is my first post here. I have been working on a bot recently and I am able to parse the board for all the hole cards and community cards, the dealer button, and the stack sizes for all the players at the table.

I'd like to be able to take a screenshot of the window every once in a while (possibly on my turn - but then can't observe after I fold) and be able to update the action sequences for the hand using the stack sizes and deduction. Is this how you all did it, or is there and easier way? I realize that I could just take a screenshot every second or so that way the actions are always up to date, but then would it be possible to manage multiple tables at the same time? I'm afraid I might miss a step.


Top
 Profile  
 
PostPosted: Mon Jul 21, 2014 9:06 am 
Offline
Junior Member
User avatar

Joined: Tue Feb 25, 2014 3:19 pm
Posts: 23
golfguy37 wrote:
Hi everybody,

This is my first post here. I have been working on a bot recently and I am able to parse the board for all the hole cards and community cards, the dealer button, and the stack sizes for all the players at the table.

I'd like to be able to take a screenshot of the window every once in a while (possibly on my turn - but then can't observe after I fold) and be able to update the action sequences for the hand using the stack sizes and deduction. Is this how you all did it, or is there and easier way? I realize that I could just take a screenshot every second or so that way the actions are always up to date, but then would it be possible to manage multiple tables at the same time? I'm afraid I might miss a step.


Welcome, I think you are in the good way.

The first step is getting the table information and you already have it.

After that there are people who only use the information on their turn (with one screenshot is enough for them). I mean they get the actual information when the player has to decide what to do.
On the other hand there are people who use all the information that they can get, taking screenshots constantly. By this way they have more information about the table.

Which method you have to use depends on your AI and what information it needs.

To manage multiple tables at the same time you can use multithreading. You only have to execute your code in parallel for every table with one thread.


Top
 Profile  
 
PostPosted: Mon Jul 21, 2014 4:32 pm 
Offline
Veteran Member

Joined: Mon Mar 04, 2013 9:40 pm
Posts: 269
Yeah..I would just take the screenshot when its your turn to act. If you need observed info/data then just retrieve the HH file and parse it after that game is over or extract it from the game chat.

As far as multiple tables your are going to have to run threads as mentioned above or use an array in a thread which is what I do. I have two threads..one that runs the games and one that looks/opens new games. I suppose if your taking one big screenshot per table then running multiple threads is the answer. I am only taking a 1x1 pixel screenshot to look for active fold buttons so its overhead is very little. I can make a decision in about second so running in one thread works for me. Depending on how fast your computer is you might be able to do it this way as well.


Top
 Profile  
 
PostPosted: Wed Jul 23, 2014 2:06 am 
Offline
New Member

Joined: Tue Jul 08, 2014 11:37 pm
Posts: 4
Thanks for the replies I like the idea of taking 1 pixel screenshots I may have to try that.

For the threads, however, is it really possible to implement a thread per table scheme? I mean only one thread can control the mouse at a time so there would be some synchronization problems. I think I will manually manage the tables in a sequential manner. I may utilize my other cores for running computations though.

shaloko,

Do you parse and deduce the entire action sequence for the hand on your turn? Or do you just determine core information such as amount to call?

Also,
Do you guys persist all the hands that you play to a db or do you just throw them out after each hand and get them later from another source? If so what is the source?


Top
 Profile  
 
PostPosted: Wed Jul 23, 2014 2:48 am 
Offline
Veteran Member

Joined: Mon Mar 04, 2013 9:40 pm
Posts: 269
Quote:
Thanks for the replies I like the idea of taking 1 pixel screenshots I may have to try that.


Yeah its much quicker for things like that. You can also use for the button, number of players etc.

Quote:
For the threads, however, is it really possible to implement a thread per table scheme? I mean only one thread can control the mouse at a time so there would be some synchronization problems. I think I will manually manage the tables in a sequential manner. I may utilize my other cores for running computations though.


Use a "semaphore" when doing anything mouse or keyboard related so that only one thread can control those functions at a time.

shaloko,

Quote:
Do you parse and deduce the entire action sequence for the hand on your turn? Or do you just determine core information such as amount to call?


Not quite sure what you mean here.

Quote:
Also,
Do you guys persist all the hands that you play to a db or do you just throw them out after each hand and get them later from another source? If so what is the source?


Yeah your gonna want to have a db either by creating your own or using something like PokerTracker. Not only are you gonna need them for player modeling but also for finding leaks in your AI. I would also use any showdown information that you get after each game is over.


Top
 Profile  
 
PostPosted: Thu Jul 24, 2014 3:13 am 
Offline
New Member

Joined: Tue Jul 08, 2014 11:37 pm
Posts: 4
Quote:
Not quite sure what you mean here.


Nevermind I think I see what you meant. Basically if I fold out of the hand, I shouldn't keep parsing the board, but instead wait for the hand to end and then go fetch the hand history file. Is that right?

Quote:
Use a "semaphore" when doing anything mouse or keyboard related so that only one thread can control those functions at a time.


Thanks for the tip I wasn't aware that there was such a thing but it will definitely do the job.


Top
 Profile  
 
PostPosted: Thu Jul 24, 2014 5:43 am 
Offline
Veteran Member

Joined: Mon Mar 04, 2013 9:40 pm
Posts: 269
Quote:
Nevermind I think I see what you meant. Basically if I fold out of the hand, I shouldn't keep parsing the board, but instead wait for the hand to end and then go fetch the hand history file. Is that right?


Yes..that is right..just get any info you need from the HH file after that game is over or from the chat text.

Quote:
Thanks for the tip I wasn't aware that there was such a thing but it will definitely do the job.


sure..its hard to do anything with threads without them.


Top
 Profile  
 
PostPosted: Sat Jul 26, 2014 4:55 pm 
Offline
Veteran Member

Joined: Wed Mar 20, 2013 1:43 am
Posts: 267
Yes I did it like that. I only use the pot, stacks and the bets in front of the players, when it's my turn.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 5 guests


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:
cron
Powered by phpBB® Forum Software © phpBB Group