Skip to content
Techniques & Technology

Z-Machine

The portable text adventure engine

Infocom's virtual machine that allowed text adventures to run identically on dozens of platforms, anticipating portable runtime concepts by decades.

cross-platform virtual-machineinfocomadventureinterpreter

Overview

The Z-Machine was a virtual machine designed by Infocom for text adventure games, allowing a single game file to run on any platform with a Z-Machine interpreter. Created primarily by Marc Blank and Joel Berez, it let Infocom release games simultaneously on Apple II, Commodore 64, IBM PC, Atari, and dozens of other systems - all playing identically.

The concept anticipated Java and other portable runtimes by nearly two decades.

Fast Facts

  • Created: 1979
  • Designers: Marc Blank, Joel Berez
  • Company: Infocom
  • Versions: Z1 through Z8 (Z3 most common)
  • File extension: .z3, .z5, .z8, etc.
  • Modern use: Inform compiler targets Z-Machine

How It Worked

ComponentFunction
Story fileCompiled game data (platform-independent)
InterpreterPlatform-specific Z-Machine implementation
BytecodeInstructions for text, logic, world state
Memory modelEfficient use of limited RAM

Write the game once, compile to Z-Machine bytecode, run anywhere.

Technical Features

What the Z-Machine provided:

FeatureImplementation
Text handlingString compression, printing
ParserTokenisation support
Object modelRooms, items, NPCs
VariablesLocal and global state
StackSubroutine calls
I/OPlatform-abstracted input/output

Platform Support

Infocom released interpreters for:

  • Apple II, IIe, IIc
  • Commodore 64
  • Commodore 128
  • IBM PC and compatibles
  • Atari 400/800
  • Atari ST
  • Amiga
  • Macintosh
  • TRS-80
  • CP/M systems
  • Many more (25+ platforms total)

Version History

VersionYearCapability
Z11979Original (Zork)
Z21980Improved
Z31982Standard Infocom games
Z41985Larger games (A Mind Forever Voyaging)
Z51987Beyond Zork features
Z61988Graphics (Zork Zero)
Z8N/AExtended (community)

Modern Relevance

The Z-Machine lives on:

  • Inform 6/7 - Modern IF compilers target Z-Machine
  • Frotz - Popular modern interpreter
  • ZILF - Recreation of Infocom’s ZIL
  • Thousands of games - New Z-Machine games still created

Comparison to Modern Runtimes

Z-Machine (1979)Java (1995)
Write once, run anywhereSame concept
BytecodeBytecode
Platform-specific interpreterJVM
Efficient memory useGarbage collection

Infocom solved the portability problem early.

Why It Mattered

The Z-Machine enabled:

  • Business model - One development, many platforms
  • Quality control - Same game everywhere
  • Focus - Designers could ignore hardware
  • Legacy - Games still playable today

See Also