The Origin of Spacewar
J. M. Graetz
The following notice was required by Creative Computing magazine's policy for free reprints in newsletters and nonprofit publications:
Copyright © 1981 by Creative Computing, 39 E. Hanover Ave., Morris Plains, NJ 07950.
Sample issue $2.50, 12-issue subscription $20.
(Please note that Creative Computing went out of business in 1985.)
Notes on the Edition:
This copy is based on the copy available at archive.org: https://archive.org/details/creativecomputing-1981-08.
and the reprint in
The Computer Museum Report, Fall 1983; (ISSN 0736-5438), pp. 6-12,
The Computer Museum, One Iron Way, Malboro, Massachusetts 01752,
as available at archive.org: https://archive.org/details/computermuseufal1983comp.
This edition attempts to provide the most complete version of the text possible. While the edition of The Computer Museum Report (TCMR) mostly shows text deletions, it also provides a few vital additions and a more reasonable arrangement of text. Text modifications based on the TCMR and differences between the two text versions are marked up in the page source.
(If active, sections specific to the Creative Computing edition are marked up "CC", while sections specific to The Computer Museum Report are marked up "TCMR".)
The text is derived from the original HTML-page http://www.wheels.org/spacewar/creative/SpacewarOrigin.html and was corrected by comparing it to the original as preserved in the PDF available at archive.org. The illustrations are as in the edition at wheels.org.
I. BEFORE SPACEWAR!
The Lensman, The Skylark, and the Hingham Institute
It's Kimball Kinnison's fault. And Dick Seaton's. Without the Gray Lensman and the Skylark of Space there would be nothing to write about. So most of the blame falls on E. E. Smith, but the Toho Film Studios and the American Research and Development Corp. have something to answer for as well. If Doc Smith had been content designing doughnuts, if American-International Pictures had stuck to beach blanket flicks, if (most of all) General Doriot hadn't waved money in front of Ken Olsen in 1957, the world might yet be free of Spacewar!
It all came together in 1961 at the Hingham Institute, a barely-habitable tenement on Hingham Street in Cambridge, MA. Three Institute Fellows were involved: Wayne Wiitanen, mathematician, early music buff, and mountain climber; J. Martin Graetz (which is me), man of no fixed talent who tended to act superior because he was already a Published Author; and Stephen R. (Slug) Russell, specialist in steam trains, trivia, and artificial intelligence. We were all about 25 (the more or less to be the same).
At the time, we were crashing and banging our way through the
"Skylark" and "Lensman" novels of Edward E. Smith, PhD,
a cereal chemist who wrote with the grace and refinement of a pneumatic drill.
In a pinch, which is where they usually were, our heroes could be counted on to come up with a complete scientific theory, invent the technology to implement it, build the tools to implement the technology, and produce the (usually) weapons to blow away the baddies, all while being chased in their spaceship hither and thither through the trackless wastes of the galaxy (he wrote like that) by assorted Fenachrone, Boskonians, and the World Steel Corporation.
If that's the case, we asked ourselves, why doesn't anyone make Skylark movies? Hearing no reply (our innocence of current film technology, economics, and copyright laws was enormous), we often passed the time in the Hingham Street common room in deep wishful thought, inventing special effects and sequences for a grand series of space epics that would never see a sound stage. Nonetheless, these books, movies, and bull-sessions established the mind-set that eventually led to Spacewar!
When Computers Were Gods
In early 1961 Wayne, Slug, and I, by no coincidence, were all
working at Harvard University's Littauer Statistical l
To a generation whose concept of a computer is founded on the Z80
chip, it may be hard to visualize a 704 or to comprehend the place it
held in the public imagination
Everything about the 704, from the inscrutable main frame to the
glowing tubes
A Stone's Throw from Olympus
In the summer of 1961 I went to work for Professor Jack B. Dennis, who was then the proprietor of the TX-O, a machine that to me was only slightly less legendary than its ancestor, Whirlwind. The TX-O was transistorized, and while solid-state computers were beginning to appear on the market, the "Tixo" was the original. Even in 1961 it was acknowledged to be a historically important research facility; many of the programs developed on the TX-O, such as Jack Dennis's MACRO Assembler and Thomas Stockham's FLIT debugging program, were the first of their kind. So the chance to work on this computer was in many ways a rite of passage; it mean that I had joined the ranks of the Real Programmers.
While hardly your average populist Apple, the TX-O was definitely a step away from the Computer-As-Apollo. Instead of being sealed into its own special chapel, it sat at one end of a typical large, messy MIT research space. With its racks of exposed circuitry, power supplies and meters, and its long, low L-shaped console, the TX-O looked for all the world like the control room of a suburban pumping station. And the thing of it was, you were expected to run it yourself.
And the TX-O had a Scope. Now console-mounted, programmable CRTs
were not unheard of at that time but they were generally slow,
inflexible, and awkward to program. The TX-O scope
That was the TX-O: the world's first on-line computer, and the training ground for the designers and programmers of later generations of hands-on machines. The first computer bums — hackers — were the products of this training; without it, and them, there would have been no Spacewar!
Tixo's People
The users of the TX-O were a melange of students, staff
researchers and professors with not much in common other than their
need for large amounts of largely unstructured computer time. The
feel of the place, however, was established by the hackers — mostly
students, but including a professor or two — whose lives seemed to
be organized in 18-bit strings.
Out of this cloud of computer bums emerged the group that brought
Spacewar! to the silver (well, light gray) screen: Dan Edwards
(AI Group),
"You Mean That's All It Does?"
When computers were still marvels, people would flock to watch
them at work whenever the opportunity arose. They were usually
disappointed. Whirring tapes and clattering card readers can hold
one's interest for only so long. They just did the same dull thing
over and over
On the other hand, something is always happening on a TV screen, which is why people stare at them for hours. On MIT's annual Open House day, for example, people came to stare for hours at Whirlwind's CRT screen. What did they stare at? Bouncing Ball.
Bouncing Ball may be the very first computer-CRT demonstration
program. It didn't do much: a dot appeared at the top of the screen,
fell to the bottom and bounced (with a "thok" from the console
speaker). It bounced off the sides and floor of the displayed box,
gradually losing momentum until it hit the floor and rolled off the
screen through a hole in the bottom line. And that's all. Pong was
not even an idea in 1960.
The TX-O's counterpart to Bouncing Ball was the Mouse in the Maze, written by Douglas T. Ross and John E. Ward. Essentially, it was a short cartoon: a stylized mouse searched through a rectangular maze until it found a piece of cheese which it then ate, leaving a few crumbs. You constructed the maze and placed the cheese (or cheeses — you could have more than one) with the light pen. A variation replaced the cheese with a martini; after drinking the first one the mouse would stagger to the next.
Besides the Mouse, the TX-O also had HAX, which displayed changing
patterns according to the settings of two console switch registers.
Well-chosen settings could produce interesting shapes or arrangements
of dots, sometimes accompanied by amusing sounds from the console
speaker. The console speaker is a phenomenon whose day seems to have
passed.
Finally, there was the inevitable Tic-Tac-Toe, with the user playing the computer. The TX-O version used the Flexowriter rather than the scope. (The game is so simple to analyze that there was even a version for the off-line Flexo.)
These four programs pointed the way. Bouncing Ball was a pure demonstration: you pushed the button, and it did all the rest. The mouse was more fun, because you could make it different every time. HAX was a real toy; you could play with it while it was running and make it change on the fly. And Tic-Tac-Toe was an actual game, however simpleminded. The ingredients were there; we just needed an idea.
The World's First Toy Computer
For all its homeliness, the TX-O was still very much a god. It took up lots of space, it had to be carefully tended, it took special procedures to start it up and shut it down, and it cost a lot of money to build.
All this changed in the fall of 1961, when the first production-model PDP-1 was installed in the "Kluge Room" next door to the TX-O. It had been anticipated for months; an early brochure announcing the machine (as well as a couple of no-shows called the PDP-2 and PDP-3, in case you had been wondering about that) had been circulating in the area for a while. It was clear that the PDP-1 had TX-O genes; the hackers would be right at home.
The -1 would be faster than the Tixo, more compact, and
available
II. SPACEWAR! BEGUN
The Hingham Institute Study Group On Space Warfare
Long before the PDP-1
- 1)
- It should demonstrate
, that is, it should show off as many of the computer's resources as possible, and tax those resources to the limit; - 2)
- Within a consistent framework, it should be interesting, which means every run should be different;
- 3)
- It should involve the onlooker in a pleasurable and active way — in short, it should be a game.
With the Fenachrone hot on our ion track, Wayne said, "Look, you need action and you need some kind of skill level. It should be a game where you have to control things moving around on the scope, like, oh, spaceships. Something like an explorer game, or a race or contest...a fight, maybe?"
"SPACEWAR!"
The basic rules developed quickly. There would be at least two
spaceships, each controlled by a set of console switches ("Gee, it
would be neat to have a joystick or something like that..."). The
ships would have a supply of rocket fuel and some sort of
The Hackers Meet SPACEWAR!
By the end of the summer of 1961, Steve Russell had returned to the Artificial Intelligence Group (he'd worked there before Littauer); consequently, whatever ideas the Study Group came up with were soon circulating among the hackers. Spacewar! was an appealing, simple concept, and the hackers were the appealingly simple people to bring it to life. First, however, there was the small matter of software.
The PDP-1 was a no-frills machine at the beginning; except for a
few diagnostic and utility routines, there was no program library. In
a way this suited the hackers just fine; here was a chance to improve
on TX-O software and to write new stuff that couldn't have been done
before. First, and fairly quickly, MACRO and FLIT were translated from TXish to PDPese, FLIT
becoming the first in a continuing line of DDT on-line debugging
programs. Steve Piner wrote a text display and editing program called
Expensive Typewriter
With the software taken care of we could write real programs, which is to say toys. Bouncing Ball was successfully converted to PDP-1 use, but HAX, for some reason, was not. But no one really missed it, because we had a brand-new toy invented by Professor Marvin Minsky. The program displayed three dots which proceeded to "interact," weaving various patterns on the scope face. As with HAX, the initializing constants were set in the console switches. Among the patterns were geometric displays, Lissajous-like figures, and "fireworks." Minsky's program title was something like "Tri-Pos: Three-Position Display," but from the beginning we never called it anything but The Minskytron. ("tron" was the In suffix of the early 1960s.)
First Steps
By the end of 1961, all the elements were in place: a brand new, available computer, a cloud of hackers, tolerant when not actively implicated employers, and an exciting idea. Slug Russell was getting the head from everyone to "do something" about Spacewar! (I was in a different department at MIT by this time, and Wayne, alas, was one of those unlucky Army Reservists called to active duty during the Berlin Wall panic in October. He never got to participate in developing his own idea.)
Russell, never one to "do something" when there was an
alternative, begged off for one reason or another. One of the excuses
for not doing it, Slug remembers, was "Oh, we don't have a
sine-cosine routine
With the heavy mathematics in hand, Slug produced the first object-in-motion program in January 1962. This was nothing more than a dot which could accelerate and change direction under switch control. Even without a hardware multiply-divide capability (on the early PDP-1s, anything stiffer than integer addition and subtraction had to be done by subroutine) the computer was clearly not being pushed.
From dot to rocket ship was a surprisingly easy step: "I realized," Slug says, "that I didn't have to worry about the speed of the sine-cosine routine, because there were only two angles involved in each frame — one for each ship. Then the idea of rotating the grid came out." The ship outlines were represented as a series of direction codes starting from the nose of the ship; when the ship was vertical and tail-down, each code pointed to one of the five possible adjacent dots could be displayed next. To display the ship at an angle, Russell calculated the appropriate sine and cosine and added them to the original direction code constants, in effect rotating the entire grid. With this method, the ship's angle had to be calculated only once in each display frame. The outline codes were kept in a table so that different shapes could be tried out at will, but this meant the table had to be searched every frame to generate the outline. As the game developed, this arrangement proved to be a sticking point which we shall see, was neatly solved by Dan Edwards.
By February, the first game was operating. It was a barebones model: just the two ships, a supply of fuel, and a store of "torpedoes" — points of light fired from the nose of the ship. Once launched, a torpedo was a ballistic missile, zooming along until it either hit something (more precisely, until it got within a minimum distance of a ship or another torpedo) or its "time fuse" caused it to self-destruct.
The classic needle and wedge space ship outlines and the
opposite-quadrant starting positions were established at this stage,
as shown in Figure 1. Acceleration was realistic; it took time to get
off the mark, and to slow down you had to reverse the ship and blast
in the other direction; the rocket exhaust was a flickering "fiery
tail."
It was apparent almost immediately that the featureless background was a liability. It was hard to gauge relative motion; you couldn't tell if the ships were drifting apart or together when they were moving slowly. What we needed, obviously, were some stars. Russell wrote in a random display of dots, and the quality of play improved. The only thing left, we thought, was hyperspace, and that was on the way. In fact, we'd just begun.
III. SPACEWAR! COMPLETE
Please keep in mind that what follows did not happen in a neat first-one-thing-and-then-the next progression, but rather all at once in a period of about six weeks. When hackers are aroused, anything that can happen will.
The Control Boxes
Spacewar! worked perfectly well from the test word switches on the console, except that the CRT was off to one side, so one player had a visual advantage. More to the point, with two excitable space warriors jammed into a space meant for one reasonably calm operator, damage to the equipment was a constant threat. At the very least, a jittery player could miss the torpedo switch and hit the start lever, obliterating the universe in one big anti-bang. A separate control device was obviously necessary, but joysticks (our original idea) were not readily available in 1962. So Alan Kotok and Robert A. Saunders, who just happened to be members of the Tech Model Railroad Club, trundled off to the TMRC room, scrabbled around the layout for a while to find odd bits of wood, wire, bakelite, and switchboard hardware, and when the hammering and sawing and soldering had ceased, there on the CRT table were the first Spacewar! control boxes (Figure 2. These boxes have long since disappeared, but the sketch is a reasonably accurate reconstruction).
The box is wood with a Bakelite top. The two switches are double-throw; the button is a silent momentary switch. Their functions are as follows:
- a.
- Rotation control. It is pushed to the left to rotate the ship counterclockwise, to the right to rotate clockwise.
- b.
- A two-function control. Pulled back it is the rocket accelerator; the rocket continues to blast as long as the switch is thrown. Pushed forward, the switch is the hyperspace control, as described below.
- c.
- The torpedo button. It had to be silent so that your opponent could not tell when you were trying to fire. (There was a fixed delay between shots "to allow the torp tubes to cool" and fire was not automatic; you had to keep pushing the button to get off a missile.)
With the control boxes, players could sit comfortably apart, each with a clear view of the screen. That, plus the carefully designed layout of the controls, improved ones playing skills considerably, making the game even more fun.
The Stars of the Heavens
One of the forces driving the dedicated hacker is the quest for elegance. It is not sufficient to write programs that work. They must also be "elegant," either in code or in function — both, if possible. An elegant program does its job as fast as possible, or is as compact as possible, or is as clever as possible in taking advantage of the particular features of the machine in which it runs, and (finally) produces its results in an aesthetically pleasing form without compromising either the results or operation of other programs associated with it.
Using data from the American Ephemeris and Nautical Almanac
The Heavy Star
Up to this point, Spacewar! was heavily biased towards motor skills and fast reflexes, with strategy counting for very little. Games tended to become nothing more than wild shootouts, which was exciting but ultimately unrewarding. Some sort of equalizer was called for.
Russell: "Dan Edwards was offended by the plain spaceships, and felt that gravity should be introduced. I pleaded innocence of numerical analysis and other things" — in other words, here's the whitewash brush and there's a section of fence — "so Dan put in the gravity calculations."
The star blazed forth from the center of the screen, its flashing rays a clear warning that it was not to be trifled with. Its gravity well encompassed all space; no matter where you were, if you did not move you would be drawn into the sun and destroyed. (As a gesture of good will towards less skillful or beginning players, a switch option turned annihilation into a sort of hyperspatial translation to the "anti-point," i.e., the four corners of the screen.)
The star did two things. It introduced a player-independent element that the game needed; when speeds were high and space was filled with missiles, it was often sheer luck that kept one from crashing into the star. It also brought the other elements of the game into focus by demanding strategy. In the presence of gravity both ships were affected by something beyond their control, but which a skillful player could use to advantage.
The first result of this new attention to strategy was the opening move in Figure 3, which was quickly dubbed the "CBS opening" because of its eye-like shape. It took a while to learn this maneuver but it soon became the standard opening among experienced players, as it generally produced the most exciting games.
The addition of gravity pushed Spacewar! over the edge of flicker-free display. To get back under the limit, Dan Edwards devised an elegant fiddle to speed up the outline display routine.
In Russell's original program, the outline tables were examined and interpreted in every display frame, an essentially redundant operation. Edwards replaced this procedure with an outline "compiler," which examined the tables at the start of a game and compiled a short program to generate the outline for each ship. This dramatically reduced calculation time, restoring the steady display and making room for the last of the original bells and whistles.
Hyperspace
While all this was going on, I was in my secret hideaway (then
known as the Electronic Systems Lab) working on the ultimate panic
button: hyperspace. The idea was that when everything else failed you
could jump into the fourth dimension and disappear. As this would
introduce an element of something very like magic into an otherwise
rational universe, the use of hyperspace had to be hedged in some
way. Our ultimate goal was a feature that, while useful, was not
entirely reliable. The machinery, we said, would be the "Mark One
Hyperfield Generators ... hadn't done a thorough job of testing ...
rushed them to the fleet" and so on. They'd be good for one or two
shots, but would deteriorate rapidly after that. They might not work
at all ("It's not my
The original hyperspace was not that elegant. "MK I unreliability" boiled down to this: you had exactly three jumps. In each jump your ship's co-ordinates were scrambled so that you never knew where you would reappear — it could be in the middle of the sun. You were gone for a discernible period of time, which gave your opponent a bit of a breather, but you came back with your original velocity and direction intact. To jump, you pushed the blast lever forward.
Hyperspace had one cute feature (well, I thought it was cute). Do you remember the Minskytron? One of its displays looked very much like a classical Bohr atom, which in those days was an overworked metaphor for anything to do with space and science-fiction. Reasoning that a ship entering hyperspace would cause a local distortion of space-time resulting in a warp-induced photonicstress emission (see how easy this is?), I made the disappearing ship leave behind a short Minskytron signature (Figure 4).
Crocks and Loose Ends
In retrospect, it is remarkable that the original Spacewar! managed to include so many features, given the limitations of our PDP-1: 4K words (about 9K bytes) of memory, an instruction cycle time of five microseconds, and a subroutine multiply-divide. It's hardly surprising, then, that we had to let a few unsatisfactory (all right, inelegant) bits go by.
The most irritating of these (and the first to be improved in later versions) was the appropriately-named Crock Explosion. Something dramatic obviously had to happen when a ship was destroyed, but we were dealing with a plain dot-matrix screen. The original control program produced a random-dot burst confined within a small square whose outlines were all too discernible (Figure 5).
This explosion was intended merely as a place-holder until something more plausible could be worked out, but after all the other features had been "inhaled," there wasn't room or time for a fancier calculation.
Similarly, the torpedoes were not quite consistent with the Spacewar! universe after the heavy star was in place. The gravity calculations for two ships was as much as the program could handle; there was no time to include half a dozen missiles as well. So the torpedoes were unaffected by the star, with the odd result that you could shoot right through it and hit something on the other side (if you weren't careful getting round the Star, it could be you). We made the usual excuses ... mumblemumble photon bombs mumblemumble ... but no one really cared.
The heavy star itself was not entirely Newtonian. The common tactic of plunging down the gravity well to gain momentum by whipping around the sun (Figure 6) gave you somewhat more energy than you were really entitled to. As this just made the game more interesting, nothing was immediately done to correct it.
IV. AFTER SPACEWAR!
The game was essentially complete by the end of April, 1962. The only further immediate work was to make Spacewar! presentable for MIT's annual Science Open House in May. A scoring facility was added so that finite matches could be played, making it easier to limit the time any one person spent at the controls. To provide for the crowds that we (accurately) anticipated, a large screen laboratory CRT was attached to the computer to function as a slave display. Perched on top of a high cabinet, it allowed a roomful of people to watch in relative comfort.
Over the summer of 1962, the original Spacewar
A Mystery, Just For Good Measure
Slug tells me that there is a Lost Version of Spacewar! There would be, of course. He says the game is pretty much like the original, but the scoring is much more impressive. After each game of a match, cumulative scores are displayed as rows of ships, like a World War II fighter pilot's tally. Slug says he saw this version for a short time on the PDP-1, but never found out who produced it or what became of it.
Twenty Years Later
The original Spacewar PDP-1 was retired in 1975 and put in storage at DEC's Northboro warehouse, where it serves as a parts source for the similar machine now on display at Digital's Computer Museum in Marlboro, MA. At this writing, DEC engineer Stan Schultz and I are trying to put the original Spacewar! back into operating condition. So far, all attempts at finding the original control boxes have been futile; we will probably build replicas (the plastic Atari joysticks we have now got no class).
Dan Edwards still works for the U.S. Government, developing
computer security systems. Alan Kotok is still a consulting engineer
with DEC. Peter Samson is now director of marketing for Systems
Concepts, Inc., in San Francisco. Bob Saunders had gone to Silicon
Valley, where
Jack Dennis is a Professor of
John McKenzie, the chief engineer, is retired, but over the past year or so has been helping to restore the TX-O and PDP-1 to life at the Computer Museum.
And what of the Hingham Institute? Wayne Wiitanen has recently
become a Senior Research Scientist at the General Motors Research
Laboratory, where he is happily designing eyes for robots. Slug,
after various adventures, is now a programmer-analyst for Interactive
Data Corp
Spacewar! itself has bred a race of noisy, garishly-colored monsters that lurk in dark caverns and infest pizza parlors, eating quarters and offering degenerate pleasures. I think I know a few former hackers who aren't the slightest bit surprised.
Acknowledgements
I was able to reach all of the original Spacewar! perpetrators, hackers and Hingham Institute Fellows alike. Not to mention Professors Dennis and Minsky, and John McKenzie. In addition, I am grateful to Marcia Baker, Professor F.J. Corbato, and Professor R. M. Fano, all of MIT, for help with dates and places, and other facts. The help was theirs; any mistakes are mine.