This project trains an AI to play Slime Volleyball using Reinforcement Learning (PPO) and Self-Play. The training happens in the background, and you can watch the agents evolve in real-time via a web interface.
- Install the dependencies:
pip install -r requirements.txt
-
Start the server:
python server.py
-
Open your browser and navigate to:
http://localhost:5000 -
The training will start automatically when you connect.
- Training Phase: The server trains the agent for a set number of steps (default 10,000).
- Demonstration Phase: The server pauses training and runs a full match between the current agent and the previous best version (Opponent).
- The cycle repeats, and the "Generation" counter increases.
If you just want to watch the most recent trained model without launching a new training session, start the server with the --demo-only flag (or set SLIME_DEMO_ONLY=1). The server will load the latest slime_gen_*.zip checkpoint it finds and continuously stream matches using that policy:
python server.py --demo-onlyserver.py: Flask application and Training Loop.slime_env.py: Custom Gymnasium Environment with Slime Volleyball physics.templates/index.html: Frontend visualization using HTML5 Canvas and Socket.IO.