Software that Inspires Us: The Z-Machine
Welcome to Software that Inspires Us: a blog series that explores programs from the history of computing that have lessons for us in the present. My first topic is the Z-Machine, an ingenious adaptation to the computer market of the 1980s that is still a relevant example of adaptability in the 2020s.
Infocom and Zork
In 1979, the founders of Infocom had a problem. Eager to commercialize the fruits of their research at MIT's Laboratory for Computer Science, they needed revenue soon to fund their ambitious plans for business computing software. Four of the founders had been the authors of an adventure game, Zork, that had spread through the informal networks of academic computing to dozens, if not hundreds of institutions. Maybe that could be their first product?
It would be a daunting technical challenge. Zork was written for the PDP-10 mainframe computer common in research at the time, and it used a then-staggering 1 MB of RAM when in use. Many computer administrators had banned its use during business hours just to keep the RAM free. Fitting this on a microcomputer with at most 48KB of RAM would be impossible in its current form.
Moreover, they had another big question to ask about a microcomputer conversion: which computer would they build for? The computer market of the late 1970s and early 1980s was a fractured mess of incompatible computer architectures, with several more joining the market every year. If you picked the wrong computer to develop for, you might fail along with the computer through no fault of your own.
The solution the Infocom founders chose was to write their own virtual machine, tailored for the purpose of writing text adventures. This "Z-machine" would then need to be ported once to each computer and all of Infocom's game software would run without modification. This also allowed the founders to keep their comfortable PDP-10 development environment; for all their commercial ambitions none of them were particularly excited by actually programming the primitive 8-bit microcomputers of the day.
With a stop at the popular PDP-11 minicomputer, the first Zork game came out on the TRS-80 and Apple II in 1980, and was soon a major hit for Infocom, transforming them into a major game developer. Ports for virtually all computers of the time soon followed, alongside a variety of new games written for the Z-machine.
What is the Z-Machine?
The Z-machine was not the first virtual machine targeting microcomputers, but it perhaps the first commercially successful one. In the harshly resource-constrained environments of early microcomputers, the penalty of running the virtual machine could be very high in both space and speed. The Z-machine succeeded where others had failed because it is a specialized virtual machine, for an application domain where the disadvantages of the VM could be
minimized.
Text adventures were a fertile domain for VMs for several reasons:
- The requirements of a text adventure match easily to the capabilities of many machines. All the Z-Machine needed to function was text output, text input, and a floppy disk drive for the game data.
- Text adventure games do not require quick response times or heavy processing, making the overhead of interpreting the instructions less problematic.
- Many of the basic primitives for building games could be built into the VM itself, thus using fast native code rather than interpreted operations.
The special-purpose VM also allowed the code of the games themselves to become simpler and more compact. Infocom was able to squeeze roughly half of the PDP-10 Zork game into the first commercial release, which ran on computers with 48 KB of RAM and less than 100KB of floppy disk space.
Why is it inspiring?
The use of the Z-Machine allowed Infocom to convert the problem of publishing M games for N platforms from needing to build M*N programs to just building M story files and N virtual machines. This was a major commercial advantage in the early microcomputer world; porting the whole catalogue of Infocom games to a new machine was similar effort to merely porting one. This allowed them to get a head start on other publishers for new machines; for instance, Infocom was the only games developer to have working products for the Macintosh at its
initial launch.
While Infocom went out of business in 1989, the Z-machine actually lives on to this day as a platform for independent adventure game development. The VM was reverse engineered in the early 1990s and a new, open source authoring language, Inform, was released. New Z-machine interpreters followed, and now these titles are compatible with virtually every computer available, including mobile devices.
What reservations do we have?
The technical strategy behind Infocom's early 1980s success saw diminishing returns as the 1980s continued. New computers were more and more often compatible with earlier machines, and new incompatible standards would fail completely in the market. By 1985 the ability to run on new incompatible computers as they arrived on the market was essentially useless.
Furthermore, the late 1980s would see the end of most of the existing computers in the face of more and more capable PC clones. By 1990 there were at most four commercially viable platforms left, and by 1995 there were just two: PC and Mac. With the game developers at Infocom comfortably ensconced in their PDP-10 environment, they did not notice this change in the microcomputer market until too late. This affected their attempts to enter the business software even more negatively than their games business. The pioneering database program Infocom released, called Cornerstone, was drastically slowed by its virtual machine but only ever shipped for IBM PC and compatibles, thereby failing in the marketplace.
At the same time, a different challenge was showing the limits of the Z-machine technology: graphics. By 1987, text-only games were no longer the desirable products they were in the early days of personal computing. Generations of computer had appeared with ever better graphical capabilities; even the PC gaming world was beginning to reach out of the barely-acceptable CGA standard into the lusher environments of EGA and VGA.
Integrating graphics into the virtual machine was a difficult process. The development process would need to leave the text-based PDP-10 and use graphically capable workstations such as the Macintosh II instead. Finding an acceptable cross-platform graphics standard would leave many of the more capable machines with primitive-looking visuals that would hardly be more marketable than text-only. Infocom attempted all this with version 6 of the Z-machine but it was not commercially successful.
In Summary
We are inspired by the Z-Machine as an example of how the right technology can expand a product's reach beyond a simple niche and into every place people might look for it. For example, a design goal for The Ops Platform is to meet people where they are, whether that is on the command line, in Slack, or in somewhere yet to be determined.
At the same time, the example of Infocom and the Z-Machine teaches us that a technical strength can become a weakness through changes in context. The end of the 8-bit era meant the end of incompatibility as the default assumption for every new computer, which made incremental improvements in capability much more prevalent and expected. We know from this not to underestimate shifts in the technology market, since they can render you irrelevant faster than you think.