This project is my attempt to make AI (Gemini, specifically) play pokemon, and maybe complete.
So I start with the aim of making Gemini play the game, or atleast specific parts of it. Based on the last benchmarks, it performed poorly , and it just spams AAAAA whenever it gets a chance (as we all Pokemon players do, right?) and nicknames it's starter AAAAAAAAA!?
Name the Pokemon AAAAAAAA
— Gemini, 2025
The current loop starts with optionally going through the intro sequence (specifically tailored for Pokemon Emerald, but maybe adapted to others), then on subsequent runs, advance the main menu, and then it enters the loop by
- Taking a screenshot
- Send it to Gemini
- Receiving a sequence of button presses and a description of what to do.
- Performing the presses with a short wait inbetween
- Waiting for a longer period
- Loop again
The program is currently tailored to my setup, and will (mostly) probably not function on your device.
- A Linux System
mgba-qt
installed and on$PATH
dotool
installed withdotoold
anddotoolc
on$PATH
- Pokemon Emerald ROM (legally obtained!) in the same directory as the script.
- Make sure pressing
F9
takes a screenshot inmgba
(it maybeFn
locked or something) - Your Google AI API key in the
.env
file - And yes, keymap for
mgba
, match with what is inhelpers.py
I may try to improve this in future. This is just an Experiment
Legal Disclaimer: Pokemon is a registered trademark of Nintendo/Game Freak Inc. This project is for educational purposes only. You must legally own a copy of the Pokemon game to obtain ROM files. Downloading ROMs for games you don't own is illegal in most jurisdictions. The authors of this project do not condone or promote piracy.