Poker-AI.org

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

All times are UTC




Post new topic Reply to topic  [ 17 posts ] 
Author Message
PostPosted: Sat Feb 22, 2014 3:43 pm 
Offline
Junior Member

Joined: Fri Nov 08, 2013 6:21 pm
Posts: 17
Hi all,
we are talking to an experienced programmer who will be working on the "stealthness" of our bot, he says the best way to go is with two machines + OCR etc., and in theory I totally agree with him, but he is very concerned about errors in reading numbers from the client via OCR (he says words won't be a problem as there are very few words in poker).

Before spending money on the programmer I would really like to know if an OCR with acceptable errors in number reading for poker is doable or not, in your opinion. Anyone got an OCR working and running no problem with a bot?

Ty!


Top
 Profile  
 
PostPosted: Sat Feb 22, 2014 5:26 pm 
Offline
Veteran Member

Joined: Mon Mar 04, 2013 9:40 pm
Posts: 269
It is easy. You may have to scale the image or convert to black and white before running thru the OCR engine to improve accuracy. Mine had issues with the number 5 thinking it was an S. I resolved this by checking to see if the string returned is numeric and if not by replacing any S's with fives or any other problamatic numbers.


Top
 Profile  
 
PostPosted: Sat Feb 22, 2014 5:47 pm 
Offline
Junior Member

Joined: Fri Nov 08, 2013 6:21 pm
Posts: 17
Hey Shalako, hello and ty again! :)

If I remember correctly you are mostly doing HU thou; do you think it would be no more difficult for 6max?
Also, do you think we should compile our OCR or could we go with Tesseract or similia?
Tyvm!


Top
 Profile  
 
PostPosted: Sat Feb 22, 2014 6:31 pm 
Offline
Veteran Member

Joined: Mon Mar 04, 2013 9:40 pm
Posts: 269
fisherking wrote:
Hey Shalako, hello and ty again! :)

If I remember correctly you are mostly doing HU thou; do you think it would be no more difficult for 6max?
Also, do you think we should compile our OCR or could we go with Tesseract or similia?
Tyvm!


Yeah I am mostly doing HU but I have a 9max NL and a 6max PLO bot that use the same OCR stuff. I use the Tesseract engine that was available as a plugin for my IDE and it is lightning fast. I do not know about other engines but I am sure compiling is always the better option.

At some sites the stack sizes are in the chat text so anytime you can utilize that vs OCR then do it. One thing you can always get from the chat text is the bet to call and potsize so you can save yourself some processing time by parsing text instead of OCR. The less screen shots you have to take the better obviously.

One trick to help you get more OCR accuracy is too clean the string of any odd random characters which seem to appear. Like here is my code dealing with the S problem and cleaning the text of anything but numbers:

Code:
    ocrtext = ocr.GetText
    //replace S with 5
    ocrtext = ocrtext.Replace("S","5")
    //clean all chars but numbers
    ocrtext = StrClean(ocrtext,"`~;:,!@#$%^&*()_-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ .’'")
    PotSize = Val(ocrtext)


Top
 Profile  
 
PostPosted: Sat Feb 22, 2014 9:17 pm 
Offline
Junior Member

Joined: Fri Nov 08, 2013 6:21 pm
Posts: 17
Oh, ty boy, karma + for you! :)

Btw this sounds as very good news for me, as the programmer says that once done the compiling of a decent OCR a very secure setup could be at hand. Hope we are not overlooking at other things...
as, e.g., mouse movements, which he is pretty confident won't be a big issue instead.


Top
 Profile  
 
PostPosted: Sun Feb 23, 2014 1:28 am 
Offline
Veteran Member

Joined: Mon Mar 04, 2013 9:40 pm
Posts: 269
Well all the stealth and mouse stuff is all easy compared to the AI. I remember you where going to perhaps do a combo of rules and simulations but not really sure. What method did you end up using?


Top
 Profile  
 
PostPosted: Sun Feb 23, 2014 10:41 am 
Offline
Junior Member

Joined: Fri Nov 08, 2013 6:21 pm
Posts: 17
You remember correctly, we are still working on a combo between Montecarlo and rule based. Not great results yet but we are still very confident in this approach, we need time thou as the Montecarlo guy is not working full time - he's got a family and a demanding career.
We are already setting up the interface thing because we wish to have it all ready when and if we get a decent AI.

P.s.: out of curiosity, what language is the one you are using for that code you posted? ty!


Top
 Profile  
 
PostPosted: Sun Feb 23, 2014 5:15 pm 
Offline
Veteran Member

Joined: Mon Mar 04, 2013 9:40 pm
Posts: 269
fisherking wrote:
You remember correctly, we are still working on a combo between Montecarlo and rule based. Not great results yet but we are still very confident in this approach, we need time thou as the Montecarlo guy is not working full time - he's got a family and a demanding career.
We are already setting up the interface thing because we wish to have it all ready when and if we get a decent AI.

P.s.: out of curiosity, what language is the one you are using for that code you posted? ty!


I use RealStudio which is known as Xojo now. It is a basic type language that is really easy to use. I have been using it since 1999 and have never seen the need to use anything else.

What part of the bots behavior are you using monte carlo on?


Top
 Profile  
 
PostPosted: Sun Feb 23, 2014 7:26 pm 
Offline
Junior Member

Joined: Fri Nov 08, 2013 6:21 pm
Posts: 17
shalako wrote:

What part of the bots behavior are you using monte carlo on?


We will be making a very slim rule based core for all the basics and then we will be leaving to the montecarlo all the rest, and then adjust accordingly to the results.
We are setting rules for the most basic parts of the strategy, starting obv from the preflop, e.g. how much $ to open from what position, what range etc. and what range to 3bet vs what opening range and things like this, that I consider almost "solved" on my part (as an experienced poker player).
So the Montecarlo part of the bot will be playing its role mostly on the postflop. But as I said we are still far from decent results, and we will still need months to finish the first part of the work. Also, consider that more than a developer I am the guy who is mostly putting the different brains together and doing the testing, so take my words on the different technical things "cum grano salis"! :)


Top
 Profile  
 
PostPosted: Tue Feb 25, 2014 3:30 pm 
Offline
Junior Member
User avatar

Joined: Tue Feb 25, 2014 3:19 pm
Posts: 23
My experience with 3d party OCRs was bad.
I trained Tesseract with the chat characters.
But at the end for the same input I got different results.

So I changed my idea and at the moment I use the chat reader: http://chatreader.x10.bz/

I realized that the OCR must be perfect reading the data.


Top
 Profile  
 
PostPosted: Tue Feb 25, 2014 4:31 pm 
Offline
Veteran Member

Joined: Mon Mar 04, 2013 9:40 pm
Posts: 269
yeah I can see how using OCR for the chat would fail quite often. Luckily there are other methods for getting that information. I only use OCR for stacks and pot sizes so it has never been a real problem. I had a situation come up the other day in which I needed to know the name of a player in the pot that was not in the chat text and OCR failed miserably. I still am not sure what I am going to do about it.


Top
 Profile  
 
PostPosted: Tue Feb 25, 2014 9:26 pm 
Offline
Junior Member
User avatar

Joined: Tue Feb 25, 2014 3:19 pm
Posts: 23
shalako wrote:
yeah I can see how using OCR for the chat would fail quite often. Luckily there are other methods for getting that information. I only use OCR for stacks and pot sizes so it has never been a real problem. I had a situation come up the other day in which I needed to know the name of a player in the pot that was not in the chat text and OCR failed miserably. I still am not sure what I am going to do about it.


I don't know what poker room are you using and I don't perfectly understand your problem, but the only situation where I think there are players on the table (pot), but not in the chat, is when they are sit out or they are not playing the hand. If a player is not playing then you don't need to read his information from the table. I suppose.

Please tell me more.


Top
 Profile  
 
PostPosted: Wed Feb 26, 2014 2:16 am 
Offline
Veteran Member

Joined: Mon Mar 04, 2013 9:40 pm
Posts: 269
I have never had a problem on PS. This problem was on a specific game on FTP in which I could not tell who the player was on the button in a 4 handed game if the bot was on the CO. So I tried to OCR the player name but the accuracy was terrible.


Top
 Profile  
 
PostPosted: Thu Mar 06, 2014 8:19 pm 
Offline
Veteran Member

Joined: Wed Mar 20, 2013 1:43 am
Posts: 267
It's relativelly easy on stars. It doesn't scale linearilly, there are only 7 font-size levels. You can just use training pics of every size, clean them up, then get a screenshot, clean it up the same way and you will get the exact same characters every time. No need for fancy machine learning techniques or anything, just look for a character, where every single pixel matches.


Top
 Profile  
 
PostPosted: Fri Mar 07, 2014 2:29 pm 
Offline
New Member

Joined: Fri Feb 21, 2014 2:13 pm
Posts: 6
I don't think there's any need to take screenshots.
Check out the gx/fonts folder. Besides that check the gx.ini files. (default + the one of your theme).

I haven't written anything concrete for it yet, but I think that is the easiest as there is no noise.


Top
 Profile  
 
PostPosted: Tue Mar 11, 2014 11:08 am 
Offline
Veteran Member

Joined: Wed Mar 20, 2013 1:43 am
Posts: 267
There is no real noise in screenshots, it's just the way the font gets rendered, but it's deterministic. The training image screenshots will look 100% like the screenshots you take, while using the software. You can get 100% accuracy.


Top
 Profile  
 
PostPosted: Sun Mar 16, 2014 3:54 am 
Offline
Junior Member
User avatar

Joined: Sun Mar 16, 2014 3:36 am
Posts: 36
Location: Germany
I wrote a bot for PS, 888, Neo, Satre and Poker Academy Pro OCR based using U_MinDst (Minimum-Distance-Cluster) with SparBot strength.
Any Questions, send me PM.

Tom


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 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:
Powered by phpBB® Forum Software © phpBB Group