Successor from meloetta, hence porygon 2
Porygon2 provides:
- A UNIX server written in Node.js wrapped around the
sim
andclient
packages from pkmn. - A reinforcement learning framework for interacting with this server. Currently supports R-NaD from DeepMind.
Porygon2 is a platform that simulates Pokémon battles and provides an environment for training reinforcement learning agents. It leverages the pkmn
library for accurate game mechanics and offers a server-client architecture to facilitate interactions between agents and the simulation environment.
To set up the project, you can use the provided setup.sh
script, which automates the installation process.
- Python 3 installed on your system.
- Node.js and npm installed for running the server components.
- Clone the Repository
git clone https://github.com/yourusername/porygon2.git
cd porygon2
- Run the Setup Script
Make sure the setup.sh
script is executable:
chmod +x setup.sh
Then run the script:
./setup.sh
This script will:
- Create a Python virtual environment in the
venv
directory. - Install all Python dependencies from
requirements.txt
files located in the root directory and immediate subdirectories, excluding any directories namedenv
. - Install all Node.js dependencies by running
npm install
in directories (one layer deep) containing apackage.json
file, excluding any directories namedenv
ornode_modules
.
- Activate the Python Virtual Environment
After running the script, your Python virtual environment is activated. If you open a new terminal session, reactivate it using:
source venv/bin/activate
- Navigate to the Server Directory
cd service
- Install Dependencies
npm install
- Run Tests (Optional)
npm run test
- Start the Training Server
npm run start
Open a new terminal and navigate to the root directory of the repository.
- Activate the Virtual Environment
source venv/bin/activate
- Run the Training Client
python ml/rl.py
- Activate the Virtual Environment
source venv/bin/activate
- Start the Inference Server
python inference/server.py
- Navigate to the Server Directory
cd server
- Install Dependencies
npm install
- Start the Evaluation Client
npm run start-evaluation-client
The scripts/
directory contains helper scripts for various tasks:
compile_protos.sh
: Compiles protocol buffer definitions.generate_requirements.sh
: Generatesrequirements.txt
files.lint.sh
: Runs code linters to ensure code quality.make_data.sh
: Generates necessary data for the project.
- Directory Structure: The project contains several subdirectories with their own
npm
installs. Thesetup.sh
script handles these installations automatically. - Python Virtual Environment: A virtual environment named
env
is created in the root directory. Always activate it before running Python scripts.
- License: This project is licensed under the MIT License.