Docs


Orbital Voyager

Steer a spacecraft to four deep-space beacons through a four-body gravity field using a fresh genetic algorithm at every decision point.

Last updated October 26, 2026

Go to the live page Open the Orbital Voyager demo

The Orbital Voyager demo runs a closed-loop genetic algorithm on a small solar system. A spacecraft launches from a procedurally placed pad and has to visit four beacons (you can set anywhere from one to eight) scattered across deep space, dodging the sun, four orbiting planets, an asteroid belt, and the edge of the map. The trick is that the GA does not plan the whole flight at once. Every 0.1 simulated years by default, a fresh GA decides only the next burn.

This is the same idea used in NASA's mission control rooms when a planned trajectory drifts off plan: replan from where you actually are, not from where the original plan said you would be. The earlier version of this demo tried to evolve a single twenty-gene plan for the whole six-year flight. It almost never collected more than one or two beacons because a four-body gravity field is chaotic and a fixed plan cannot react to where the rocket has actually ended up. The reactive version finds the same gravitational slingshot trick that lets Voyager 1 and 2 tour the outer planets, but it discovers it one short look-ahead at a time.

The Problem

A small solar system: one sun at the origin, four planets in circular orbits at 0.8, 1.5, 2.8 and 4.5 astronomical units (AU), and an asteroid belt of twelve rocks sharing one circular orbit at 2.15 AU, between the second and third planets. The rocks are evenly spaced around the belt and move at the orbital speed for that distance. They are too small to pull on the spacecraft, but hitting one ends the mission. To reach the outer beacons the craft has to thread the gaps between them. The spacecraft starts on a launch pad about one astronomical unit out from the sun, somewhere in the gap between the inner two planets. The exact position is reshuffled by the session seed.

The beacons are placed fresh from the session seed on every Reset. Each one sits on its own ring between planet orbits (and never inside the asteroid belt), the first closest to the sun and each extra beacon farther out, and they are spread around the sun in different directions. The Beacons to Collect slider sets how many there are, from 1 to 8 (default 4). A beacon is visited if the spacecraft passes within 0.08 AU at any point. Visit order does not matter, and the mission ends as soon as every beacon has been visited.

Hazards end the mission immediately, and each one is as big as it looks: the crash size of every body is the size it is drawn. The sun has a radius of 0.28 AU; the planets have radii of 0.10, 0.13, 0.19 and 0.15 AU from the inside out; each asteroid has a radius of 0.09 AU. The spacecraft has a size too: it is drawn 0.7 AU long at its true size, and the whole body counts, so if the drawn rocket touches a drawn body, that is a crash, even when its centre point would have missed. Touching any of them ends the mission (a sun crash, a planet crash, or "Hit an asteroid"). On a small screen the sun, planets, rocks and the rocket are drawn at least a few pixels wide so you can always see them, which can make them look a little bigger than they really are. Past 8 AU from the sun, the spacecraft is lost in deep space. If a mission does crash, a burst marks the spot. The mission also ends when the Mission Clock runs out (20 simulated years by default) or when the fuel runs dry after launch.

How a Run Looks

Click Start. The rocket waits on the launch pad while the first genetic algorithm runs to choose a launch burn. Each round of this launch search stays on screen for about a second, so you can watch it: the first rounds are usually full of red crashes, and the later ones find a safe way out. Trails fan out from the craft, showing trajectories the GA is considering. Faint blue ones are candidates that stay safe over their look-ahead, and the one highlighted in gold is the current best. Red ones are candidates whose look-ahead ends in a crash, with an X where they would hit the sun, a planet or an asteroid. Each round shows the best few safe paths and up to ten crashed ones. Early rounds usually show several red paths; as the generations improve they mostly disappear. This is evolution at work: bad burns are tried, scored poorly and thrown away before the spacecraft ever flies them. The key under the canvas explains every symbol on the map.

On a wide screen, a mission panel on the left of the canvas shows which beacons are done, gauges for fuel, the mission clock, the distance to the sun and the distance to the edge of the map, and a Burn Plan section. The Burn Plan shows the planning round with a progress bar and how many of its 30 candidates crashed (for example "Round 2 of 8: 5 of 30 crashed"), how many candidate burns the last decision was picked from, what that burn was forecast to do, for example "passes 0.42 AU from β" or "reaches beacon γ", and a running "Lost so far" count of every crashed candidate in this mission. On a phone there is no room for the panel, so the readout under the canvas shows the beacons, the distance to the next one, fuel, the clock and a short status (while planning, the round and how many candidates crashed).

With the default settings each decision takes eight planning rounds (the seven inner generations plus the starting population), then the GA commits a launch burn and the rocket lifts off. The trail builds out across the system. From then on the next burn is planned while the rocket keeps flying: the GA plans from where the craft is predicted to be at the next decision point, and the burn fires when the craft gets there. If planning takes longer than the coast to that point, for example on a slow connection, the flight plays back more slowly so it arrives about when the burn does, rather than racing ahead and stopping. The physics and the burns are exactly the same either way. If the craft does reach the point first, it waits there with a dashed ring around it. Each beacon is drawn as a green ring with a dashed inner circle. The dashed circle is the real 0.08 AU zone the craft has to pass through; the ring around it is only there to make the beacon easy to spot. Beacons turn solid green with a check mark as the craft sweeps through them. Planet names are written next to each planet on wider screens.

The view always shows every beacon and the outer planet's orbit. If the craft heads out past that, the view widens to keep it in sight, up to the dashed red line that marks the edge of the map. Crossing that line ends the mission as lost in deep space.

A clean trail with smooth arcs and one or two sharp kinks near a planet is the signature of a successful tour. The kink is the slingshot: a close pass to a planet at the right relative velocity bends the trajectory by twenty or thirty degrees and steals enough orbital energy to reach the next beacon. The history strip below the canvas adds a card for each finished mission, with the path the craft flew, how many beacons it visited and how it ended, so you can compare runs. Start flies the same mission again; Reset picks a new seed.

If the Connection Drops

Each decision needs several quick exchanges with the server. If the server stops answering for about ten seconds (the clock only counts while the page is visible and running), the demo reconnects and asks for the same decision again. Nothing is lost, because the craft's state lives in your browser and each decision is planned from scratch. It tries this twice per mission. If it still can't get an answer, the mission stops with a message; check your connection and click Start to fly the same mission again.

The Genome

Two real numbers in [0, 1], per decision point:

  • One gene sets the burn direction. Any compass bearing is allowed.
  • One gene sets the burn magnitude. The launch burn can go up to the booster's full range; in-flight burns are capped to a smaller in-flight thruster limit and to whatever fuel is left.

The inner GA at each decision evolves a population of thirty candidates over seven generations by default. Each candidate is scored by a short look-ahead simulation that starts from the rocket's state at the decision point, applies the candidate burn, and runs gravity forward for 0.6 years (about seven months) of mission time. The score rewards getting closer to the nearest unvisited beacon, with a big bonus for actually reaching one and big penalties for the rollout ending in a sun crash, a planet or asteroid crash, or an escape.

The launch impulse is not counted against the fuel budget. Think of it as the booster.

Settings

The Settings dialog exposes everything you can tune without changing code.

  • Genetic algorithm. Mutation probability and range, tournament size, elite count, and inner generations per decision. Inner generations is the search budget the GA spends at each decision. More is smarter but slower.
  • Reactive control. Decision interval and rollout horizon. Decision interval is how often the rocket gets a new burn; smaller is more reactive near hazards. Rollout horizon is how far each candidate burn is simulated forward when scoring; longer horizons see slingshot payoffs but cost more time.
  • Mission rules. Mission Clock, Fuel Budget, and Beacons to Collect. Shorter clocks force aggressive trajectories; tighter fuel budgets force the GA to lean on slingshots; more beacons add farther, harder targets.

Changes apply on the next Reset, never in the middle of a mission. The demo has no speed control: the pace is set by how fast the GA can plan each burn.

What the Achievement Rewards

The first time a single episode visits every beacon, the Grand Tour achievement unlocks for signed-in users, as long as the mission has at least four beacons. Collecting all of them on an easier one, two, or three beacon setting does not count.

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

Thanks for the feedback!