How PingPON learns

Genetic Algorithm

A genetic algorithm mimics natural selection. Instead of writing rules for the paddle, we create a population of random neural networks and let them compete.

Over many generations the population learns to track the ball and anticipate bounces.

Neural Network

Each paddle controller is a feed-forward network. The right-paddle AI receives five inputs:

The inputs flow through a hidden layer and produce one output: the direction and speed the paddle should move.

Lab, Arena, and AI vs AI

The Lab trains the population, shows the live network, and plots fitness over time. The Arena lets you play against the best saved brain. AI vs AI lets two copies of the best brain compete, with the left side using mirrored inputs.

Sessions and Exports

Your current generation and best network are saved in the browser. You can also export the best brain as a JSON file and import it into the Arena on another device.