Creating a Table Map
Creating a Table Map is not a difficult process, once you get the hang of it, but it does have a steep learning curve. The benefit is that once you learn how to create maps, you can quite quickly take your bot to any casino on the Internet.
OpenScrape is the program that is used to create Table Maps. It provides a graphical interface to provide a set of parameters that are stored in human-readable text files with the .tm extension. Try it — open any .tm file in Notepad and you can quite clearly see the way the file is laid out. Each Table Map has a set of parameters, grouped by record type. The following sections will discuss how to use each of these record types to create your map.
// OpenScrape 5.0.1
// 2014-07-04 16:36:34
// 32 bits per pixel
z$clientsize 574 335
s$betsizeconfirmationmethod Click Bet
s$ttlimits ^*- ^L – blinds ^s/^b
s$ttlimits0 ^*- ^L – blinds ^s/^b – ante ^a
s$ttlimits1 ^*- ^L tourney – blinds ^s/^b – ante ^a
First things first: connect to the poker window
Start a casino, and open up a play money table. For the greatest part of building a table map you could even use “observer” mode if you like; only a few things like buttons will require a “real” account . Alternatively, once you learn how to use saved frames and OHReplay, you can also connect OpenScrape to these saved frames while offline from the casino.
For now, let’s keep it simple. Once you have a poker table setup, startup the OpenScrape program from the “c:\mpb” directory that you set up above. Arrange the casino table window and the OpenScrape windows on your screen in such a way that there is no overlap – OpenScrape needs a clear view of the poker table window to do its job.
Connect OpenScrape to the casino table by clicking on the Green Circle Button on the OpenScrape toolbar. A dialog with a list of top-level windows that are currently visible on your screen will appear. Select the one from the list that matches your casino table, and select OK. (Note, in this screenshot, we are connecting to a “ManualMode” window. You will learn more about ManualMode later in this document, but for now, just consider ManualMode to be a simulated, offline poker table).
A static image of the poker table window will be displayed in OpenScrape’s main window. Once OpenScrape has the poker table’s image displayed, you can minimize the poker table if you want, to give yourself more room to work. As the casino table changes state, and if you want to update the image that is displayed in the OpenScrape main window, you can do so at any time by clicking on the refresh button on the toolbar (Black and White arrows), or by choosing View/Refresh from the menu. When a refresh is requested, OpenScrape will bring the connected window to the front, grab the image, and then place it to the back again. Additionally, if you have OpenScrape connected to an OHReplay window, it automatically moves OHReplay to the next saved frame prior to grabbing the image.
Once we have the poker table image in OpenScrape, it is time to start building our Table Map, and providing the parameters that the OpenHoldem game state engine will use to “read” the poker table.
Familiarizing yourself with OpenScrape
When you started the OpenScrape program, two windows appeared. The “Main” window has the menu bar, the toolbar, and a display of the poker table image. The other window that appeared is the “TableMap Editor” window, and is where you will be doing most of your work with OpenScrape. The “TableMap Editor” window does not have a menu or toolbar, and has “TableMap” as its title.
The File menu contains the standard Windows options to open and save Table Map files.
The Edit menu contains the standard Windows options, plus two options specific to OpenScrape:
- Update Hashes: This option will recalculate all the Hash records in the current map – useful if you have made changes to the underlying images, for example. More on Hashes later.
- Duplicate Region: This option will allow you to easily duplicate Regions. For example, once you have the player 1 card locations defined, you might want to copy those to players 2-10 to make things easier on yourself. More on Regions later.
- Clone Regions: This option will clone all regions of player 0 at once and even distribute them to reasonable positions at the table. All you have to do afterwards is fine-tune the positions a little bit. Prerequisite: the balance-regions of the other players must be defined in order to be able to determine the positions for the cloned regions.
The View menu has following OpenScrape options:
- Connect To Window: This option duplicates the “Green Circle Button” on the toolbar, and will bring up a dialog to allow you to select which window OpenScrape will copy an image from.
- Previous Frame: if connected to OHReplay this option will switch to the previous replay-frame
- Refresh: This option duplicates the Black and White Arrow button on the toolbar, and will copy to current casino table image to the OpenScrape main window.
- Next Frame: if connected to OHReplay this option will switch to the next replay-frame
- Group Regions/Ungroup Regions: These options allow for customization of how Region records are displayed in the Table Map Editor window.
- Current size: Displays the client size of the window that OpenScrape is currently attached to. This is very useful when creating certain String records.
The toolbar on the main window performs the following actions, from left to right:
- New Table Map
- Open Table Map
- Save Table Map
- Connect to window
- Previous frame if connected to OHReplay
- Refresh the poker table image
- Next frame if connected to OHReplay
- Display Help/About
Keyboard shortcuts exist for many of these menu options and toolbar buttons, in addition to the standard Windows keyboard shortcuts:
- F1 – Help/About
- F3 – Connect to window
- F4 – Toggle Region box display on or off
- F5 – Refresh the poker table image
- Control + U – Update Hashes
Table Map: Buttons/fields. The Table Map Editor window has a plethora of information on it, and various fields and controls will become enabled or disabled, depending on the type of map record selected.
On the top left of the window are three buttons, New/Delete/Edit, that allow you to add new records to the map, remove records from the map, or edit records in the map. The “New” button will prompt you to add a record of the type that is selected in the tree display directly below. For example, if you have a Region record selected, clicking New will prompt you to add a new region record to the map. The “Delete” and “Edit” buttons operate on the currently selected record.
Directly below the New/Edit/Delete buttons is the record tree display. This box displays all records that are currently present in the map, and groups them by type. The Region records within this tree can be further sub-grouped using the View menu options on the main window. There are a number of choices for sub-grouping Region records, and are intended to improve the productivity of Table Map creation. Experimentation of these sub-groupings is necessary to see if any meet your personal needs.
Below the tree display is a drop down to select the zoom level of the image that is displayed in the big box on the bottom right portion of the window. The image displayed is dependent on the record type selected.
Below the Zoom Level are various drop downs that are used to serve as checklists for capturing fonts and card images. Capturing fonts and card images will be discussed later.
Creating and editing regions
On the top right of this window are a large group of controls, there is a “Rectangle” group, a “Nudge” group, and “Transform”, “Radius”, “Color”, “Avg Color” , and “Result” fields. These controls are used mainly for setting the parameters of Region records, and are only enabled when a Region record is selected in the record tree display on the left side of the window. The meaning of these fields will be described in the “Region” record section below. Some of these fields may display other relevant information, depending on the record type selected in the display tree. In addition to the arrow buttons a selected region can be moved and resized with hotkeys:
- arrow keys – move it around
- arrow keys + shift – moves it faster
- arrow keys + control – makes it bigger/smaller (can also use shift for faster)
Below this large group of controls are buttons to create Hash records, Font records and Image records. These buttons will be enabled/disabled appropriately depending on the record type that is selected in the display tree. For example, creating an Image record only makes sense if a Region record is selected in the display tree. Creating a Font record only make sense if a Region record with a text transform type is selected in the display tree.
The box below the Hash, Font and Image buttons is used to display “pixel separation”. The “+” and “-“ buttons to the right of this box control the size of the font used in this box. Pixel separation is used for regions that use font transforms. A good separation between foreground and background colors is imperative for good font recognition, and this box lets you preview that separation.