Quetzal file format

Last updated
Quetzal
Filename extension .sav, .glksave
Internet media type application/x-glksave
Magic number IFZS
Developed byMartin Frost
Latest release
1.4
(November 13, 1997;24 years ago (1997-11-13))
Type of format Z-machine save game
Container for Z-machine state
Extended from Interchange File Format
Standard inform-fiction.org
Open format?Yes

Quetzal is a standardised file format for the saved state of Z-machine games, invented by Martin Frost. Prior to the introduction of Quetzal, each Z-machine interpreter saved games in its own format; Quetzal enabled players to save a game using one interpreter and restore it with another. Use of the format is strongly recommended in Graham Nelson's Z-machine standards document, but not obligatory. Most modern Z-machine interpreters have the ability to save Quetzal files.

The files are IFF files with a FORM of "IFZS" (presumably standing for "Interactive Fiction Z-machine Save"), although the saved files are commonly given an extension of ".sav": less commonly sighted are "quz" and "qtz". Despite the reference to the Z-machine in the FORM code, the format has proved flexible enough to be adapted for at least one alternative architecture, Glulx.

The magic-number reading of the files are often shown as:

'IFF data, Z-machine or Glulx saved game file (Quetzal)'

A backronym for the format is "Quetzal Unifies Efficiently The Z-Machine Archive Language".

Version 1.3b, which was widely available, contained a bug later corrected in version 1.4: after a save instruction, the Z-machine requires that a success code is saved in a particular place (which differs depending on the version). Versions of the Quetzal standard before 1.4 have reference only to the instruction after the save, which complicates finding the correct place to put the success code.

Related Research Articles

Interactive fiction Nonlinear narratives set by audience decisions

Interactive fiction, often abbreviated IF, is software simulating environments in which players use text commands to control characters and influence the environment. Works in this form can be understood as literary narratives, either in the form of interactive narratives or interactive narrations. These works can also be understood as a form of video game, either in the form of an adventure game or role-playing game. In common usage, the term refers to text adventures, a type of adventure game where the entire interface can be "text-only", however, graphical text adventures still fall under the text adventure category if the main way to interact with the game is by typing text. Some users of the term distinguish between interactive fiction, known as "Puzzle-free", that focuses on narrative, and "text adventures" that focus on puzzles.

Java virtual machine Virtual machine

A Java virtual machine (JVM) is a virtual machine that enables a computer to run Java programs as well as programs written in other languages that are also compiled to Java bytecode. The JVM is detailed by a specification that formally describes what is required in a JVM implementation. Having a specification ensures interoperability of Java programs across different implementations so that program authors using the Java Development Kit (JDK) need not worry about idiosyncrasies of the underlying hardware platform.

The Z-machine is a virtual machine that was developed by Joel Berez and Marc Blank in 1979 and used by Infocom for its text adventure games. Infocom compiled game code to files containing Z-machine instructions and could therefore port its text adventures to a new platform simply by writing a Z-machine implementation for that platform. With the large number of incompatible home computer systems in use at the time, this was an important advantage over using native code or developing a compiler for each system.

Interpreter (computing) Program that executes source code without a separate compilation step

In computer science, an interpreter is a computer program that directly executes instructions written in a programming or scripting language, without requiring them previously to have been compiled into a machine language program. An interpreter generally uses one of the following strategies for program execution:

  1. Parse the source code and perform its behavior directly;
  2. Translate source code into some efficient intermediate representation or object code and immediately execute that;
  3. Explicitly execute stored precompiled code made by a compiler which is part of the interpreter system.

Interchange File Format (IFF), is a generic container file format originally introduced by the Electronic Arts company in 1985 in order to facilitate transfer of data between software produced by different companies.

Bytecode, also termed p-code, is a form of instruction set designed for efficient execution by a software interpreter. Unlike human-readable source code, bytecodes are compact numeric codes, constants, and references that encode the result of compiler parsing and performing semantic analysis of things like type, scope, and nesting depths of program objects.

Inform is a programming language and design system for interactive fiction originally created in 1993 by Graham Nelson. Inform can generate programs designed for the Z-code or Glulx virtual machines. Versions 1 through 5 were released between 1993 and 1996. Around 1996, Nelson rewrote Inform from first principles to create version 6 . Over the following decade, version 6 became reasonably stable and a popular language for writing interactive fiction. In 2006, Nelson released Inform 7, a completely new language based on principles of natural language and a new set of tools based around a book-publishing metaphor.

Locomotive BASIC

Locomotive Basic is a proprietary dialect of the BASIC programming language written by Locomotive Software on the Amstrad CPC and the later Locomotive BASIC-2 as a GEM application on the Amstrad PC1512 and 1640. It was the main descendant of Mallard BASIC, the interpreter for CP/M supplied with the Amstrad PCW.

In computer programming, the term magic number has multiple meanings. It could refer to one or more of the following:

Glulx is a 32-bit portable virtual machine intended for writing and playing interactive fiction. It was designed by Andrew Plotkin to relieve some of the restrictions in the venerable Z-machine format. For example, the Z-machine provides native support for 16-bit integers, while Glulx natively supports 32-bit integers.

Dartmouth BASIC is the original version of the BASIC programming language. It was designed by two professors at Dartmouth College, John G. Kemeny and Thomas E. Kurtz. With the underlying Dartmouth Time Sharing System (DTSS), it offered an interactive programming environment to all undergraduates as well as the larger university community.

COM file

A COM file is a type of simple executable file. On the Digital Equipment Corporation (DEC) VAX operating systems of the 1970s, .COM was used as a filename extension for text files containing commands to be issued to the operating system. With the introduction of Digital Research's CP/M, the type of files commonly associated with COM extension changed to that of executable files. This convention was later carried over to DOS. Even when complemented by the more general EXE file format for executables, the compact COM files remained viable and frequently used under DOS.

Andrew Plotkin Interactive fiction programmer and writer

Andrew Plotkin, also known as Zarf, is a central figure in the modern interactive fiction (IF) community. Having both written a number of award-winning games and developed a range of new file formats, interpreters, and other utilities for the design, production, and running of IF games, Plotkin is widely recognised for both his creative and his technical contributions to the homebrew IF scene.

A FourCC is a sequence of four bytes used to uniquely identify data formats. It originated from the OSType or ResType metadata system used in classic Mac OS and was adopted for the Amiga/Electronic Arts Interchange File Format and derivatives. The idea was later reused to identify compressed data types in QuickTime and DirectShow.

Blorb is a package format for interactive fiction games. Many such games incorporate resources such as sound effects, music, or pictures. Blorb's purpose is to bind these together into one file. The format was devised by Andrew Plotkin and is used in both the Z-machine and Glulx virtual machines, as well as by the Glk library.

MBASIC is the Microsoft BASIC implementation of BASIC for the CP/M operating system. MBASIC is a descendant of the original Altair BASIC interpreters that were among Microsoft's first products. MBASIC was one of the two versions of BASIC bundled with the Osborne 1 computer. The name "MBASIC" is derived from the disk file name MBASIC.COM of the BASIC interpreter.

Hunk is the executable file format of tools and programs of the Amiga Operating System based on Motorola 68000 CPU and other processors of the same family. This kind of executable got its name from the fact that the software programmed on Amiga is divided in its internal structure into many pieces called hunks, in which every portion could contain either code or data.

Dalvik is a discontinued process virtual machine (VM) in Android operating system that executes applications written for Android. Dalvik was an integral part of the Android software stack in the Android versions 4.4 "KitKat" and earlier, which were commonly used on mobile devices such as mobile phones and tablet computers, and more in some devices such as smart TVs and wearables. Dalvik is open-source software, originally written by Dan Bornstein, who named it after the fishing village of Dalvík in Eyjafjörður, Iceland.

A file format is a standard way that information is encoded for storage in a computer file. It specifies how bits are used to encode information in a digital storage medium. File formats may be either proprietary or free and may be either unpublished or open.