Finish adding Library routines
[inform-resources.git] / informfaq / i6-faq.md
1 Inform 6: Frequently Asked Questions
2 ====================================
3
4 By Roger Firth <roger@firthworks.com>
5
6 From <http://www.firthworks.com/roger/informfaq/>
7
8 Copyright Roger Firth. Copying and distribution, with or without
9 modification, are permitted in any medium without royalty provided the
10 copyright notice and this notice are preserved.
11
12 You're reading a set of answers to Frequently Asked Questions about
13 the Inform 6 programming language, intended especially to help those
14 who are novices in this arena.
15
16 This FAQ aims to address topics which commonly cause confusion among
17 newcomers. However, you shouldn't set your expectations too high; it
18 isn't an Inform tutorial, it pre-supposes that you've got a little
19 Inform knowledge already and it assumes at least a little knowledge of
20 computer programming. Very rarely will these answers give you the full
21 story. Generally, they're designed as introductory tasters, providing
22 just enough information to illustrate the general principles.
23
24 I'm deeply grateful to Sonja Kesserich for making this possible, and
25 for her invaluable collaborative enthusiasm in the whole enterprise.
26
27 Many people helped in the creation of this document, sometimes
28 unwittingly; my thanks for all of the assistance. The Inform FAQ was
29 originally maintained by Roger Firth.
30
31 1. Setting the scene
32 --------------------
33
34 **These topics are about understanding what Inform does, and how best
35 to learn about it:**
36
37 ### 1.1 So, what *is* Inform?
38
39 From the *Introduction to the Inform Designer's Manual*: "Inform is a
40 system for creating adventure games. It translates an author's textual
41 description into a simulated world which can be explored by readers
42 using almost any computer, with the aid of an interpreter program."
43
44 In its simplest possible form, the "author's textual description"
45 looks rather like this:
46
47       Constant Story "RUINS";
48       Constant Headline "^An Interactive Worked Example^
49                          Copyright (c) 2001 by Angela M. Horns.^";
50
51       Include "Parser";
52       Include "VerbLib";
53
54       Object  Forest "~Great Plaza~"
55         with  description
56              "Or so your notes call this low escarpment of limestone,
57               but the rainforest has claimed it back. Dark olive
58               trees crowd in on all sides, the air steams with the
59               mist of a warm recent rain, midges hang in the air.
60               ~Structure 10~ is a shambles of masonry which might
61               once have been a burial pyramid, and little survives
62               except stone-cut steps leading down into darkness below.",
63         has   light;
64
65       [ Initialise;
66           location = Forest;
67           "^^^Days of searching, days of thirsty hacking through the briars of
68           the forest, but at last your patience was rewarded. A discovery!^";
69       ];
70
71       Include "Grammar";
72
73 Needless to say, real adventure games are much more exciting -- and
74 much more complex -- than our tiny example. Nevertheless, almost all
75 games look more or less like this, and behave more or less in this
76 manner.
77
78 ### 1.2 How is Inform related to Infocom?
79
80 Infocom was the company, formed in 1979 by ex-MIT students to
81 capitalize on the popularity of Adventure and its imitators, which
82 over the following ten years created more than thirty text adventure
83 games; many of those are highly regarded, and still widely played
84 today. Infocom's games were written in a specially-devised Zork
85 Implementation Language (ZIL) and compiled by Zilch into Z-code. A
86 Z-code game could be played using a Z-machine interpreter program, and
87 many interpreters were written to run on the wide range of hobbyist
88 microcomputers then in vogue.
89
90 Eventually, text adventures fell from public favor, Infocom
91 disappeared into Activision, and the specifications of ZIL and the
92 Z-machine were lost. All that remained in general circulation were the
93 Z-code games themselves. In an astonishing feat of
94 reverse-engineering, a group of enthusiasts known as the Infocom Task
95 Force managed in the early 1990s to deduce the architecture of the
96 Z-machine by inspecting the contents of these binary (non-text) files,
97 and they documented their researches in the [Z-machine Standards
98 Document](http://www.inform-fiction.org/zmachine/standards/).
99
100 That specification made it possible to create new Z-machine
101 interpreters, and thus to play the original games on computers which
102 hadn't existed when Infocom was around. There was, however, no way to
103 create new games for the Z-machine until Graham devised Inform.
104 Although the Inform language is, at least superficially, nothing like
105 ZIL, and the Inform compiler is quite different from Zilch,
106 nevertheless the outcome of compiling a source game is the same in
107 both cases -- a file of Z-code which can be played on any Z-machine
108 interpreter. Many Inform programmers view this, the commonality of
109 Z-code between their games and the original Infocom masterpieces, as
110 one of the coolest features of the system.
111
112 ### 1.3 When did Inform appear?
113
114 The first version of Inform appeared in 1993, and the system has been
115 growing steadily in capability and usage ever since.
116
117   Version    Date       Compiler     Library
118   ---------- ---------- ---------- ---------
119   Inform 1   Apr 1993              
120   Inform 2   ??? 1993              
121   Inform 3   Nov 1993              
122   Inform 4   Jan 1994              
123   Inform 5   Jun 1994              
124              ...                   
125              Jun 1995              
126   Inform 6   Apr 1996   6.01             6/1
127              May 1996   6.02              -
128              May 1996   6.03              -
129              Sep 1996   6.04             6/2
130              Sep 1996   6.05              -
131              Dec 1996   6.10             6/3
132              Jan 1997   6.11             6/4
133              Mar 1997   6.12              -
134              Apr 1997   6.13             6/5
135              Aug 1997   -                6/6
136              Sep 1997   6.14             6/7
137              Mar 1998   6.15              -
138              Dec 1998   6.20             6/8
139              Apr 1999   6.21             6/9
140              Nov 1999   -               6/10
141              Feb 2004   6.30            6/11
142
143 Looking at this (slightly simplified) chart, you can see how Inform
144 initially evolved quite rapidly, running through five major versions
145 in its first three years. Some of those early versions were fairly
146 primitive; not until VersionĀ 6 did it settle into a form closely
147 resembling the system that we use today.
148
149 In fact, although the core system didn't change at all between 1999
150 and 2004, Inform enthusiasts continue to find ways of extending and
151 enhancing that core using a wide variety of techniques.