Reinforcement learning can be difficult to inspect when training is reduced to a stream of numbers. SlimeAI takes a more direct approach: it trains a Slime Volleyball agent with PPO and self-play while streaming matches to a browser.
The visualisation does not replace evaluation, but it makes the policy’s behaviour available for inspection while the training process continues in the background.
A loop with an observable phase
When a browser connects, the server starts training automatically. Each cycle has two documented phases: a training phase for a configured number of steps—10,000 by default—and a demonstration phase.
During the demonstration, training pauses and the current agent plays a full match against the previous best version used as its opponent. The cycle then repeats and the generation counter advances. This gives each block of training a visible checkpoint rather than leaving the process entirely opaque.
Keeping responsibilities separate
The repository divides the system into three compact parts:
server.pycontains the Flask application and training loop.slime_env.pydefines a custom Gymnasium environment with Slime Volleyball physics.templates/index.htmlrenders the frontend with HTML5 Canvas and Socket.IO.
These boundaries connect learning, simulation, and presentation without requiring the browser to own the training process. The environment produces the game state, the server coordinates training and communication, and the frontend turns streamed matches into something observable.
Separating training from replay
SlimeAI also provides a demo-only mode. Started with --demo-only or SLIME_DEMO_ONLY=1, the
server finds the latest slime_gen_*.zip checkpoint and continuously streams matches using that
policy.
This mode separates watching a saved agent from launching a new training session. It is useful whenever inspection is the goal and changing the policy is not.
What the visualisation can—and cannot—show
A live match can reveal behaviour that is difficult to understand from a scalar alone: movement, timing, and interaction with an opponent. The previous-best opponent and generation counter also provide a consistent frame for watching the training cycle.
Visual inspection is not a claim of improved performance. It is an additional engineering surface—one that makes the agent easier to examine while keeping the PPO and self-play loop intact.