Back to homepage

Relativistic Asteroids (prototype game)

Description:
This is a prototype game that I created to explore some of aspects of programming a relativistic model of mechanics and situating relativistic interactions in a game. The game is a re-imagining of the classic 2D Asteroids arcade game, with relativistic physics (imaginatively titled Relativistic Asteroids). Asteroids was chosen as the model for the game, because it is concerned with the motion and inertia of objects (drifting asteroids and the player's spaceship). The graphics are pretty basic, as the focus of the development was on the behaviour of the inertial objects.

The main difference from the original is that the game features dual physics "engines", that allow it to be played under either classical (Newtonian) or special relativistic rules. In this way it portrays some of the differences between classical and relativistic models of physics. In classical mode, the game functions as a fairly standard clone of the original Asteroids, albeit with elastic body-to-body collisions and conservation of momentum. The relativistic mode utilises the illustrative device from Mr. Tompkins of 'slow' light speed, to enable relativistic effects to enter into the gameplay. Objects moving close to the speed of light exhibit visible length contraction and appear squashed in the direction of motion; mass dilation affects the handling of the spaceship and the results of collisions; time dilation affects the 'lifespans' of projectiles and timed objects; and all objects obey the finite 'speed limit' of light.

Screenshots:

Classical mechanics gameplay 1 | Relativistic mechanics gameplay 1
Classical mechanics gameplay 2 | Relativistic mechanics gameplay 2
Classical mechanics gameplay 3 | Relativistic mechanics gameplay 3
| Relativistic mechanics gameplay 4
| Relativistic mechanics gameplay 5
| Relativistic mechanics gameplay 6

Updates:
4 April 2008: Added a 'Practise' mode (see Game Modes below) that enables free experimentation with the relativistic physics model.
Also added the build date (2008.04.04) to the application titlebar to make it easier to distinguish prior and possible future versions.
25 November 2009: Significant revisions from feedback. Added an approximation of Doppler shift of the colour of light. Varied visual effect of mass dilation to an expanding/thicker outline.


Requirements:
The game is written in C++ with the Microsoft DirectX 9.0c API. Therefore, it requires a PC running Microsoft Windows 98 or later with DirectX 9.0c installed. (DirectX 9.0c comes pre-installed in Windows XP SP2 and Windows Vista.)

To update your version of DirectX, visit either of the following pages on the Microsoft website:
1. DirectX End-User Runtime Web Installer: to get the latest DirectX end-user runtimes automatically through the Microsoft web installer.
2. DirectX End-User Runtimes (March 2009): for a DirectX 9.0c redistributable that you can download as a single package and install.

Downloads:
Game download: RelAsteroids20091125.zip.zip (2.6 MB) (build/release 2009.11.25)
To install, simply extract the contents of the zip file to a folder of your choosing (keeping subfolders). Double-click the exe file to play.

Support:
If you encounter problems running the application, or have questions or feedback, email me at dcarr@csu.edu.au.


Gameplay Instructions:
The goal of the game is to manoeuvre the spaceship to shoot and destroy asteroids while avoiding collision with the fragments, earning points to rack up a high score. Each level starts with a number of large asteroids drifting in from the periphery of screen. Asteroids break into progressively smaller chunks when destroyed until they are reduced to nothingness. When all the asteroids have been cleared from the screen, the game advances to the next level, increasing the starting number of asteroids. The player starts the game with three lives, and more lives can be gained by achieving a high enough score. The game ends when the player runs out of lives.

Your ship boasts an unlimited top speed and class-leading turning circle. Unfortunately, due to cuts in program funding we had to manufacture the hull out of papier-mâché, so try to avoid colliding with anything solid.
The ship can rotate clockwise or counter-clockwise, accelerate in the direction it is pointing by applying thrust, and fire projectiles that destroy the asteroids.
The ship also has two special abilities which are fuelled by a finite energy store: an afterburner and an energy shield. The afterburner provides greatly amplified thrust for quicker acceleration, and depletes energy gradually. The shield makes the ship temporarily invulnerable and obliterates anything it touches, but consumes energy quickly. The energy store is replenished by shooting the asteroids.
You earn an additional ship for every 50,000 points scored.
An asteroid. They come in three sizes: big, medium and small. Each big asteroid breaks into two medium-sized ones when destroyed, and each medium into two small. Chunks are ejected with unpredictable speeds and the small ones can travel quite fast. Asteroids will bounce off one another when they collide, but they will destroy your ship if you run into them, unless you use the shield. The big ones are worth 20 points when shot, the medium ones 50 points, and you get 100 if you bag a small one.
Some asteroids are drawn with a red outline, and display a timer counting down in seconds. These are highly unstable and will explode when the countdown reaches zero, flinging deadly debris for a short distance in directions all around! The pieces of shrapnel will destroy your ship on contact (unless you are shielded). The explosion can also destroy nearby asteroids, leading to impressive chain-reactions.

Game modes:
The game provides four different modes of play:

Classical physics: The game utilises a physics model based on the classical (Newtonian) physics. Pretty ordinary.

Relativistic physics: The game utilises a physics model based on the special theory of relativity, with a 'slow light' speed that has been tuned to enables relativistic effects to enter readily into the gameplay. The heads-up display (HUD) readout on the screen changes to display speed as a proportion of the speed of light, and additionally shows the ship's current mass as a percentage of its rest mass. Objects moving at speeds close to the in-game speed of light experience a number of phenomena:

  • Length contraction: Measuring the length of a relatively moving object will reveal it to be shortened along the direction of motion (as opposed to measuring it while it is stationary). This is shown literally in the game (although it is important to remember that in reality this would only be 'seen' under special circumstances).
  • Mass dilation: The energy content of a body, described by the equation E=mc², increases as an object increases in speed. This is most generally related to an increase in inertial mass. This affects the outcome of elastic collisions between asteroids, and the handling of the player's ship travelling at high speed. Fast-moving objects in the game also display a trail effect to convey visually the sense of increased mass.
  • Time dilation: An relatively moving object experiences a slowing of time as seen by an observer. This is shown in game with the 'time bomb' objects whose clocks will run slower the faster the object is travelling (the colour of the countdown readout is also shifted to blue). Time dilation also affects the player's ship. Its rotation rate is slowed, as is the rate at which projectiles are fired; however the projectiles themselves will also experience a lengthening of their lifetimes.

    Challenge mode: In this game mode, the first level is played in classical physics. The game then transitions to the relativistic physics model, beginning with a high speed of light and progressively lowering it over successive levels to the 'slow' light speed used in the pure relativistic game mode.

    Practise mode (as of 2008.04.04 update): This mode plays the same as the 'slow light' relativistic game, but with a permanently shielded ship; this allows players to freely experiment with the relativistic physics, without the inconvenience of crashing and dying all the time ;)
    Rather than being destroyed on collision, the ship simply bounces off the asteroids. The energy level is also maintained at 100%, and there is no score-keeping or lives.

    Controls:
    F1 New game (challenge mode: transitions from classical physics to relativistic physics)
    1 / N New game (classical or Newtonian physics mode)
    2 / R New game (relativistic 'slow light' physics mode)
    P Practise game (relativistic 'slow light' physics mode with indestructable ship)
     
    H Display an information screen
    Esc Quit
     
    Left & Right Arrow / A & D Rotate ship left and right
    Up Arrow / W Thrust
    Spacebar Fire
     
    Shift Special action: Afterburner (increases thrust, consumes energy slowly)
    Down Arrow / S Special action: Shield (temporary invincibility, consumes energy quickly)
    0 (zero) Swap special action controls

    Playing tips:
    Each level begins with a number of asteroids spawned around the edges of the screen. Therefore it's a good idea to return the ship to the centre of the playing area during the pause between destroying the last asteroid and the next level beginning.

    Due to the way in which the dynamics change in relativistic mode, you might be tempted to simply hold the ship stationary and just shoot at incoming targets. However don't be shy to move around! The afterburner feature is provided precisely to overcome the increased inertial mass of the ship when it is in moving quickly. Use it to accelerate up to speed and decelerate quickly.


    Online Survey (Updated 4 August 2008):
    I have been running an anonymous, voluntary web-based study to collect data on the game's effectiveness and the opinions of potential users. As of 4 August 2008 the first run of the survey has been completed, and the survey is now inactive. (It can still be accessed here, but no results will be recorded.)

    This is the old outline of the survey:

    The survey consists of the following types of questions:

  • rating questions that ask the user to evaluate various aspects of the game;
  • a 'test'-style section to measure users' knowledge of special relativity; and
  • questions to collect general (non-identifying) demographics information.
    Note that you don't need to have played the game to participate in the survey - your answers to the 'test' section will provide valuable data to compare with people who have played it. You can even take the survey twice (before and after trying the game) to see if your understanding of relativity topics has improved.


    Back