Rush Poker Support Possible Update

[too long; didn’t read version: I’m experimenting with screen scraping to add a full HUD to Rush Poker. So far the experiment is going well. But it is tricky to get right so I’ll make “beta” Poker Copilot builds with this experimental Rush Poker support available soon.]

The current Rush Poker support in Poker Copilot is not great. As far as I know, no Mac OS X poker tracking software has good Rush Poker support. I spent much time over recent months mulling over what I could do to improve things.

The conclusion I came to over and over is that the best possibility is screen scraping the Rush Poker window to determine the player names. But I was fearful of this approach – for performance, accuracy, and maintainability reasons. Optical character recognition (OCR) – the art of a computer extracting text from an image – is notoriously unreliable. The ramifications of a player called phil_ivey being misread as phil_ive_no_idea – and therefore the wrong HUD stats being shown – could be very expensive.

My aim is 100% reliability. And fast at that.

Intractable problems become tractable when you add constraints. So I decided to see what I could achieve with the following constraints:

  1. 9-player tables only
  2. a specific window size (1440*874, corresponding to a maximised window on my MacBook Pro)
  3. classic layout

This gives me a known font to work with: Arial, 20 point. That, unfortunately is a problem. In Arial, lower-case L and upper-case i are rendered identically. Meaning that 100% success is impossible. However some tricks can make the success rate extremely close to 100% . More on that later.

Some analysis of the all the Full Tilt player names I have in my million+ hands of test data reveal the following:

  1. Player names start with [A-Z], [a-z], [0-9], dash (‘-‘) and underscore (‘_’)
  2. Subsequent letters have the same range and can additionally be a space character

That’s a total range of 65 characters.

I found this extremely useful pokerai.org forum thread on screen scraping. I read every post and made notes. Then I spent a day coding up a trial solution. Then I read through the forum again, this time understanding things better. Then I modified the solution.

I had a program that grabbed a screenshot once per second, extracted the parts of the images that contain the player names, and converted them to text with a success rate of about 70%. The problems were the l (small L)/I (big i) problem, and ligatures. I added some tweaks to handle ligatures and the success rate seems 100%, except l (small L)/I (big i).

It was a fun challenge. In the process I learnt about OCR techniques, computer typography, and re-learnt a rather rare computer data structure called Tries.

I’m going to keep working at this, trying for a more general solution that handles 6-max and 9-max tables at a range of window sizes and with different layouts. In the process I’ll make “beta” Poker Copilot builds available.

The l (small L)/I (big i) problem

In Arial 20 point small L is indistinguishable from big i. You’ve probably sometimes misread a player’s name because of this. Here’s how I get around the problem:

  1. Convert all small L’s to big I’s in the scraped text
  2. Keep a list of all players seen in the current session as read from the hand history files. This list will include the correct names and the names with small L’s replaced with big I’s
  3. Match each scraped name against the list of current session players to determine the correct name

If you are playing in the same session against “Al” (al) and “AI” (ai) this won’t work. But I’m going to accept this rare situation because I think the chances of this happening are exceedingly small. In the case that is does happen, no HUD will be shown. I think this is better than