Skip to content

cameronangliss/showdown-environment

Repository files navigation

showdown-environment

Description

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:

  1. Connecting to the Pokemon Showdown server to send challenges, choose moves in battle, etc (see showdown_environment/showdown/)
  2. 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/)
  3. 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.

Running example code

  1. Clone the repo.
  2. Open a Python virtual environment if necessary, and run pip install -r requirements.txt to install dependencies.
  3. Run pip install -e . to install the showdown_environment package contained in the repo.
  4. Run cp config_example.json config.json.
  5. Fill in config.json. Inspect code in example/ to see how config.json is used.
  6. Run python3 example/main.py to see the example code in action.

Update data stored in showdown_environment/data/json/

  1. Ensure you have node and npm installed.
  2. Run the following code:
    cd scripts
    npm i
    cd ..
    node scripts/update_data.js
    

About

Pokemon Showdown client API and environment for AI agents

Topics

Resources

License

Stars

Watchers

Forks

Languages