Racing Near the Speed of Light
Custom settings: runs with these settings don't count toward this map's best times, but you can save a finished run to a separate list for these settings.
How to play
Choose a map, then fly the laps of its course, passing through every gate in order. The race starts the moment you first press thrust; until then the clocks wait, and you can turn to aim. The next gate pulses, and an arrow at the edge of the screen points to it when it is out of view. The map in the corner shows the course in the rest frame, with your ship in pink and your ghosts in purple. The pink trail behind you shows where you've been during the last 2.5 seconds of your own time.
If you fly into a planet, you crash, and if you fall into a black hole, you are gone. Either way, the ship spins back to an earlier point on its path and continues with the velocity it had there, while the race clock keeps running. If you passed the last gate at least two seconds of flight before the crash, the ship goes back to that gate; otherwise it goes back to where it was two seconds before the crash, so you have time to steer away from whatever you hit. If you crash again within two seconds, the ship goes back another two seconds, rather than all the way to an earlier gate. Keeping the earlier velocity means a crash can't be used to stop quickly.
| ↑ or W | Thrust |
| ↓ or S | Brake (slow down relative to the course) |
| ← → or A D | Turn |
| R | Restart the race |
| L | Toggle the Lorentz transformation |
| C | Switch between Doppler color modes |
| + − or scroll | Zoom in and out |
| F | Toggle full screen |
| P | Pause |
On a touch screen, use the buttons under the game, and the full-screen button in the game's top right corner to fill the screen or to leave full screen. At the end of a run, buttons on the game let you race again or save the run.
Race clocks and best times
The race is timed by the course officials' clocks, which are at rest on the course. The race time is shown large in the lower right corner, with your own clock \(\tau\) below it. Your clock runs slow compared to the officials' clocks, so you age less than your race time, and the faster you fly, the bigger the difference. The number beside the race time is the rate \(dt/d\tau\): how many seconds of race time pass for each second on your clock. The race time changes color with this rate, from white when the two clocks keep pace, through yellow and orange, to red when the race clock runs 20 or more times faster than yours.
Your five best times on each map are listed above the clocks and replay as dashed ghost ships, numbered by rank. When a ghost is off screen, a numbered marker on the edge of the screen points toward it. Best times are saved in this browser. To give your results to someone else, press "Share" next to "Best times" to save every map's best times and ghosts in a file, and send them the file. They can press "Load" to add your runs to their own lists, where your ghosts race alongside theirs.
Each map has a standard set of physics settings: the speed of light, the engine power, and gravity. Only runs with the standard settings count toward the map's best times. Choosing a map loads its standard settings. If you change them, a warning appears with a button to restore them, and at the end of a run you can save your time to a separate list for your custom settings. A run can't be saved if you change the settings during it. The view settings, such as the zoom and the Doppler colors, don't affect the race. Your map and settings are remembered in this browser for your next visit.
Every map's standard settings use the real speed of light, 2.998 × 10⁸ m/s, and real time. Distances on every map are fixed: one unit is about 999 km, so light crosses 300 units each second. The "Speed of light" slider changes only how fast light travels, and shows it in orange when it isn't the real value. A slower speed of light makes the same motion more relativistic, and because the masses stay the same, it also makes every planet more compact and every black hole larger. If you change the speed of light while flying, the ship keeps its speed, unless that is now faster than 99.99% of the new speed of light.
The "Game speed" slider runs the game from 10 times slower to 100 times faster than real time; the fast settings make the solar system practical to explore. At 10×, ten seconds pass on your ship's clock for each real second, while steering, the crash animation, and the trail stay in real time.
"Engine power" sets the ship's acceleration, measured in the ship's own frame, in multiples of the speed of light per second. At 1 c/s you pass 90% of the speed of light after about one and a half seconds of thrust. The engines cut out at 99.99% of the speed of light, where \(\gamma \approx 70.7\).
There is no friction in space, so you can't take a corner at speed by steering alone: turn around and brake before the corner. The more relativistic you are, the harder it is to change direction, because a sideways push changes your direction less when your momentum is larger.
Maps
- Earth and Moon. A smooth figure eight around the real Earth and Moon, to scale, for three laps, at standard engine power 0.2 c/s. The course is a lemniscate, a figure-eight curve whose loops wrap around two points, with the Earth and the Moon at those points. One unit is about 999 km, so the Earth is only 13 units across, smaller than the ship icon, and the Moon is 384 units away: light takes 1.3 seconds to cross from the Earth to the Moon. The gravity of the real Earth and Moon is far too weak to notice at these speeds.
- Grand loop (solar system). A long course with the Earth and Moon on its first straight and the rest of the solar system to scale around it. The Sun is 500 light-seconds (8.3 light-minutes) from the Earth, and Neptune is about 4 light-hours from the Sun. Zoom out to about 1/1000× to see the inner planets, and to about 1/10,000× to see the outer ones. Flying to the Sun at 99.99% of the speed of light takes 8.3 minutes of rest-frame time, but only about 7 seconds on your own clock. The planets are placed where they are today in their orbits, which are drawn as circles (the real orbits are slightly elliptical and tilted). Their orbital speeds are around 0.01% of the speed of light, so they are treated as at rest.
- Planet run (fantasy). A wide, winding course strewn with about 90 planets, with gates about 2500 units apart, so you have to pick your own path between the planets. The planets range from 120 to 440 units across, and there is always a gap of at least 250 units between them. A black hole sits in the middle of the course a little past halfway around, with a wide clear zone around it, and a star, Ember, glows inside the loop. Each planet's Schwarzschild radius (see below) is 5–15% of its radius, far more than any real planet, so their gravity bends your path. The layout is the same on every visit, so best times stay comparable.
- Black hole slingshot (fantasy). Four black holes in a row, with a course that weaves between them in a chain of figure eights, at standard engine power 0.5 c/s. The course loops around each black hole in turn, alternating between clockwise and counterclockwise, and crosses itself between each pair. The black holes have very different masses: from lightest to heaviest, Wisp, Sprite, Titan, and Behemoth, whose event horizons have radii of 15, 40, 100, and 160 units. Every loop passes 500 units from its black hole, so Wisp barely bends your path, while Behemoth pulls about 11 times as hard as Wisp. The loop around Behemoth is only 3.1 horizon radii from it, just outside its innermost stable orbit, and clocks there run at about 79% of the rate of distant clocks. Gravity helps swing you around each loop, and pulls much harder the faster you fly. Cut too close to Behemoth and you fall in. Gates count only when you fly through them roughly along the course, so you can't pass a gate early from the other path at a crossing.
- Giants' slalom (fantasy). A course that weaves between five dense giant planets, at standard engine power 0.5 c/s. Each giant's Schwarzschild radius is 30% of its radius, so its gravity pulls you toward it, and clocks at its surface run at 84% of the rate of distant clocks.
The masses of the fantasy bodies are set so that their Schwarzschild radii take the values given here at the real speed of light. Lowering the speed of light makes those radii larger, in proportion to \(1/c^2\).
Around each black hole you can see the photon sphere (dashed) and an accretion disk of hot gas orbiting it. The gas orbits counterclockwise at up to half the speed of light, so the side moving toward you is blueshifted and the side moving away is redshifted, and all of the light from the inner disk is also redshifted as it climbs out of the black hole's gravity.
General relativity
With "Gravity (general relativity)" checked, the Sun, planets, moons, and black hole all pull on the ship. In the real solar system to scale, their gravity is far too weak to notice at these speeds, so try the fantasy maps. A mass \(M\) has a Schwarzschild radius \[ r_s = \frac{2GM}{c^2}, \] which is the size of the event horizon if the mass is a black hole. The game moves the ship along the paths of the Schwarzschild solution of Einstein's equations, which describes spacetime around a single round mass. Measured with the ship's own clock, the pull toward the mass is \[ \frac{GM}{r^2}\left(1 + \frac{3L^2}{c^2 r^2}\right), \] where \(L\) is the ship's angular momentum per unit mass. The first term is Newton's law of gravity. The second term is the correction from general relativity: it makes orbits precess, and it makes gravity much stronger for anything moving fast near a black hole, so it is possible to fall in even while flying sideways at nearly the speed of light. The pulls of several bodies are added together, which is a good approximation away from the black hole.
- Gravitational time dilation. A clock at rest a distance \(r\) from the mass runs slow by a factor \(\sqrt{1 - r_s / r}\) compared to a clock far away. The clocks near the black hole fall behind the others, and so does yours when you fly near it: the display shows your clock rate \(d\tau/dt\), which includes both this effect and the time dilation from your speed. In a circular orbit at three times the horizon radius, your clock runs at 71% of the rate of the race officials' clocks.
- Gravitational redshift. Light climbing out of a gravity well loses energy and is redshifted, and light falling in is blueshifted. The Doppler colors include this effect: deep inside the black hole's gravity, the rest of the course looks bluer.
- The event horizon. Nothing that crosses the horizon at \(r = r_s\) can come back out, however hard the engines push. At the photon sphere, \(r = 1.5\,r_s\), light itself can orbit the black hole, and no stable orbit exists inside \(3\,r_s\), where the accretion disk ends.
Near the black hole, the map is not to scale: space there is curved, so a unit on the screen in the direction of the black hole corresponds to more than one unit of distance. The game also leaves out gravitational lensing, the bending of light around the black hole. Lensing changes where things appear in the sky to someone looking out from the ship, and that doesn't translate to a view from above.
What you are seeing
The stars, the course, the blue grid, and the clocks are at rest relative to each other, so they define a rest frame. The screen shows the world in your frame: the reference frame in which your ship is momentarily at rest. To draw each object, the game finds the event on the object's path that you consider to be happening "now", and then applies the Lorentz transformation to find where that event is in your coordinates.
If the ship moves at velocity \(\mathbf{v}\) relative to the rest frame, the Lorentz factor is \[ \gamma = \frac{1}{\sqrt{1 - v^2/c^2}}. \] Three effects follow.
- Length contraction. Distances along your direction of travel shrink by a factor of \(\gamma\), while distances perpendicular to it don't change. The grid squares squash into rectangles, the clocks and gate posts flatten into ellipses, and the straights get shorter, so more of the course fits on the screen.
- Time dilation. While you coast, every clock on the course runs slow by a factor of \(\gamma\) compared to your own clock \(\tau\).
- Relativity of simultaneity. The clocks on the course are synchronized in the rest frame, but not in yours. A clock a rest-frame distance \(\Delta x\) ahead of you, measured along your direction of travel, reads \(v \, \Delta x / c^2\) later than the clock where you are, and clocks behind you read earlier. Thrust toward a row of clocks and watch the ones far ahead jump forward as your speed increases. Brake, and they jump back. The ghosts are placed the same way, so when you are moving, a ghost ahead of you is shown later in its run, and a ghost behind you earlier in its run.
Doppler colors
Light from the things you fly toward is shifted to higher frequencies, and light from the things you fly away from is shifted to lower frequencies. For a source at rest in the rest frame, the ratio of the frequency you receive to the frequency it emits is the Doppler factor \[ D = \gamma \left(1 + \frac{v}{c} \cos\theta\right), \] where \(\theta\) is the angle, measured in the rest frame, between your velocity and the direction to the source. Even objects directly beside you, at \(\theta = 90^\circ\), are blueshifted by a factor of \(\gamma\): this is the transverse Doppler effect. There are two ways to color the light.
- Vivid. Every light source emits a single wavelength \(\lambda\): amber track lamps, orange gates, cyan clocks, and so on. You receive the wavelength \(\lambda / D\), so as you speed up, the lamps ahead of you change from yellow through green and blue to violet, and the lamps behind you turn red. Light shifted beyond the visible range, into the ultraviolet or infrared, is drawn as a dimmer blue-violet or deep red, so you can still see the course at high speed.
- Realistic. Every light source glows like a hot object (a blackbody) at some temperature \(T\), and the planets reflect sunlight. The Doppler shift turns the spectrum of a blackbody at temperature \(T\) into the spectrum of a blackbody at temperature \(D\,T\). Things behind you turn red and then fade to black. Things ahead turn blue-white, but no more blue than that: a blackbody gets bluer as it gets hotter only up to a pale sky blue, so a strong blueshift mostly looks white. This is closer to what you would really see, because real light sources emit a broad range of wavelengths.
The colors match the light that reaches you, but the positions don't match what you would see. The positions show where things are in your frame "now". Light takes time to reach you, and the aberration of light would also crowd everything you see toward the direction you are flying. These effects on position are left out so that the Lorentz transformation is easier to see.
Uncheck "Lorentz transformation" (or press L) to compare with the picture without it: the rest frame at a single rest-frame time, with no contraction. The motion is still relativistic, so you can't exceed the speed of light, but the clocks all agree and the grid stays square.