Jump to content

Inform: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
YurikBot (talk | contribs)
m robot Adding: it:Inform
Grammar, punctuation, contradiction, neutrality, and clarity fixes - also updated the release list for I7
Line 1: Line 1:
'''Inform''' is a [[programming language]] and design system for [[interactive fiction]] originally created in [[1993]] by [[Graham Nelson]]. Versions 1 through 5 came out relatively quickly between 1993 and 1996. Around 1996 Graham rewrote Inform from first principles to create version 6 ("Inform 6")[http://www.sparkynet.com/spag/backissues/SPAG44]. Version 6 has been reasonably stable and is a popular language for writing interactive fiction. In 2006 Graham released Inform 7 a new set of tools and a new language ("Natural Inform").
'''Inform''' is a [[programming language]] and design system for [[interactive fiction]] originally created in [[1993]] by [[Graham Nelson]]. Versions 1 through 5 came out relatively quickly between 1993 and 1996. Around 1996, Graham rewrote Inform from first principles to create version 6 (or "Inform 6")[http://www.sparkynet.com/spag/backissues/SPAG44]. Over the following decade, version 6 has become reasonably stable and a popular language for writing interactive fiction. In 2006, Graham released version 7, a completely new language based on principles of natural language and a new set of tools based around a book-publishing metaphor ("Inform 7" or "Natural Inform"). As of this writing, Inform 7 is still in beta, but is usable for and has been used for the release of interactive fiction.


=Inform 6=
=Inform 6=
Line 9: Line 9:
The Inform [[compiler]] generates files in [[Z-machine|Z-code]] (also called story files) from Inform [[sourcecode|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.
The Inform [[compiler]] generates files in [[Z-machine|Z-code]] (also called story files) from Inform [[sourcecode|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.
[[Andrew Plotkin]] created an unofficial version of Inform that was also capable of generating files for [[Glulx]], a virtual machine he had designed to overcome many of the limitations of the several-decades-old Z-machine. Starting with version 6.3, released [[February 29]], [[2004]], Inform 6 has included 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 programming language|BASIC]] interpreter, a [[LISP programming language|LISP]] tutorial (complete with interpreter), a [[Tetris]] game, and a version of the game Snake.
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 programming language|BASIC]] interpreter, a [[LISP programming language|LISP]] tutorial (complete with interpreter), a [[Tetris]] game, and a version of the game Snake.
Line 15: Line 15:
==The Inform 6 programming language==
==The Inform 6 programming language==


''(Note: The following description refers to Inform 6. Inform 7, currently in beta-stage of development, is almost entirely different. The code sample below is usable in Inform 7, but not without special demarcation.)''
''(Note: The following description refers to Inform 6. Inform 7, currently in beta-stage of development, is almost entirely different. The code sample below is usable in Inform 7, but not without special demarcation indicating that it is embedded legacy code.)''


The Inform programming language is [[object-oriented]] and [[procedural programming|procedural]]. A key element of the language is objects. Objects are maintained in an object tree which lists the parent-child relationships between objects. Since the parent-child relationship is often used to represent location, an object which is the parent of another object is often said to "hold" it. Objects can be moved throughout the tree. Typically, top level objects represent rooms and other locations within the game, which may hold objects representing the room's contents, be they physical items, non-player characters, the player's character, or background effects. All objects can hold other objects, so a <code>livingroom</code> object might hold an <code>insurancesaleman</code> object which is holding a <code>briefcase</code> object which contains the <code>insurancepaperwork</code> object.
The Inform programming language is [[object-oriented]] and
[[procedural programming|procedural]]. A key element of the language is objects. Objects are maintained in an object tree which lists the parent child relationships between objects. Since the parent-child relationship is often used to represent location, an object which is the parent of another object is often said to "hold" it. Objects can be moved throughout the tree. Typically top level objects represent rooms and other locations within the game, which may 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 <code>livingroom</code> object might hold an <code>insurancesaleman</code> object which is holding a <code>briefcase</code> object which contains the <code>insurancepaperwork</code>
object.


In early versions of Inform, objects were different from the notion from object-oriented programming, in that there was no such thing as a class. Later versions added support for class definitions and allowed objects to be members of classes. Objects and classes could inherit from multiple classes. Interactive fiction games typically contain many unique objects. Because of this, many objects in Inform do not inherit from any class, other than the "metaclass" Object. However, objects very frequently have attributes (boolean properties, such as <code>scenery</code> or <code>edible</code>) that are recognized by the Inform library. In other languages this would normally be implemented via inheritance.
In early versions of Inform, objects were different from the notion of objects from object-oriented programming, in that there was no such thing as a class. Later versions added support for class definitions and allowed objects to be members of classes. Objects and classes can inherit from multiple classes. Interactive fiction games typically contain many unique objects. Because of this, many objects in Inform do not inherit from any class, other than the "metaclass" Object. However, objects very frequently have attributes (boolean properties, such as <code>scenery</code> or <code>edible</code>) that are recognized by the Inform library. In other languages this would normally be implemented via inheritance.


Here is a simple example of Inform source code.
Here is a simple example of Inform source code.
Line 29: Line 27:
<nowiki>]</nowiki>;
<nowiki>]</nowiki>;


This can also be written with the word <tt>print_ret</tt> instead of <tt>print</tt> and with no '^' (which indicates a newline). <tt>print_ret</tt> also causes the routine to immediately return with the value 1. This special print statement is present because this combination is a very common thing to do when writing interactive fiction in Inform. It can even be written with no keyword at all, as a bare string as a statement is special syntax for <tt>print_ret</tt>.
This can also be written with the word <code>print_ret</code> instead of <code>print</code> and with no '^' (which indicates a newline). <code>print_ret</code> also causes the routine to immediately return with the value 1. This special print statement is present because this combination is a very common thing to do when writing interactive fiction in Inform. It can even be written with no keyword at all, as a bare string as a statement is special syntax for <code>print_ret</code>.


==The Inform 6 library==
==The Inform 6 library==
Line 35: Line 33:
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.
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.


The Inform compiler does not require the use of the Inform library. There are several replacement libraries available, such us [http://www.elvwood.org/InteractiveFiction/Platypus/ Platypus] or [[InformATE]], to code Inform in Spanish.
The Inform compiler does not require the use of the Inform library. There are several replacement libraries available, such as [http://www.elvwood.org/InteractiveFiction/Platypus/ Platypus] and [[InformATE]], a library that codes Inform in Spanish.


==Example game==
==Example game==
Line 104: Line 102:
=Inform 7 (Natural Inform)=
=Inform 7 (Natural Inform)=


On April 30th, 2006, Graham Nelson [http://groups.google.com/group/rec.arts.int-fiction/browse_thread/thread/f5919cf1b49badac/17791dfefeec46e0#17791dfefeec46e0 announced the beta release of Inform 7] to the [[rec.arts.int-fiction]] newsgroup. Inform 7 consists of three primary parts: The '''Inform 7 [[Integrated development environment|IDE]]''' with development tools specialized for testing interactive fiction, the '''Natural Inform compiler''' for the new language ("Natural Inform"), "'''The Standard Rules'''" which are the core library for Inform 7, and the compiler for Inform 6. Inform 7 also relies on the '''Inform library''' and '''Inform compiler''' from Inform 6. The programming language itself is called '''Natural Inform'''. The Natural Inform compiler compiles to Inform 6, thus Inform 6 is still required to generate [[Z-machine|Z-code]] (compiling to [[Glulx]] isn't yet supported). Inform 7 also defaults to writing [[Blorb]] files which include the actual program together with optional "cover art" and metadata intended for indexing purposes. The Inform 7 tools are currently only available for Mac OS X and Microsoft Windows.
On April 30th, 2006, Graham Nelson [http://groups.google.com/group/rec.arts.int-fiction/browse_thread/thread/f5919cf1b49badac/17791dfefeec46e0#17791dfefeec46e0 announced the beta release of Inform 7] to the [[rec.arts.int-fiction]] newsgroup. Inform 7 consists of three primary parts: The '''Inform 7 [[Integrated development environment|IDE]]''' with development tools specialized for testing interactive fiction, the '''Natural Inform compiler''' for the new language, and "'''The Standard Rules'''" which form the core library for Inform 7. The programming language itself is called '''Natural Inform'''. Inform 7 also relies on the '''Inform library''' and '''Inform compiler''' from Inform 6. The Natural Inform compiler compiles the Natural Inform source code into Inform 6 source code, which is then compiled separately by Inform 6 to generate [[Z-machine|Z-code]]. (Compiling to [[Glulx]] is not yet supported, but support is planned.) Inform 7 also defaults to writing [[Blorb]] files, archives which include the Z-code together with optional "cover art" and metadata intended for indexing purposes. The Inform 7 tools are currently only available for Mac OS X and Microsoft Windows.


==The Inform 7 IDE==
==The Inform 7 IDE==
Line 118: Line 116:
The IDE includes a built-in [[Z-code]] interpreter. The Mac OS X IDE's interpreter is based on the Zoom interpreter by [[Andrew Hunter]]. The Microsoft Windows IDE's interpreter is based on [[WinFrotz]].
The IDE includes a built-in [[Z-code]] interpreter. The Mac OS X IDE's interpreter is based on the Zoom interpreter by [[Andrew Hunter]]. The Microsoft Windows IDE's interpreter is based on [[WinFrotz]].


As the developer plays the game in the built-in interpreter his progress is tracked in the "skein" and "transcript." The skein tracks player commands as a tree of branching possibilities. This makes it easy to retry different paths in a game under development. Paths can be marked as solutions and exported as text walkthroughts. The transcript tracks both player commands and the game's responses. Correct responses from the game can be marked as "blessed." On replaying a transcript or a branch of the skein variations from the blessed version will be highlighted.
As a developer tests the game in the built-in interpreter, progress is tracked in the "skein" and "transcript" views of the IDE. The skein tracks player commands as a tree of branching possibilities. Any branch of the tree can be quickly re-followed, making it possible to retry different paths in a game under development without replaying the same portions of the game. Paths can also be annotated with notes and marked as solutions, which can be exported as text walkthroughts. The transcript, on the other hand, tracks both player commands and the game's responses. Correct responses from the game can be marked as "blessed." On replaying a transcript or a branch of the skein, variations from the blessed version will be highlighted, which can help the developer find errors.


The IDE also provides various indices into the program under development. The code is shown as a class hierarchy, a traditional IF map, and in other forms.
The IDE also provides various indices into the program under development. The code is shown as a class hierarchy, a traditional IF map, a book-like table of contents, and in other forms. Clicking items in the index jumps to the relevant source code.
Clicking items in the index jumps to the relevant source code.


The IDE presents two side-by-side panes for working in. Each pane can contain the source code being worked on, the current status of compilation, the skein, the transcript, the indices of the source code, a running version of the source code, documentation, and settings.
The IDE presents two side-by-side panes for working in. Each pane can contain the source code being worked on, the current status of compilation, the skein, the transcript, the indices of the source code, a running version of the game, documentation for Inform 7 or any installed extensions to it, or settings. The concept is to imitate an author's copybook by presenting two "facing pages" intead of a multitude of separate windows.


==The Natural Inform Compiler==
==The Natural Inform Compiler==
Line 139: Line 136:
The following is a reimplementation of the above "HELLO WIKIPEDIA" example written in Inform 7. It relies on the library known as "The Standard Rules" which are automatically included in all Inform 7 compilations.
The following is a reimplementation of the above "HELLO WIKIPEDIA" example written in Inform 7. It relies on the library known as "The Standard Rules" which are automatically included in all Inform 7 compilations.


"HELLO WIKIPEDIA" by A Wikipedia Contributor
<blockquote>
"HELLO WIKIPEDIA" by A Wikipedia Contributor<br>
The story headline is "An Interactive Example".
<br>
The story headline is "An Interactive Example".<br>
The Living Room is a room. "A comfortably furnished living room."
<br>
The Kitchen is north of the Living Room. The Front Door is south of
The Living Room is a room. "A comfortably furnished living room."
The Kitchen is north of the Living Room. The Front Door is south
the Living Room.
of the Living Room.<br>
The insurance salesman is a man in the Living Room. The description
<br>
is "An insurance salesman in a tacky polyester suit. He seems eager
The insurance salesman is a man in the Living Room. The
to speak to you." Understand "man" as the insurance salesman.
description is "An insurance salesman in a tacky polyester suit.
He seems eager to speak to you." Understand "man" as the
insurance salesman.<br>
A briefcase is carried by the insurance salesman. The description is
"A slightly worn, black briefcase." Understand "case" as the
<br>
briefcase.
A briefcase is carried by the insurance salesman. The description
is "A slightly worn, black briefcase." Understand "case" as the
The insurance paperwork is in the briefcase. The description is
briefcase.<br>
"Page after page of small legalese." Understand "papers" or
<br>
"documents" or "forms" as the paperwork.
The insurance paperwork is in the briefcase. The
description is "Page after page of small legalese." Understand
Instead of listening to the insurance salesman:
"papers" or "documents" or "forms" as the paperwork.<br>
say "The salesman bores you with a discussion of life insurance
<br>
policies. From his briefcase he pulls some paperwork which he
Instead of listening to the insurance salesman:<br>
hands to you.";
<div style="margin-left:8em;text-indent:-4em">&nbsp;&nbsp;&nbsp;&nbsp;say "The salesman bores you with a discussion of life insurance policies. From his briefcase he pulls some paperwork which he hands to you.";</div>
<div style="margin-left:8em;text-indent:-4em">&nbsp;&nbsp;&nbsp;&nbsp;now the player carries the insurance paperwork.</div>
now the player carries the insurance paperwork.
</blockquote>


==Notable games written in Inform 7==
==Notable games written in Inform 7==


* ''Mystery House Possessed''[http://www.turbulence.org/Works/mystery/games.php] (2005), by Emily Short, may be the first Inform 7 game released to be public. It was released as part of the "Mystery House Taken Over" project.
''Mystery House Possessed''[http://www.turbulence.org/Works/mystery/games.php] (2005), by Emily Short, may be the first Inform 7 game released to be public. It was released as part of the "Mystery House Taken Over" project.


* ''Bronze''[http://plover.net/~emily/Bronze/], ''Damnatio Memoriae''[http://plover.net/~emily/DM/], and ''The Reliques of Tolti-Aph''[http://plover.net/~emily/ROTA/] (2006), by Emily Short, Emily Short, and Graham Nelson respectively, were the next three publically released games. Emily announced them publically on [[March 1]], [[2006]] [http://groups.google.com/group/rec.games.int-fiction/msg/354c7965c0dea5d6].
''Bronze''[http://plover.net/~emily/Bronze/], ''Damnatio Memoriae''[http://plover.net/~emily/DM/], and ''The Reliques of Tolti-Aph''[http://plover.net/~emily/ROTA/] (2006), by Emily Short, Emily Short, and Graham Nelson respectively, were the next three publically released games. Emily announced them publically on [[March 1]], [[2006]] [http://groups.google.com/group/rec.games.int-fiction/msg/354c7965c0dea5d6].


* When the Inform 7 public beta was announced on [[April 30]], [[2006]], six "worked examples" of medium to large scale works were made available. These examples included ''Glass''[http://www.inform-fiction.org/I7Downloads/Examples/glass], ''When in Rome: Accounting for Taste''[http://www.inform-fiction.org/I7Downloads/Examples/wir1] (Part 1 of 5), ''When in Rome: Far from Home''[http://www.inform-fiction.org/I7Downloads/Examples/wir2] (Part 2 of 5), ''Bronze''[http://www.inform-fiction.org/I7Downloads/Examples/bronze], ''Damnatio Memoriae''[http://www.inform-fiction.org/I7Downloads/Examples/dm], and ''The Reliques of Tolti-Aph''[http://www.inform-fiction.org/I7Downloads/Examples/rota]. The last three had been released two months earlier. All except ''Reliques'' were written by Emily Short. ''Reliques'' was written by Graham Nelson.
When the Inform 7 public beta was announced on [[April 30]], [[2006]], six "worked examples" of medium to large scale works were made available along with their source code, including the three games previously released on March 1. These examples included ''Glass''[http://www.inform-fiction.org/I7Downloads/Examples/glass], ''When in Rome: Accounting for Taste''[http://www.inform-fiction.org/I7Downloads/Examples/wir1] (Part 1 of 5), ''When in Rome: Far from Home''[http://www.inform-fiction.org/I7Downloads/Examples/wir2] (Part 2 of 5), ''Bronze''[http://www.inform-fiction.org/I7Downloads/Examples/bronze], ''Damnatio Memoriae''[http://www.inform-fiction.org/I7Downloads/Examples/dm], and ''The Reliques of Tolti-Aph''[http://www.inform-fiction.org/I7Downloads/Examples/rota]. All except ''Reliques'' were written by Emily Short. ''Reliques'' was written by Graham Nelson.


==Further reading==
==Further reading==
Line 181: Line 177:
=History of Inform releases=
=History of Inform releases=


The Inform compiler and Library have been separately maintained and released.
The Inform 6 compiler and Library have been separately maintained and released.


{|
{|
! Original<br>Inform<br>Compiler !! <br><br>Library !! Natural<br>Inform<br>System !! <br><br>Date !! <br><br>Reference !! <br><br>Notes
! Original<br>Inform<br>Compiler<br>Version !! <br><br>Library<br>Release !! Natural<br>Inform<br>System<br>Version !! <br><br>Date !! <br><br>Reference !! <br><br>Notes
|-
|-
| 1 || || || [[May 9]], [[1993]] || [http://groups.google.com/group/rec.arts.int-fiction/msg/ac22ab84d5f6fd7d?hl=en&] || Simultaneous release of [[Curses (computer game)|Curses]].
| 1 || || || [[May 9]], [[1993]] || [http://groups.google.com/group/rec.arts.int-fiction/msg/ac22ab84d5f6fd7d?hl=en&] || Simultaneous release of [[Curses (computer game)|Curses]].
Line 261: Line 257:
|-
|-
| || || 3M43 || [[May 21]], [[2006]] || [http://www.inform-fiction.org/I7Downloads/ChangeLog.txt] ||
| || || 3M43 || [[May 21]], [[2006]] || [http://www.inform-fiction.org/I7Downloads/ChangeLog.txt] ||
|-
| || || 3P53 || [[June 9]], [[2006]] || [http://www.inform-fiction.org/I7Downloads/ChangeLog.txt] ||
|-
| || || 3R85 || [[June 26]], [[2006]] || [http://www.inform-fiction.org/I7Downloads/ChangeLog.txt] ||
|-
| || || 3T38 || [[July 10]], [[2006]] || [http://www.inform-fiction.org/I7Downloads/ChangeLog.txt] ||
|}
|}


Line 266: Line 268:


* [[Interactive Fiction]]
* [[Interactive Fiction]]
* [[TADS]] is another interactive fiction design system that is comparable to Inform in terms of power, flexibility, portability, and popularity. Another well-regarded system is [[Hugo programming language|Hugo]], though it is not nearly as widely-used as either TADS or Inform.
* [[TADS]] is another interactive fiction design system that is comparable to Inform in terms of power, flexibility, portability, and popularity.
* Another well-regarded system is [[Hugo programming language|Hugo]], though it is not nearly as widely-used as either TADS or Inform.


=External links=
=External links=
Line 272: Line 275:
* Official web site: http://www.inform-fiction.org/
* Official web site: http://www.inform-fiction.org/
* An [http://www.firthworks.com/roger/informfaq/index.html Inform FAQ] is available.
* An [http://www.firthworks.com/roger/informfaq/index.html Inform FAQ] is available.
* Many Inform tools, examples, and library files are available at [http://www.ifarchive.org/ the Interactive Fiction Archive].
* Many Inform tools, examples, and library files are available at [http://mirror.ifarchive.org/ the Interactive Fiction Archive].
* The [http://dmoz.org/Games/Video_Games/Adventure/Text_Adventures/Design_and_Development/Authoring_Systems/Inform/ Inform category] at the [[Open Directory Project]] provides links to other sites.
* The [http://dmoz.org/Games/Video_Games/Adventure/Text_Adventures/Design_and_Development/Authoring_Systems/Inform/ Inform category] at the [[Open Directory Project]] provides links to other sites.



Revision as of 21:07, 12 July 2006

Inform is a programming language and design system for interactive fiction originally created in 1993 by Graham Nelson. Versions 1 through 5 came out relatively quickly between 1993 and 1996. Around 1996, Graham rewrote Inform from first principles to create version 6 (or "Inform 6")[1]. Over the following decade, version 6 has become reasonably stable and a popular language for writing interactive fiction. In 2006, Graham released version 7, a completely new language based on principles of natural language and a new set of tools based around a book-publishing metaphor ("Inform 7" or "Natural Inform"). As of this writing, Inform 7 is still in beta, but is usable for and has been used for the release of interactive fiction.

Inform 6

The Inform 6 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.

The Inform 6 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 was also capable of generating files for Glulx, a virtual machine he had designed to overcome many of the limitations of the several-decades-old Z-machine. Starting with version 6.3, released February 29, 2004, Inform 6 has included 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 LISP tutorial (complete with interpreter), a Tetris game, and a version of the game Snake.

The Inform 6 programming language

(Note: The following description refers to Inform 6. Inform 7, currently in beta-stage of development, is almost entirely different. The code sample below is usable in Inform 7, but not without special demarcation indicating that it is embedded legacy code.)

The Inform programming language is object-oriented and procedural. A key element of the language is objects. Objects are maintained in an object tree which lists the parent-child relationships between objects. Since the parent-child relationship is often used to represent location, an object which is the parent of another object is often said to "hold" it. Objects can be moved throughout the tree. Typically, top level objects represent rooms and other locations within the game, which may hold objects representing the room's 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.

In early versions of Inform, objects were different from the notion of objects from object-oriented programming, in that there was no such thing as a class. Later versions added support for class definitions and allowed objects to be members of classes. Objects and classes can inherit from multiple classes. Interactive fiction games typically contain many unique objects. Because of this, many objects in Inform do not inherit from any class, other than the "metaclass" Object. However, objects very frequently have attributes (boolean properties, such as scenery or edible) that are recognized by the Inform library. In other languages this would normally be implemented via inheritance.

Here is a simple example of Inform source code.

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

This can also be written with the word print_ret instead of print and with no '^' (which indicates a newline). print_ret also causes the routine to immediately return with the value 1. This special print statement is present because this combination is a very common thing to do when writing interactive fiction in Inform. It can even be written with no keyword at all, as a bare string as a statement is special syntax for print_ret.

The Inform 6 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.

The Inform compiler does not require the use of the Inform library. There are several replacement libraries available, such as Platypus and InformATE, a library that codes Inform in Spanish.

Example game

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

Constant Story "HELLO WIKIPEDIA";
Constant Headline "^An Interactive Example^";

Include "Parser";
Include "VerbLib";

[ Initialise;
    location = Living_Room;
    "Hello World";
];

Object Kitchen "Kitchen";
Object Front_Door "Front Door";

Object Living_Room "Living Room"
    with
        description "A comfortably furnished living room.",
        n_to Kitchen,
        s_to Front_Door,
    has light;

Object -> Salesman "insurance salesman"
    with
        name 'insurance' 'salesman' 'man',
        description "An insurance salesman in a tacky polyester 
              suit.  He seems eager to speak to you.",
        before [;
            Listen:
                move Insurance_Paperwork to player;
                "The salesman bores you with a discussion
                 of life insurance policies.  From his
                 briefcase he pulls some paperwork which he
                 hands to you.";
        ],
    has animate;

Object -> -> Briefcase "briefcase"
    with
        name 'briefcase' 'case',
        description "A slightly worn, black briefcase.",
    has container;

Object -> -> -> Insurance_Paperwork "insurance paperwork"
    with
        name 'paperwork' 'papers' 'insurance' 'documents' 'forms',
        description "Page after page of small legalese.";

Include "Grammar";

Notable games developed in Inform 6 or earlier versions

  • Curses, by Graham Nelson, was the first major game written in Inform.
  • Galatea, by Emily Short, was a finalist for Best NPCs, finalist for Best Game and Winner of Best Individual NPC in the Xyzzy Awards 2000. A review of the game can be read here. The game focuses mostly on the interaction between the player and the single, major NPC, and the depth of all the possible reactions this NPC has.
  • Photopia, by Adam Cadre, is generally credited as being the first truly puzzleless work of interactive fiction. It placed first in the 4th Annual Interactive Fiction Competition. Its appearance was a pivotal point in the history of the medium.
  • So Far, by Andrew Plotkin. Set a precedent for the integration of story, puzzle design, and player expectations in interactive fiction.

Further reading

  • The bible of Inform is Graham Nelson's Inform Designer's Manual: it is a tutorial, a manual, and a technical document rolled into one. It is available online for free at Inform's official website, and two printed editions are available: a softcover (ISBN 0-9713119-0-0) and a hardcover (ISBN 0-9713119-3-5).
  • The Inform Beginner's Guide by Roger Firth and Sonja Kesserich attempts to provide a more gentle introduction to Inform. It is available for free at Inform's official website, and a printed edition is available at Lulu.com.

Inform 7 (Natural Inform)

On April 30th, 2006, Graham Nelson announced the beta release of Inform 7 to the rec.arts.int-fiction newsgroup. Inform 7 consists of three primary parts: The Inform 7 IDE with development tools specialized for testing interactive fiction, the Natural Inform compiler for the new language, and "The Standard Rules" which form the core library for Inform 7. The programming language itself is called Natural Inform. Inform 7 also relies on the Inform library and Inform compiler from Inform 6. The Natural Inform compiler compiles the Natural Inform source code into Inform 6 source code, which is then compiled separately by Inform 6 to generate Z-code. (Compiling to Glulx is not yet supported, but support is planned.) Inform 7 also defaults to writing Blorb files, archives which include the Z-code together with optional "cover art" and metadata intended for indexing purposes. The Inform 7 tools are currently only available for Mac OS X and Microsoft Windows.

The Inform 7 IDE

The Inform 7 IDE on Mac OS X showing source code and the skein
The Inform 7 IDE on Mac OS X showing the Index Map and the transcript

Inform 7 comes with an integrated development environment (IDE) for Mac OS X and Microsoft Windows. The Mac OS X IDE was developed by Andrew Hunter. The Microsoft Windows IDE was developed by David Kinder.

The Inform 7 IDE includes a text editor for editing Natural Inform source code. Like many other programming editors it features syntax highlighting. It marks quoted strings in one color. Headings of organizational sections (Volumes, Books, Chapters, Parts, and Sections) are bolded and made larger. Comments are set in a diffent color and made slightly smaller.

The IDE includes a built-in Z-code interpreter. The Mac OS X IDE's interpreter is based on the Zoom interpreter by Andrew Hunter. The Microsoft Windows IDE's interpreter is based on WinFrotz.

As a developer tests the game in the built-in interpreter, progress is tracked in the "skein" and "transcript" views of the IDE. The skein tracks player commands as a tree of branching possibilities. Any branch of the tree can be quickly re-followed, making it possible to retry different paths in a game under development without replaying the same portions of the game. Paths can also be annotated with notes and marked as solutions, which can be exported as text walkthroughts. The transcript, on the other hand, tracks both player commands and the game's responses. Correct responses from the game can be marked as "blessed." On replaying a transcript or a branch of the skein, variations from the blessed version will be highlighted, which can help the developer find errors.

The IDE also provides various indices into the program under development. The code is shown as a class hierarchy, a traditional IF map, a book-like table of contents, and in other forms. Clicking items in the index jumps to the relevant source code.

The IDE presents two side-by-side panes for working in. Each pane can contain the source code being worked on, the current status of compilation, the skein, the transcript, the indices of the source code, a running version of the game, documentation for Inform 7 or any installed extensions to it, or settings. The concept is to imitate an author's copybook by presenting two "facing pages" intead of a multitude of separate windows.

The Natural Inform Compiler

The Natural Inform compiler generates Inform 6 source code. Inform 6's compiler is then used to generate Z-code output.

The Natural Inform Programming Language

The arguably most important feature of Inform 7 is its programming language: Natural Inform (the name comes from the fact that it is designed to be a subset of natural English). Notable features of NI include strong bias towards declarative rule-based style of programming and ability to infer types and properties of objects from the way they are used. For example, the statement "John wears a hat." creates a "person" called "John" (since only people are capable of wearing things), creates a "thing" with the "wearable" property (since only objects marked "wearable" are capable of being worn), and sets John as wearing the hat.

Natural Inform is a highly domain-specific programming language, providing the writer/programmer with a much higher level of abstraction than Inform 6. Of note is also high readability of the resulting source code. (See example below.)

Example game

The following is a reimplementation of the above "HELLO WIKIPEDIA" example written in Inform 7. It relies on the library known as "The Standard Rules" which are automatically included in all Inform 7 compilations.

"HELLO WIKIPEDIA" by A Wikipedia Contributor

The story headline is "An Interactive Example".

The Living Room is a room. "A comfortably furnished living room."
  The Kitchen is north of the Living Room. The Front Door is south of
  the Living Room.

The insurance salesman is a man in the Living Room.  The description
  is "An insurance salesman in a tacky polyester suit.  He seems eager
  to speak to you." Understand "man" as the insurance salesman.

A briefcase is carried by the insurance salesman. The description is
  "A slightly worn, black briefcase."  Understand "case" as the
  briefcase.

The insurance paperwork is in the briefcase. The description is
  "Page after page of small legalese." Understand "papers" or
  "documents" or "forms" as the paperwork.

Instead of listening to the insurance salesman:
    say "The salesman bores you with a discussion of life insurance
      policies.  From his briefcase he pulls some paperwork which he
      hands to you.";
    now the player carries the insurance paperwork.

Notable games written in Inform 7

Mystery House Possessed[2] (2005), by Emily Short, may be the first Inform 7 game released to be public. It was released as part of the "Mystery House Taken Over" project.

Bronze[3], Damnatio Memoriae[4], and The Reliques of Tolti-Aph[5] (2006), by Emily Short, Emily Short, and Graham Nelson respectively, were the next three publically released games. Emily announced them publically on March 1, 2006 [6].

When the Inform 7 public beta was announced on April 30, 2006, six "worked examples" of medium to large scale works were made available along with their source code, including the three games previously released on March 1. These examples included Glass[7], When in Rome: Accounting for Taste[8] (Part 1 of 5), When in Rome: Far from Home[9] (Part 2 of 5), Bronze[10], Damnatio Memoriae[11], and The Reliques of Tolti-Aph[12]. All except Reliques were written by Emily Short. Reliques was written by Graham Nelson.

Further reading

History of Inform releases

The Inform 6 compiler and Library have been separately maintained and released.

Original
Inform
Compiler
Version


Library
Release
Natural
Inform
System
Version


Date


Reference


Notes
1 May 9, 1993 [13] Simultaneous release of Curses.
2 1993 [14]
3 November, 1993 [15]
4 January, 1994 [16]
5 June, 1994 [17]
5.5 June, 1995 Last of the pre-Inform 6 releases.
6 6/1 April 29, 1996 [18] beta release. Inform is rewritten from scratch.
6.02 May 5, 1996 [19] beta release
6.03 May 13, 1996 [20] beta release
6.04 6/2 September, 1996 [21] [22]
6.05 September, 1996 [23]
6.10 6/3 December 18, 1996 [24]
6.11 6/4 January 28, 1997 [25]
6.12 March 26, 1997 [26]
6.13 6/5 April 5, 1997 [27] [28]
6/6 August 18, 1997 [29]
6/6 August 19, 1997 [30] Rerelease with tracing code removed
6/7 September, 1997 [31]
6.14 September 8, 1997 [32]
6.15 March 23, 1998 [33]
6.20 December, 1996 [34]
6/8 December 13, 1998 [35]
6.21 6/9 April 29, 1999 [36]
April 29, 1999 [37] Announcement of upcoming Glulx support
6/10 November 6, 1999 [38] Original release
6/10 November 13, 1999 [39] Bugfix release
6.21.1 November 24, 2000
6.21.2 August 15, 2000
6.21.3 November 6, 2002 Included support for Glulx
6.21.4 June 17, 2003
6.30 6/11 February 4, 2004 [40]
6.30.1 February 27, 2004
6.30.2 June 6, 2004
6.31 February 10, 2006 [41]
3K27 April 30, 2006 [42] [43] Public beta
3K56 May 4, 2006 [44]
3L95 May 14, 2006 [45]
3M43 May 21, 2006 [46]
3P53 June 9, 2006 [47]
3R85 June 26, 2006 [48]
3T38 July 10, 2006 [49]

See also

  • Interactive Fiction
  • TADS is another interactive fiction design system that is comparable to Inform in terms of power, flexibility, portability, and popularity.
  • Another well-regarded system is Hugo, though it is not nearly as widely-used as either TADS or Inform.

External links