Skip to content
No description, website, or topics provided.
Python JavaScript Shell
Branch: master
Clone or download
Latest commit 1c6cd97 Dec 29, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
ai
data Add replay scraper Oct 1, 2019
docs Fixes and fixes Dec 29, 2019
lib Fixes and fixes Dec 29, 2019
scripts
thirdparty Imporvements to GameState and local simulator Oct 27, 2019
web Clean up Dec 25, 2019
.flake8 Clean up Dec 25, 2019
.gitignore Better replay functionality and normalizer partly implemented Dec 19, 2019
.gitmodules Clean up Dec 25, 2019
.readthedocs.yml RTD Dec 29, 2019
README.md Clean up Dec 25, 2019
build_dex.js Fixed Mac Compatability Nov 1, 2019
pokemon_ai.py Better replay functionality and normalizer partly implemented Dec 19, 2019
replay_scraper.py Lots and lots of improvements Oct 30, 2019
replay_watcher.py Lots and lots of improvements Oct 30, 2019
setup.py Lots and lots of improvements Oct 30, 2019

README.md

Pokemon-ai

This is a project that allows a more systematic approach to training Pokemon bots. Frankly, the code quality is rather shabby, but that is under constant improvement.

The framework was written in an effort to create our own ultimate bot. While that is currently under progress, when it is done the white paper will be available in this repository. Writing your own bots is pretty simple too, and we welcome any contributions or ideas.

Prerequisites

  • Python >3.6. While this may work with older version of Python, it is entirely untested.
  • Node.js. The local simulator uses the official showdown code, which is written in js.

Setup

  1. Make sure to get the Pokemon-Showdown submodule: git submodule update --init --recursive
  2. Build the Pokemon-Showdown module through npm i and npm build inside thirdparty/Pokemon-Showdown
  3. Build the pokemon-showdown-client module through npm run build full inside web/pokemon-showdown-client/
  4. Generate the local dex through node build_dex.js
  5. Install required python modules websocket, requests, and coloredlogs.

Project Architecture

Pokemon-Showdown does all of its communications through text streams, so we can use their code to run local simulations to run much, much faster self-play training while also easily maintaininj:g compatability with the official server.

Bot the Showdown and Local "adapters" load different bots based upon the arguments that are given, which are then dynamically loaded from the ai folder. Each file in the ai folder represents one implementation of a bot, and it should export one main function that either the local or showdown adapters will call.

The training of the bots are done externally to the core of the project structure, but the specific implementation is TBD.

Files

  • pokemon_ai.py this file handles all the simulations, both running locally and externally.
  • replay_scraper.py this file scrapes replay.pokemonshowdown.com for all the files for gen 1~7 randombattle and ou. Unfortunately, this method can only save replays that were manually saved and can only go back so far. This means that compared to the theoretical maximum, there is far less data available using this method.
  • replay_watcher.py this file is the better brother to replay_scraper. Instead of running periodically, it is run as a service, where it keeps watching through the showdown websocket protocol to look for new games. This means that this should theoretically manage to catch all games that are played in a certain timespan. The main limitation of this system is that it is more intensive than the scraper and also not yet implemented.
You can’t perform that action at this time.