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.
Go to the live page Open the Orbital Voyager demoThe 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 scattered across deep space, dodging the sun, four orbiting planets, and the edge of the map. The trick is that the GA does not plan the whole flight at once. Every roughly 0.1 simulated years the rocket pauses, a fresh GA runs, and it 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. 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.
Four beacons sit at fixed positions in deep space, picked to span the inner system and the outer system. A beacon is visited if the spacecraft passes within 0.08 AU at any point. Visit order does not matter.
Hazards end the mission immediately. If the spacecraft passes inside 0.10 AU of the sun, it is destroyed. Inside 0.05 AU of any planet, it crashes. Past 8 AU from the sun, it is lost in deep space. The mission also ends after six simulated years even if no hazard was hit.
How a run looks¶
Click Start. The rocket pauses on the launch pad while the first genetic algorithm runs to choose a launch burn. Faint blue trails fan out from the craft, showing trajectories the GA is considering; the brightest one is the current best. The "Planning" counter in the strip across the top of the canvas ticks through the inner generations.
After ten or so generations the GA commits a launch burn and the rocket lifts off. The trail builds out across the system. After about 0.1 simulated years the rocket pauses again, picks a new burn, and continues. The "Decision" counter ticks up at each pause. Beacons flip from green rings to gold checkmarks as the craft sweeps through them.
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 summarizes each finished episode so you can compare runs.
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 ten generations by default. Each candidate is scored by a short look-ahead simulation that starts from the rocket's actual current state, applies the candidate burn, and runs gravity forward for about four 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 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 pause. More is smarter but slower.
- Reactive control. Decision interval and rollout horizon. Decision interval is how often the rocket pauses to ask for guidance; 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 and Fuel Budget. Shorter clocks force aggressive trajectories; tighter fuel budgets force the GA to lean on slingshots.
Changes apply on the next Reset.
What the achievement rewards¶
The first time a single episode collects all four beacons, the Grand Tour achievement unlocks for signed-in users. It is a clean win condition: four beacons, no crash, mission complete.
For more on how the demos catalog works, see What the demos do.