Spacewar! was conceived in 1961 by Martin Graetz, Stephen Russell, and Wayne Wiitanen. It was first realized on the PDP-1 in 1962 by Stephen Russell, Peter Samson, Dan Edwards, and Martin Graetz, together with Alan Kotok, Steve Piner, and Robert A Saunders. – Spacewar! is in the public domain, but this credit paragraph must accompany all distributed versions of the program.
This implementation by Norbert Landsteiner, www.masswerk.at, 2012, updated 2013.
Added enhanced, CRT-like graphics, support for variable output sizes, a splash-screen with near to authentic graphics, and embedding artwork. This implementation also features minor changes to the original emulation code for a bit of speed.
Touch-Controls: Special controls featuring arcade-style buttons are displayed for touch-enabled devices (use landscape orientation; use the ship icons to move the controls to a convinient location).
Use the special offline version to add "Spacewar!" to your home screen (so you may play even without an active network connection).
* M E M O *
PLAYING "SPACEWAR!" DURING REGULAR OPERATIONS IS POSITIVELY PROHIBITED!
AS YOU ALL PRETTY WELL KNOW, REGULAR OPERATION HOURS ARE FROM 0 AM TO 12 PM ("24/7")!
INSTRUCTIONS FOR PLAYING "SPACEWAR!":
A ... TURN LEFT
D ... TURN RIGHT
S ... THRUST
W ... FIRE
J ... TURN LEFT
L ... TURN RIGHT
K ... THRUST
I ... FIRE
PRESS 'LEFT' AND 'RIGHT' TOGETHER FOR CLOAK/HYPERSPACE.
HEAD OF THE COMPUTER DEPARTMENT
A printed version of original code (aprox. 40 pages long) was provided by Martin Graetz to Barry Silverman, Brian Silverman, and Vadim Gerasimov, who typed it in again and re-assembled it with a PDP-1 assembler written in Perl. The code is extremely faithful to the original and is here provided in three versions (available by the "versions menu" at the top left of the emulated display):
The original PDP-1 Type 30 display was a point-plotting display, plotting randomly accessible points onto a 1024 x 1024 area of
Also emulated are the display's varying levels of intensity: While the Type 30 display featured technically a range of 8 levels of intensity, only 7 were actually addressable by the PDP-1 (with one control bit reserved for the Type 31 "Precision CRT Display" for use as a photomultiplier device). According to the source code, 4 different levels of brightness are actually used by the game, especially for the background starfield.
Please mind that the original Type 30 "Visual CRT Display" featured twice the resolution of the emulated display. You may want to use a scaled view of the original resolution of 1024 x 1024 by selecting a "Hi-Res" version from the "versions menu". Consider this option for a close-to-original game play or while using a high-resolution ("retina") display. (You may also want to check the fullscreen version for an unscaled view of the original resolution – big display and/or presentation mode recommended.)
The original PDP-1 code, which introduces another level of display modulation by not refreshing the background starfield in every cycle (odd cycles only), is executed by the emulation faithfully frame by frame. In order to reduce extensive flicker, you may disable frame-by-frame-mode in the "Sense Switches / Setup" dialog. (The emulation will still be executed frame by frame, but even and odd frames will be stacked, resulting in only odd frames to be actually displayed. This provides a stable display, but might have effects on the sensitivity of the player controls.)
"Spacewar!" features two ships — called the "needle" and the "wedge" — in deep space against the backdrop of a realisticly moving starfield (Peter Samson's "Expensive Planetarium" which displays the night sky as it would be seen from M.I.T.'s roof). The ships, each to be controlled by a human player, are subject to a gravity vortex in the center (also known as "the Star"). Ships may propel according to Newtonian laws and fire torpedoes (also called missiles, or photons) at each other in order to win the space duel. (Unlike the ships, the torpedoes are unaffected by gravity, allowing some rather unexpected maneuvers.) Both fuel and torpedoes are of limitted supply. A jump to hyperspace (triggered by issuing "left" and "right" at once) may be used as an unstable mean of last resort.
While the game was essentially complete in late April 1962, later versions would add even more features like a more complex (i.e. unreliable) hyperspace, a hyperspace animation, or scoring. The code run in the emulation is tagged "spacewar 3.1 24 sep 62".
It might be notable that the game's code features a table of settings for adjusting essential constants like the extense of gravity, capture ranges, acceleration rates, the number of torpedoes in supply, their range, velocity, and spacing, or even the mode of maneuvering: There are essentially two modes: "gyros" (default), where rotation would be on as long as the button was pressed and off as soon as the button was off, and "thruster rockets", where pressing the button would add to (or substract from) the current angular momentum. The code running in the emulation features default settings, with the exception of the "big ships" version employing adjustments (by changing a settings value and by modifying a scaling factor in the code) for the smaller size of the emulated display.
Some settings to modify the game's setup were adjustable by the PDP-1's sense switch controls. You may set these in the "Sense Switches / Setup" dialog, accessible by its button on top of the virtual display.
Also in this dialog there is a double-speed option for gamers spoiled by modern hardware …
Thanks to Barry Silverman, Brian Silverman, and Vadim Gerasimov for granting permission to re-use their emulation code and their version of the Spacewar! source code. (Please visit their original site.)
Special thanks to Steve Russell for providing insight into the original PDP-1 Type 30 display and its special dual-phosphor characteristics.
In 1963 (ca.) DEC related to Spacewar! in a promotional brochure (“PDP-1 Computer and Spacewar”) as follows:
The demonstration you are watching on the cathode ray tube is called Spacewar. At first look, Spacewar is a fascinating space-age game, in which two players maneuver rocket-armed spaceships in the near weightlessness of space until one is in position to fire the winning shot.
More important, Spacewar is typical of simulation techniques used in psychology laboratories to analyze the problems of man-machine relationships in complex or little-understood situations.
General-purpose computers and other digital equipment play a key role in many scientific studies. The PDP-1 computer used in Spacewar is performing calculations at speeds up to 100,000 per second as it interprets the operator's switch actions and sends positional information to the display at a rate of 20,000 points per second. To give some idea of the complexity of the computer's task, we might mention that in storing and plotting the relative positions and speeds of the spaceships, rockets, stars, and sun, PDP-1 is referring to Newton's laws of motion stored in its 4096-word core memory. Thus the operators must compensate for gravitational attraction when the spaceships come close to the sun.
PDP-1 Sense Switches
The PDP-1's control console provided an array of switches, the “sense switches”, which were used to control some of the game's behavior (“off” = default settings):
(On: high, Off: low)
(On: low, Off: high)
(On: none, Off: starfield)
(On: kills, Off: teleports)
(On: big star off, Off: big star on)
(On: display each frame, Off: double frames, no flicker)
(On: run at double speed, Off: original speed)