Skip to content

jedmijares/Watch-Me-Game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Watch Me Game

This is my submission for VandyHacks 2020! The theme is retro, so I figured I'd take my project all the way back to 1981. Watch Me Game is a bot that automatically plays Game & Watch Gallery, a retro collection of even more retro handheld electronic games. It's written in Python using PyBoy.

Running Project

If you want to try it out, you need to install PyBoy and acquire a Game & Watch Gallery ROM (can't help you with that one). Simply place the ROM in the directory specified in the script or pass the filepath as an argument.

Development Process

Step one was to figure out how to process data in the game. PyBoy comes with wrappers that facilitate this for a few games, but Game & Watch Gallery is unfortunately not one of them. So, I dug into the game myself to figure out how to pull out that info into my script.

Finding integer values like the current game score was simple enough - I used VBA-M's cheat engine to find the memory location where the values were held and was able to use PyBoy to read that data. Grabbing the position of various characters on the screen, however, was more troublesome. For a little while, I fumbled around trying to find another memory location storing the position of each character would be saved, but I didn't have any luck as I had no idea how that value might be represented.

Debug Interface

Thankfully, PyBoy offers some helpful debugging tools that let me proceed. By observing the sprite and tile data tables as I played the game myself, I could find the identifiers for each character's sprites and pass that through PyBoy to find the location of each character in real time.

Bots

The first bot I wrote was for Manhole. This one uses the sprite positions collected above to determine if a character is about to fall off the bridge, and positions the player to catch them if so. This one can play the game indefinitely.

The second one is for Fire. It operates very similarly, but this one usually only manages to score a few dozen points before losing the game.

Next Steps

Initially I was interested in developing neural nets to play some of the games in this collection, but I ended up deciding that was out of my purview for this weekend. If I revisit this project in the future I'll be reconsidering writing another bot implementing that for one of the more complex games.

About

Bot that autonomously plays Game & Watch Gallery

Topics

Resources

Stars

Watchers

Forks

Languages