![bookworm deluxe bookworm deluxe](https://v1cdn.destructoid.com/BWA2_screenshot_12-620x.jpg)
Now that the game board is known (or close enough, anyway), I needed to find the words.
#Bookworm deluxe software
Hats off to any "real" OCR software - mine was working in more or less optimal starting point (ignoring the particles and such, of course). Another times, one glyph pretty much completely covers another, such as with M and V, or B and E. If you were to load up the glyphs in photoshop, you'd be surprised how few pixels differ between some of the glyphs, such as O, C, G. This process is not, by any means, perfect, but it performs well enough.
![bookworm deluxe bookworm deluxe](https://www.forestofgames.org/wp-content/uploads/2021/05/1-16.jpg)
The glyph with the highest score is selected. Finally, the glyph score is divided by the number of dark pixels the glyph is expected to have. When matching the glyphs, first the tile is scanned for "dark" pixels, and if the dark pixel matches the glyph's dark pixels, the glyph gets a point if it doesn't, the glyph loses a point. Looking at what the bot sees, the tiles which are the most difficult to figure out are actually the tiles that are about to become fire tiles, due to all of the particle system activity. This let me get mostly legible glyphs out of even the brightest and most particle system-filled tiles. The final iteration first runs the screen capture through a preprocess where the pixel values are first multiplied by themselves four times to crank up contrast, and then pixels are considered "dark" if their value is less than 1/6 of the brightest pixel of the tile. However, due to all of the particle systems, glow effects, shaking tiles, floating scores, etc, it was far from perfect. Later on, I extracted the actual glyph data from my screen shots, loaded them up in the bot and started comparing the dark pixels directly. This didn't work horribly well, but let me get started with the other parts of the bot. My first stab at the OCR was to take a few pixel values from each letter, and ran the game until it didn't detect several letters (by painstakingly comparing the two glyphs and adding another detected pixel). To begin, I took a few screen shots and got the exact glyphs the game used. OCR is the hardest and the least working part of the bot. That done, I needed to get the state of the board. This I did simply by looking at the values of a couple of pixels on the screen this pixel has this value only when in the main menu that pixel has this value when asking to start a new game or continue previous one that pixel has this value when in-game. Now that the bot can see the game and click on it, I needed to know which state the game was in. I'm fully aware I could have made the bot more robust and not get into such situations but this was good enough solution, and those out-of-control bot situations ended up being rather rare.
#Bookworm deluxe Pc
Eventually I ended up setting up another administrator account on my PC so I can control-alt-del and switch users and then kill the bot from the other account. I experimented with detecting keyboard presses to kill the bot, but with the focus on the game this is rather tricky. There's a danger in doing controls this way, namely, while your bot is in control, there's fairly little you can do to stop it. Mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0) Mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0) GetWindowPlacement(bookwormwin,&bookwormwinpos)
![bookworm deluxe bookworm deluxe](http://speed-new.com/wp-content/uploads/2015/05/353425341.jpg)
To position the clicks properly, I needed to query the window's position. Sending clicks to the game was done via mouse_event (which is deprecated, but works, and is likely to be simpler than the currently-official method). Easy peasy.īookwormwin = FindWindowA(NULL, "BookWorm Deluxe 1.13") īitBlt(pDC,0,0,WIDTH,HEIGHT,bookwormdc,0,0,SRCCOPY) To get the pixels from the game's window, I asked window to give me the window handle, got the device context for the window and after that I could simply bitblt the bits over to my bitmap.
#Bookworm deluxe windows
This gave me a win32 app with a windows bitmap I could poke directly. I started from the template in my ancient win32 tutorial (after fixing a few things that don't work anymore, mostly casting variables and resolving between A vs W versions of functions). These were pretty easy to solve, assuming you have experience with win32 programming.
#Bookworm deluxe how to
Input and Outputįirst problem to solve was how to get the image from the game and how to send mouse clicks back in. The rest of this article is relatively techical, so if that's not your thing, you can stop now. As a video is worth about 21.6 million words, see for yourself: I wrote a bot that plays PopCap's Bookworm Deluxe. Bookworm Deluxe Aimbot Or, cheating in a single-player game for a little fun and no profit whatsoever.