A Z-machine for the modern world
The Z-machine is the virtual machine Infocom built in 1979 so one game could run on many computers: write the story once, port only the interpreter. Zork, Planetfall and the rest of the Infocom catalog are Z-machine story files. rezrov-zmachine is an interpreter for them, written in TypeScript with a clean separation between the core, the screen, storage and parsing, so it can be dropped into other projects.
It began as a port and modernization of Chris Toshok's ebozz interpreter, and it is the engine behind my Frotz Bot. It is not related to another Z-machine interpreter that is also called Rezrov, which is why this one goes by its full name, rezrov-zmachine.
What it does
- Runs Z-machine versions 1 to 4 completely. Version 5 mostly works and is still being checked against Beyond Zork, and version 6 is partial: Zork Zero is playable in the web example.
- Saves and restores in the standard Quetzal format, so saves can move between interpreters, with filesystem, browser and in-memory storage.
- Promise-based, with interfaces for your own screen and storage, and a 10-level undo.
- Ships three working examples: a basic console, a split-window terminal UI, and a browser client with pictures and sound.
Try it
npm install @random-lunacy/rezrov-zmachine
It needs Node.js 22.12 or later, is ESM-only, and ships its own type declarations. The README covers the API and the examples. Story files are not included; you supply your own.