Bocfel Z-machine interpreter
Bocfel is an interpreter for the Z-machine. It fully supports versions 1-5, 7, and 8, and contains partial support for version 6. For detailed information on Bocfel’s operation, please consult the man page.
Bocfel can be downloaded from the downloads page.
The Z-machine was designed to run text adventure games, also known as interactive fiction. Originally the only Z-machine games were created by Infocom, the company that created the Z-machine. These include such games as Zork, The Hitchhiker’s Guide to the Galaxy, and Planetfall. Fans of the genre figured out the format of the Z-machine, allowing non-Infocom interpreters, such as this one, to be built.
After that, a compiler for the Z-machine, called Inform, was released. Initially a language meant for programmers, the latest iteration of Inform is intended to allow non-programmers to easily write interactive fiction. Thanks to Inform, hundreds of Z-machine story files have been written by enthusiasts, a number of which are of extremely high quality.
Although interactive fiction is today a rather niche genre, it has a loyal following of both players and authors, and can be explored through the following resources, among others:
- The Interactive Fiction Database
- Annual Interactive Fiction Competition
- XYZZY Awards
- The Interactive Fiction Community Forum
- The newsgroups rec.arts.int-fiction and rec.games.int-fiction
- Beyond Zork running under glktermw.
- The Mad Bomber running under garglk.
- TerpEtude running under the “dumb” interface which, despite its name, understands a bit about Unix terminals.
- Mingsheng running under garglk, showing off Unicode support.
- Plundered Hearts running under QGlk.
- Spider and Web Russian translation running under garglk, also showing off Unicode.
- Zork running under Windows Glk.
- The Dreamhold running under NanoGlk.
- Jigsaw running under Fabularium.
Some of Bocfel’s features
- Almost no platform-specific functions are used—and those that are used are optional—so almost any system with a recent C compiler should be able to build and run Bocfel.
- Makes use of Glk for input/ouput, with complete support for Gargoyle; a non-Glk “dumb” interface is also available.
- Support (assuming a font with Unicode box-drawing characters) for the character graphics font used by Beyond Zork.
- Unicode support: see, for example, Chinese characters used by Mingsheng or the Russian translation of Spider and Web.
- Multiple undo in almost all games, including those which do not natively support it.
- Full control over command recording, transcripting, and command-record playback.
- Rudimentary “cheating” support, designed to disable hunger and thirst daemons.
Only the source code to Bocfel is provided here. If you are interested in a runnable binary, Ben Cressey has integrated Bocfel into the latest version of Gargoyle as the default Z-machine interpreter.