Web Analytics

See also ebooksgratis.com: no banners, no cookies, totally FREE.

CLASSICISTRANIERI HOME PAGE - YOUTUBE CHANNEL
Privacy Policy Cookie Policy Terms and Conditions
Inform - Wikipedia, the free encyclopedia

Inform

From Wikipedia, the free encyclopedia

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.

Contents

[edit] 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.

[edit] 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.

[edit] 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.

[edit] 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.

[edit] 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";

[edit] 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.

[edit] Further reading

[edit] 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 supported experimentally as of public build 3V01.) 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.

[edit] The Inform 7 IDE

The Inform 7 IDE on Mac OS X showing source code and the skein
Enlarge
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
Enlarge
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 walkthroughs. 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.

[edit] 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.

[edit] 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.)

[edit] 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 Front Door is a closed locked door.

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.

[edit] 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 publicly released games. Emily announced them publicly 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.

[edit] Further reading

[edit] 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 June 9, 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]
6/10N 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]
6/11N 3V01 August 2, 2006 [50]
3Z95 September 14, 2006 [51]

The "N" series libraries are modified versions of the regular Inform 6 libraries with special support for Inform 7. The first modified version, 6/10N, was actually based on parts of 6/9 as well as 6/10. The goal is to eventually merge the "N" series into the main series, producing one library that can be used with both Inform 6 and Inform 7, compiling to both Z-code and Glulx.

[edit] 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.

[edit] External links

Static Wikipedia (no images)

aa - ab - af - ak - als - am - an - ang - ar - arc - as - ast - av - ay - az - ba - bar - bat_smg - bcl - be - be_x_old - bg - bh - bi - bm - bn - bo - bpy - br - bs - bug - bxr - ca - cbk_zam - cdo - ce - ceb - ch - cho - chr - chy - co - cr - crh - cs - csb - cu - cv - cy - da - de - diq - dsb - dv - dz - ee - el - eml - en - eo - es - et - eu - ext - fa - ff - fi - fiu_vro - fj - fo - fr - frp - fur - fy - ga - gan - gd - gl - glk - gn - got - gu - gv - ha - hak - haw - he - hi - hif - ho - hr - hsb - ht - hu - hy - hz - ia - id - ie - ig - ii - ik - ilo - io - is - it - iu - ja - jbo - jv - ka - kaa - kab - kg - ki - kj - kk - kl - km - kn - ko - kr - ks - ksh - ku - kv - kw - ky - la - lad - lb - lbe - lg - li - lij - lmo - ln - lo - lt - lv - map_bms - mdf - mg - mh - mi - mk - ml - mn - mo - mr - mt - mus - my - myv - mzn - na - nah - nap - nds - nds_nl - ne - new - ng - nl - nn - no - nov - nrm - nv - ny - oc - om - or - os - pa - pag - pam - pap - pdc - pi - pih - pl - pms - ps - pt - qu - quality - rm - rmy - rn - ro - roa_rup - roa_tara - ru - rw - sa - sah - sc - scn - sco - sd - se - sg - sh - si - simple - sk - sl - sm - sn - so - sr - srn - ss - st - stq - su - sv - sw - szl - ta - te - tet - tg - th - ti - tk - tl - tlh - tn - to - tpi - tr - ts - tt - tum - tw - ty - udm - ug - uk - ur - uz - ve - vec - vi - vls - vo - wa - war - wo - wuu - xal - xh - yi - yo - za - zea - zh - zh_classical - zh_min_nan - zh_yue - zu -

Static Wikipedia 2007 (no images)

aa - ab - af - ak - als - am - an - ang - ar - arc - as - ast - av - ay - az - ba - bar - bat_smg - bcl - be - be_x_old - bg - bh - bi - bm - bn - bo - bpy - br - bs - bug - bxr - ca - cbk_zam - cdo - ce - ceb - ch - cho - chr - chy - co - cr - crh - cs - csb - cu - cv - cy - da - de - diq - dsb - dv - dz - ee - el - eml - en - eo - es - et - eu - ext - fa - ff - fi - fiu_vro - fj - fo - fr - frp - fur - fy - ga - gan - gd - gl - glk - gn - got - gu - gv - ha - hak - haw - he - hi - hif - ho - hr - hsb - ht - hu - hy - hz - ia - id - ie - ig - ii - ik - ilo - io - is - it - iu - ja - jbo - jv - ka - kaa - kab - kg - ki - kj - kk - kl - km - kn - ko - kr - ks - ksh - ku - kv - kw - ky - la - lad - lb - lbe - lg - li - lij - lmo - ln - lo - lt - lv - map_bms - mdf - mg - mh - mi - mk - ml - mn - mo - mr - mt - mus - my - myv - mzn - na - nah - nap - nds - nds_nl - ne - new - ng - nl - nn - no - nov - nrm - nv - ny - oc - om - or - os - pa - pag - pam - pap - pdc - pi - pih - pl - pms - ps - pt - qu - quality - rm - rmy - rn - ro - roa_rup - roa_tara - ru - rw - sa - sah - sc - scn - sco - sd - se - sg - sh - si - simple - sk - sl - sm - sn - so - sr - srn - ss - st - stq - su - sv - sw - szl - ta - te - tet - tg - th - ti - tk - tl - tlh - tn - to - tpi - tr - ts - tt - tum - tw - ty - udm - ug - uk - ur - uz - ve - vec - vi - vls - vo - wa - war - wo - wuu - xal - xh - yi - yo - za - zea - zh - zh_classical - zh_min_nan - zh_yue - zu -

Static Wikipedia 2006 (no images)

aa - ab - af - ak - als - am - an - ang - ar - arc - as - ast - av - ay - az - ba - bar - bat_smg - bcl - be - be_x_old - bg - bh - bi - bm - bn - bo - bpy - br - bs - bug - bxr - ca - cbk_zam - cdo - ce - ceb - ch - cho - chr - chy - co - cr - crh - cs - csb - cu - cv - cy - da - de - diq - dsb - dv - dz - ee - el - eml - eo - es - et - eu - ext - fa - ff - fi - fiu_vro - fj - fo - fr - frp - fur - fy - ga - gan - gd - gl - glk - gn - got - gu - gv - ha - hak - haw - he - hi - hif - ho - hr - hsb - ht - hu - hy - hz - ia - id - ie - ig - ii - ik - ilo - io - is - it - iu - ja - jbo - jv - ka - kaa - kab - kg - ki - kj - kk - kl - km - kn - ko - kr - ks - ksh - ku - kv - kw - ky - la - lad - lb - lbe - lg - li - lij - lmo - ln - lo - lt - lv - map_bms - mdf - mg - mh - mi - mk - ml - mn - mo - mr - mt - mus - my - myv - mzn - na - nah - nap - nds - nds_nl - ne - new - ng - nl - nn - no - nov - nrm - nv - ny - oc - om - or - os - pa - pag - pam - pap - pdc - pi - pih - pl - pms - ps - pt - qu - quality - rm - rmy - rn - ro - roa_rup - roa_tara - ru - rw - sa - sah - sc - scn - sco - sd - se - sg - sh - si - simple - sk - sl - sm - sn - so - sr - srn - ss - st - stq - su - sv - sw - szl - ta - te - tet - tg - th - ti - tk - tl - tlh - tn - to - tpi - tr - ts - tt - tum - tw - ty - udm - ug - uk - ur - uz - ve - vec - vi - vls - vo - wa - war - wo - wuu - xal - xh - yi - yo - za - zea - zh - zh_classical - zh_min_nan - zh_yue - zu

Static Wikipedia February 2008 (no images)

aa - ab - af - ak - als - am - an - ang - ar - arc - as - ast - av - ay - az - ba - bar - bat_smg - bcl - be - be_x_old - bg - bh - bi - bm - bn - bo - bpy - br - bs - bug - bxr - ca - cbk_zam - cdo - ce - ceb - ch - cho - chr - chy - co - cr - crh - cs - csb - cu - cv - cy - da - de - diq - dsb - dv - dz - ee - el - eml - en - eo - es - et - eu - ext - fa - ff - fi - fiu_vro - fj - fo - fr - frp - fur - fy - ga - gan - gd - gl - glk - gn - got - gu - gv - ha - hak - haw - he - hi - hif - ho - hr - hsb - ht - hu - hy - hz - ia - id - ie - ig - ii - ik - ilo - io - is - it - iu - ja - jbo - jv - ka - kaa - kab - kg - ki - kj - kk - kl - km - kn - ko - kr - ks - ksh - ku - kv - kw - ky - la - lad - lb - lbe - lg - li - lij - lmo - ln - lo - lt - lv - map_bms - mdf - mg - mh - mi - mk - ml - mn - mo - mr - mt - mus - my - myv - mzn - na - nah - nap - nds - nds_nl - ne - new - ng - nl - nn - no - nov - nrm - nv - ny - oc - om - or - os - pa - pag - pam - pap - pdc - pi - pih - pl - pms - ps - pt - qu - quality - rm - rmy - rn - ro - roa_rup - roa_tara - ru - rw - sa - sah - sc - scn - sco - sd - se - sg - sh - si - simple - sk - sl - sm - sn - so - sr - srn - ss - st - stq - su - sv - sw - szl - ta - te - tet - tg - th - ti - tk - tl - tlh - tn - to - tpi - tr - ts - tt - tum - tw - ty - udm - ug - uk - ur - uz - ve - vec - vi - vls - vo - wa - war - wo - wuu - xal - xh - yi - yo - za - zea - zh - zh_classical - zh_min_nan - zh_yue - zu