Game Lab · Self-play neuroevolution

Sumo Bots

Two little sumo robots, one round ring. Push the other one out to win! You go first: drive the green bot with the arrow keys or the joystick.

Drag the joystick the way you want to go. Let go to stop. On a laptop the arrow keys work too.

You
0
vs
Gen 1 rookie
0

How good is the champion? Generation by generation

Champion's win rate (%, each generation's best robot plays 12 test bouts against each opponent, averaged over 3 generations)

vs the first 3 championsvs Charging Chuck (a robot that never learns)A challenge startedOld champion's score right when it hit

Checkpoints — champions saved along the way. Tap one to watch it wrestle today's champion.

How it works

Twelve senses

Each robot feels where its rival is (ahead? to the left? how close?), how much room both have before the edge, where the middle of the ring is, how fast it is sliding, where the rival is aiming, and if the rival is heavier.

A tiny brain

Those 12 numbers flow through 8 thinking neurons to 2 answers: drive forward or back, and turn left or right. At first all its connections are random, so it wobbles about.

Practise on each other

40 robots each wrestle 16 bouts every generation: some against teammates, some against old champions. Nobody shows them how. That's called self-play.

Score the bouts

A quick push-out scores most. Lasting longer before losing scores a little. If time runs out, being nearer the middle scores a bit.

Copy with changes

The best wrestlers have babies: copies of their brains with small random changes. Over generations the team invents pushing, circling and dodging at the edge.

What just happened?

For grown-ups: what's really going on

This is neuroevolution with competitive self-play and a hall of fame. A population of 40 feed-forward networks [12 → 8 → 2] (tanh, 122 weights each) is improved by a genetic algorithm. No gradients and no labelled examples are used.

  • Physics: 2D, 30 steps per simulated second, ring radius 1. Each bot has a heading θ, velocity v and mass m. Each step: θ += 0.09·turn, v = (v + a·thr·u(θ))·(1 − drag), x += v. Overlapping bots are separated in inverse proportion to mass and exchange an impulse j = −(1+e)·vrel·n / (1/ma + 1/mb). Normal ring: a = 0.0036, drag = 0.08, e = 0.15. Icy: a = 0.0013 (less grip), drag = 0.022 (keeps sliding), e = 0.5. Small ring: radius 0.72. Heavy opponent: m = 2, radius ×1.3, 85% power.
  • Shrinking ring: after 35% of the 11 s bout the radius shrinks linearly to 30%. Without it, evolved bots learned to circle in the middle until time ran out. A bot is out when its centre leaves the ring. Time-up is judged by distance from the centre.
  • Inputs (12), in the bot's own frame: distance to rival, rival's bearing (cos, sin), own and rival's radial room to the edge, bearing to the ring centre (2), forward and sideways speed, where the rival's nose points relative to me (2), and the mass ratio. Egocentric inputs mean one policy works from any start angle.
  • Outputs (2): throttle and turn rate, both in [−1, 1].
  • Fitness: per bout, ring-out win 1 + 0.5·(1 − t/T), ring-out loss −1 + 0.3·t/T, time-up ±(0.15 + margin) + 0.5·(mean radial advantage). Summed over 16 bouts on shared random starts (the same starts for every brain in a generation): 8 against hall-of-fame champions (always including the newest, plus random older ones, even the very first) and 8 against random teammates. Starts are mirror images, so two identical brains always draw.
  • Champion choice: fitness from 16 bouts is still noisy, so the top 4 play an extra 24-bout final against six hall-of-fame members. The winner joins the hall of fame (first 3 kept forever, up to 40 stored).
  • Genetic algorithm: 3 elites copied unchanged; the rest are children of the top quarter (rank-biased choice, 30% uniform crossover), each weight mutated with probability 0.3 by Gaussian noise of size σ·U(0.25, 2), σ = 0.3 by default (the slider).
  • The chart: the champion's win rate (draws count half) over 12 fixed start positions against the first three champions, and against a scripted policy ("Charging Chuck": steer at the rival, full throttle, retreat when near the edge). Chuck never trains, so he is an outside exam rather than a training partner.
  • Measured in Node (seeded runs, 30 generations, roughly 0.1–0.2 s per generation): the final champion beat the generation-1 champion in 83–100% of 12 mirrored test bouts (3 seeds), and the exam score (mean of the two chart lines) rose from 25–75% at generation 1 to 87–98% averaged over generations 21–30. Against random brains even the generation-1 champion wins over 90%, because random brains usually drive out on their own. Win rate against Chuck is not monotone: self-play can drift into strategies that beat teammates but not an outside opponent (non-transitive "rock-paper-scissors" cycles), a known weakness that the hall of fame only partly fixes. After each challenge, the three-generation average of the exam got back to 70% or more within 3–7 generations in our runs.
  • Real research: self-play is how TD-Gammon learned backgammon and AlphaZero learned chess and Go. Simulated sumo was also a classic multi-agent RL benchmark. Big systems use policy-gradient methods (PPO) and keep a large league of past opponents for the same reason as our hall of fame.