Docs


Rocket Lander

A rocket falls with random drift. The GA evolves a thrust and gimbal program that lands it softly on the pad.

Last updated June 3, 2026

Go to the live page Open the Rocket Lander demo

The Rocket Lander demo asks the genetic algorithm to land a falling rocket softly on a pad. Each rocket spawns near the top of the canvas with a small random horizontal velocity, gravity pulls it down, and the GA has to find a program for two controls โ€” thrust and gimbal โ€” that turns the descent into a clean touchdown.

The problem

A rocket has a body, a nose, and an engine at the bottom. Thrust pushes the rocket along its current up axis; gimbal rotates the nozzle a few degrees off centre, which both pushes the rocket sideways and tips its nose. The two controls combine into all the steering the rocket has.

A landing is "clean" when the rocket touches the ground softly (downward speed under a small threshold), upright (tilt under forty-five degrees), and on the pad. Anything else is a crash and scores zero.

How a run looks

Click Start. Fifteen rockets fall through the same conditions at the same time. Generation zero is chaos: most rockets fire too hard and shoot back up, fire too little and slam into the ground, or tip over and skid in sideways. A generation ends when every rocket has either landed or crashed.

The platform then evolves the population. Four elites carry over unchanged. The other eleven children come from tournament-of-three winners with uniform crossover and small per-value random nudges. The next round arrives a moment later and a few rockets last a little longer.

Within a handful of generations one or two rockets start firing short controlled bursts near the pad. Within twenty or so, most of the population lands cleanly and the leader is centred on the pad.

The genome and the program

Each chromosome is sixteen real numbers in [0, 1]. They are eight evenly-spaced control points across the six-second descent window; each point has a thrust value (0 = off, 1 = full) and a gimbal value (0 = hard left, 0.5 = centred, 1 = hard right). The engine interpolates linearly between adjacent points.

Fitness

Crashes score zero. Clean landings score 1 / (1 + |vy| + 2 ร— |angle| + |x โˆ’ pad|) where each value is taken at touchdown. So slower, more upright, more centred landings score higher, with values getting close to one for textbook landings.

What the achievement rewards

The first time any rocket in the population lands cleanly, the Touched down achievement unlocks for signed-in users. That happens most often within five to fifteen generations once the GA gets going.

For more on how the demos catalog works, see What the demos do.

Thanks for the feedback!