Thanks for the reply, shalako.
shalako wrote:
I use option 1 and it works pretty well. If you want more tables just buy more monitors which are cheap enough these days.
As I'm running inside a VM, the number of monitors does not really matters. I can make the VM screen bigger, and have more tables, but the problem with that is that the VirtualBox API is too slow taking snapshots (1600x1280 takes ~400ms). But maybe 6 is a good number and that is feasible with tiled windows.
How many tables your bot play on? What is a "safe" number? If it is ok to have 8-10 tables opened, I'd go with the second approach....
shalako wrote:
Also..you mentioned having one AI and one scrapper associated with each table. I would go with one bot for all the tables as its way more efficient. I use an array in a separate thread with a semaphore whenever a decision is being made. I have to use a semaphore due to possible mouse/keyboard command conflict with the table hopper which runs in another thread. This setup can handle any number of tables unless your doing some serious number crunching although a newer computer can solve that problem.
I use one instance of the Scraper for each table because I can have tables with different layout open (ex: 6max vs HU). Also the scraper keeps the state of the game (bankrolls, actions, etc..) so it can correctly map it to a GameInfo object (from Meerkat API). For the AIs I also have one instance per table. That allows me to have different AI for each kind of game and each situation.
It is not inefficient. Each Scraper and each AI have its own thread. My architecture is based on
Actors for Scrapers,AIs,Hoppers, etc... and
Dataflows to send mouse/kbd commands to the VM. It's similar to what you're doing with semaphores, but at a higher level of abstraction.