Inform



         


programming language and design system for interactive fiction, created in 1993 by Graham Nelson.

[Top]

Overview

The Inform system properly consists of two major components: the Inform compiler, which generates story files from Inform source code, and the Inform library, a suite of software which handles the most difficult work of parsing the player's input and keeping track of the world model. The name Inform also refers to the Inform programming language that the compiler understands.

[Top]

The Compiler

The Inform compiler generates files in Z-code (also called story files) from Inform source code. These files can then be run by any Z-code interpreter -- that is, by any program which properly emulates the Z-code virtual machine. Because there is at least one such interpreter for nearly every major and minor platform, this means that the same Z-code file can be run on a multitude of platforms with no alterations.

Andrew Plotkin created an unofficial version of Inform that is capable of generating files for the Glulx virtual machine, which removes many of the limitations of the Z-machine. He also created a compiler for both the Z-machine and Glulx. However, the Glulx virtual machine is not as widely ported. Inform 6.3, released February 29, 2004, includes official support for both virtual machines, based on Andrew Plotkin's work.

Although Inform and the Z-Machine were originally designed with interactive fiction in mind, a large number of other programs have been developed, including a BASIC interpreter, a Tetris game, and a version of the game Snake.

[Top]

The Programming Language

The Inform programming language is object oriented and procedural. A key element of the language are Objects. Objects are maintained in an object tree listing which objects hold which other objects. Objects can be moved throughout the tree. Typically top level objects represent rooms and other locations within the game. Location objects will hold objects representing the rooms contents, be they physical items, non-player characters, the player's character, or background effects. All objects can hold other objects, so a livingroom object might hold an insurancesaleman object which is holding a briefcase object which contains the insurancepaperwork object.

Here is a simple example of Inform source code.

[ Main; print "Hello World^"; ];
[Top]

The Library

The Inform system also contains the Inform library, which automates nearly all of the most difficult work involved in programming interactive fiction; specifically, it includes a parser that makes sense of the player's input, and a world model that keeps track of such things as objects (and their properties), rooms, doors, the player's inventory, etc.

Here is an example of Inform source code that makes use of the Inform library:

Include "Parser"; Include "Verblib";
[ Initialise; print "Hello World^"; location = livingroom; ];
Object livingroom "Living Room" with description "A comfortably furnished living room.", n_to kitchen, s_to frontdoor, has light; Object salesman "insurance salesman" livingroom with name 'insurance' 'salesman' 'man', description "An insurance saleman in a tacky polyester suit. He seems eager to speak to you.", before [; Listen: print "The salesman bores you with a discussion of life insurance policies. From his briefcase he pulls some paperwork which he hands to you.^"; move paperwork to player; return true; ], has animate; Object briefcase "briefcase" salesman with name 'briefcase' 'case', description "A slightly worn, black briefcase.", has container; Object insurancepaperwork "insurance paperwork" briefcase with name 'paperwork' 'papers' 'insurance' 'documents' 'forms', description "Page after page of small legalese.";
Include "Grammar";

The Inform library is not necessary to use the Inform compilier. At least one replacement library, , is available.

[Top]

Notable Games Developed in Inform

[Top]

Further Reading





  View Live Article   This article is from Wikipedia. All text is available under the terms of the GNU Free Documentation License