Spacetest
A downloadable game for Windows
Stay ahead of a growing missile swarm in a realistic two-body simulation. How long can you survive?
This is a very early prototype, which may or may not graduate into a full game at some point and may or may not run properly on your machine. Expect poor balance, poor performance, and unfathomable levels of jank.
Inspired by Kerbal Space Program and Winchell Chung's wonderfully evocative compendium of hard sci-fi, but most of all by Gotter, who dreamt up the core loop. Gameplay is restricted to the Earth system for now, but the underlying simulation features n-body physics over (almost) arbitrary distances.
Art by Gotter.
Code and music by me.
INTERFACE
The navigation window in the lower right displays your orientation relative to your orbit.
- PROGRADE is a blue circle with a cross. Prograde burns 'widen' your orbit.
- RETROGRADE is a blue circle with a diagonal cross. Retrograde burns 'narrow' your orbit.
- NORMAL is a green anchor, pointing up. Normal burns shift your orbital inclination 'upwards'.
- ANTINORMAL is a green anchor, pointing down. Antinormal burns shift your orbital inclination 'downwards'.
- ZENITH is a red triangle, pointing up. Zenith points away from the Earth.
- NADIR is a red triangle, pointing down. Nadir points towards the Earth.
The number in the lower left is your altitude relative to the surface. If you drift to 0 km, you crash into the Earth. Move beyond 5000 km and you lose contact with ground control, ending the game.
Close and reopen the game to try again after a loss.
MANUAL CONTROLS
There is no drag in space, so rotations require countersteering.
- W/S -> pitch
- A/D -> yaw
- Q/E -> roll
- SPACE/SHIFT -> accelerate forward/backwards
AUTOPILOT CONTROLS
The autopilot maintains a given heading over time.
- T -> toggle autopilot
- NUM0 -> maintain current heading; useful recovery tool if you spin out of control
- NUM1 -> prograde
- NUM2 -> retrograde
- NUM3 -> normal
- NUM4 -> antinormal
- NUM5 -> zenith
- NUM6 -> nadir
JANK TANK™
Ordered roughly by priority.
- JANK #1: A NEW JANK
Problem: FixedUpdate takes too long
Symptoms: overly large timesteps break physics engine on slower machines
Solution: review physics engine, improve performance
- JANK #2: THE JANK STRIKES BACK
Problem: unknown, receivers take too long to retrieve data?
Symptoms: velocity vector initialises at zero on slower machines, followed by instakill
Solution: unknown, perform unit tests to isolate cause
TEMPFIX: disable data reading and calculate orbital velocity dynamically
- JANK #3: RETURN OF THE JANK
Problem: unknown, Lambert solver fails to converge when z component of vector has high positive value?
Symptoms: missile AI breaks in edge cases
Solution: unknown, perform unit tests to isolate cause
- JANK #4: THE JANKENING
Problem: Lambert solver does not account for maneuver time
Symptoms: missiles overshoot when maneuver times are too long
Solution: add SPD convergence time to Lambert convergence time, reject burns that take longer than trajectory
TEMPFIX: set missile acceleration limits to very high values
- JANK #5 AND THE TEMPLE OF JANK
Problem: predictive simulation does not account for orbital period
Symptoms: slow orbits are not calculated in full, breaking missile AI
Solution: dynamically lengthen line renderer points until convergence, set cap for hyperbolic orbits
- JANK #6: THE JANK RELOADED
Problem: Lambert solver does not account for position of the Earth
Symptoms: missiles can phase through the surface
Solution: invert Lambert direction if trajectory gets too close to the surface
- JANK #7: JUDGMENT JANK
Problem: missiles can spawn within or close to detonation range
Symptoms: unfair instakills
Solution: exclude sphere centred on player from coordinate generation
- JANK #8: SON OF THE JANK
Problem: predictive simulation is unstable when trajectories pass origin
Symptoms: glitchy orbit renderer
Solution: cap line renderer points when trajectory gets too close to surface
- JANK #9: INFINITY JANK
Problem: predictive simulation recalculates trajectories at every timestep
Symptoms: low framerate when missile counts are high
Solution: recalculate trajectories in full only when non-simulation forces are applied
- JANK #10: FURY JANK
Problem: orientation tracker flips when Euler angles overflow
Symptoms: navigation ball maintains correct orientation, but briefly spazzes out
Solution: quaternions, probably
- JANK #11: THE WRATH OF JANK
Problem: lots of spaghetti in non-simulation classes
Symptoms: suicidal ideation
Solution: stop coping, start coding
Download
Install instructions
Unzip, then open Spacetest.exe.
Leave a comment
Log in with itch.io to leave a comment.