History & Industry
The Z-Machine and Glulx: Why Text Games Still Ship as Virtual Machines
Infocom's 1979 design kept stories separate from the machine that ran them. Two virtual machines later, the same trick is what lets a text game keep working on hardware nobody planned for.
Download a text game from an archive and you will often get a file with an unfamiliar extension — .z3, .z5, .z8, .ulx, .gblorb. Double-click it and nothing happens. It is not a program in the sense your operating system means. It is a program for a machine that does not physically exist, and running it requires a separate interpreter.
A machine designed in 1979 to not be a machine
The Z-machine was designed by Infocom and introduced in 1979, according to its Wikipedia article. It is a 16-bit virtual machine, and the article’s infobox describes it as open.
Infocom itself, per its article, was founded in 1979 as a collaboration between MIT faculty and alumni, some of whom had previously worked on a text-based adventure game called Zork. The company was later merged into Activision in June 1986 and became defunct in 1989.
The design decision that matters here is the split. A story was compiled once, to Z-machine code, and then any port of the interpreter could run that same story file. The publisher did not need to rewrite the game for each computer; it needed an interpreter for each computer.
What 16 bits cost
Wikipedia’s Glulx article says that because the Z-machine uses 16-bit integers, its RAM is limited to 64KB. The Z-Machine Standards Document 1.1 puts it more precisely: dynamic and static memory together may not exceed 64K (less 2 bytes), while a whole story file may be 128K (versions 1 to 3), 256K (versions 4 and 5) or 512K (versions 6 to 8).
That was generous for a text game in the early 1980s. For a modern story that tracks a lot of changing state, the 64K boundary on writable and static memory is the constraint Glulx was designed to relieve; read-only text and code can sit above it, which is why story files can be larger than 64K.
Glulx as the answer
Glulx is described as a 32-bit portable virtual machine intended for writing and playing interactive fiction, designed by Andrew Plotkin to relieve some of the restrictions in the Z-machine format. Because it natively supports 32-bit integers and a 32-bit address space, it allows gigabytes of memory. Glulx programs typically use the Glk API for input and output.
The same article records a practical shift: in recent years Glulx has overtaken the Z-machine in terms of published works in each format.
The compilers followed
Both formats live side by side today because a single compiler can emit either. The Glulx article notes that the Inform compiler, starting with version 6.30, can produce either Z-machine or Glulx story files. A Spanish development system called Superglús also uses Glulx, and the reference interpreter is Andrew Plotkin’s Glulxe.
That means the format is a build target, not a genre. The same source can ship as a small Z-machine file for compatibility or as a Glulx file when the story outgrows 64KB.
What the archive says about playing them
The Interactive Fiction Archive’s games index describes the situation plainly. Many thousands of works are there; some are playable in a special interpreter, including Z-code, Glulx and TADS games, while HTML, Twine, Ink and Texture games are playable in a web browser.
That is the clearest available statement of the split in the field. Parser games in the Infocom tradition need an interpreter because they are VM programs. Choice-based works in more recent formats are web pages and need only a browser.
Why anyone still does it
There are two honest reasons, and neither is nostalgia.
The first is longevity. A story compiled to a virtual machine is insulated from the operating system underneath it. Z-machine story files from the early 1980s can still be run by modern interpreters (the sources describe the format as open and widely implemented; we have not tested specific files).
The second is separation of concerns. When the author writes a story and a separate program renders it, improvements to the interpreter — better fonts, accessibility, layout, save file handling — reach every story built for that VM at once (our reasoning). When the engine is baked into the game, every game has to be updated.
Reading a file name
For practical purposes the extensions are a short legend:
.z3,.z5,.z8— Z-machine story files, numbered by version. Higher versions generally mean more capacity..ulx— a Glulx story file..gblorb— a Blorb container, which packages a story file together with its resources.
None of them is a program you install. All of them are files an interpreter opens. That single fact resolves most of the confusion people meet on first contact with the form.
Sources
- Wikipedia, “Z-machine” — https://en.wikipedia.org/wiki/Z-machine
- Wikipedia, “Glulx” — https://en.wikipedia.org/wiki/Glulx
- Wikipedia, “Infocom” — https://en.wikipedia.org/wiki/Infocom
- The Interactive Fiction Archive, games index — https://www.ifarchive.org/indexes/if-archive/games/
This article is written for: A reader who has downloaded a .z5 or .gblorb file and wants to understand what that file actually is and why it needs a separate program to run it.
AI assistance recorded as: AI draft, not edited. Review status: approved.