This is a Python client-side API for interacting with the Pokemon Showdown website. It also contains an environment to train AI agents.
This repository essentially handles 3 major obstacles in using Pokemon Showdown to train AI agents:
- Connecting to the Pokemon Showdown server to send challenges, choose moves in battle, etc (see
showdown_environment/showdown/) - Interpreting the protocol and request messages from Pokemon Showdown into turn-by-turn state objects, which AI agents can use to make informed decisions (see
showdown_environment/state/) - Collecting the Pokedex, Movedex, Itemdex, Abilitydex, and Typedex from Pokemon Showdown, which can be used to interpret elements of the state objects (see
showdown_environment/data/)
Please feel free to use/modify the code for your specific needs.
**Disclaimer: Functionality has only been tested in Ubuntu 20.04.
- Clone the repo.
- Open a Python virtual environment if necessary, and run
pip install -r requirements.txtto install dependencies. - Run
pip install -e .to install theshowdown_environmentpackage contained in the repo. - Run
cp config_example.json config.json. - Fill in
config.json. Inspect code inexample/to see howconfig.jsonis used. - Run
python3 example/main.pyto see the example code in action.
Update data stored in showdown_environment/data/json/
- Ensure you have
nodeandnpminstalled. - Run the following code:
cd scripts npm i cd .. node scripts/update_data.js