Monday, June 16, 2008

Spacewar (Game)

Spacewar! is one of the earliest known digital computer games.
Steve "Slug" Russell, Martin "Shag" Graetz and Wayne Witaenem of the fictitious "Hingham Institute" conceived of the game in 1961, with the intent of implementing it on a DEC PDP-1 at the Massachusetts Institute of Technology. After Alan Kotok obtained some sine and cosine routines from DEC, Russell began coding, and by February 1962 had produced his first version. It took approximately 200 hours of work to create the initial version. Additional features were developed by Dan Edwards, Peter Samson and Graetz.

The basic gameplay of Spacewar! involves two armed spaceships called "the needle" and "the wedge" attempting to shoot one another while maneuvering in the gravity well of a star. The ships fired missiles that were unaffected by gravity (due to a lack of processing time). Each ship had a limited number of missiles and a limited supply of fuel. The hyperspace feature could be used as a last-ditch means to evade enemy missiles, but the reentry from hyperspace would occur at a random location and there was an increasing probability of the ship exploding with each use.
Each player controls one of the ships, and must attempt to simultaneously shoot at the other ship and avoid colliding with the star. Player controls included clockwise and counterclockwise rotation, thrust, fire, and hyperspace. Initially these were controlled using the front-panel test switches, with four switches for each player, but these proved to wear out very quickly under normal gameplay. Most sites used custom control boxes wired into the same switches, although joysticks and other inputs were also used.

Options and features
Early versions of the game contained a randomly generated background starfield. However, the inaccuracy and lack of verisimilitude annoyed Samson, so he wrote a program based on real star charts that scrolled slowly: at any one time, 45% of the night sky was visible, every star down to the fifth magnitude. The program was called "Expensive Planetarium" (referring to the price of the PDP-1 computer), and was quickly incorporated into the main code.
There were several optional features controlled by sense switches on the console:

  • no star (and thus no gravity)
  • enable angular momentum
  • disable background starfield
  • the "Winds of Space"- a warping factor on trajectories that required the pilot to make careful adjustments every time they moved

Spacewar! was a fairly good overall diagnostic of the PDP-1 computer and Type 30 Precision CRT Display, so DEC apparently used it for factory testing and shipped PDP-1 computers to customers with the Spacewar! program already loaded into the core memory; this enabled field testing as when the PDP was fully set up, the field representative could simultaneously relax and do a final test of the PDP.

Ports to other systems
Spacewar! was extremely popular in the 1960s, and was widely ported to other systems. As it required a graphical display, most of the early ports were to other DEC platforms like the PDP-10 or PDP-11, or various CDC machines.
Early microcomputer systems also supported Spacewar!. The Cromemco Dazzler had a version, as did the ECD Micromind. The Micromind did not have a high-resolution bitmap display, due to the high cost of memory at the time. This version rendered ships in portions of the computer's flexible character generator, which was dynamically generated to support rendering ships at different angles.

Spacewar! today
As of May 2006, there is only one working PDP-1 known to be in existence, at the Computer History Museum in Mountain View, California. The computer and display were completely restored after two years of work, and Spacewar! is operational. On May 15, 2006, the museum presented The Mouse That Roared: A PDP-1 Celebration Event. The PDP-1 was demonstrated running Spacewar! as well as other programs, and members of the public were able to play the game using makeshift controllers.
Most recently, Spacewar! code has been given out with Microsoft XNA Game Studio Express.