Game Lab · Neuroevolution

Dino Runner

Eighty baby dinos want to run through the desert. They have random brains, so they don't know to jump yet! Press Play.

How long they survived, generation by generation

Best dino (% of the 60 s run)Top half averageA challenge started

Checkpoints — the champion dino from each generation. Tap to watch it run today's desert.

How it works

Look ahead

Each dino feels 8 numbers: how close the next thing is, how tall, how high it floats, what comes after, how fast the game is, and its own jump.

A tiny brain

Those numbers go through a small brain with three answers: jump, duck or keep running. The biggest answer wins.

Furthest wins

When everyone has bumped into something, the dinos that ran furthest become parents.

Babies with tweaks

The next herd gets copies of the best brains, mixed together, with small random changes. Repeat!

What just happened?

For grown-ups: what's really going on

This is neuroevolution: a population of small neural networks improved by a genetic algorithm, with no gradients and no labels.

  • Network: fully connected [8 → 8 → 3] with tanh units (91 weights). Action = argmax of (jump, duck, run).
  • Inputs: closeness of the next obstacle (1 − distance/600 px), its top height, how high it floats, its width, how soon the following one comes, the game speed, the dino's height and vertical velocity.
  • Fitness: distance run. Every dino in a generation runs the same randomly generated course; a new course each generation stops them memorising one desert.
  • Genetic algorithm: the top 8% are kept unchanged (elitism); the rest are children of the top quarter (30% uniform crossover) with Gaussian mutation whose size is spread from small to large.
  • Measured in Node (80 dinos, champion's share of the 60 s run): the champion usually reaches 100% within 3–10 generations, occasionally 20+. Switching a challenge on at generation 30, the top-half average: heavy backpack 27–48% → 5–20% → back to 16–34% within ~20 generations; head-height birds 34–50% → 9–15% → 30–45%; cactus clumps 37–52% → 4–6% → 35–50%. Speed-up barely hurts, because faster running also clears wider gaps, and the page says so honestly.
  • Inspired by Chrome's offline "T-Rex runner" and classic NEAT/neuroevolution demos.