Initial content.
[ibg.git] / chapters / 01.rst
1 ======================================
2  1: Just what is interactive fiction?
3 ======================================
4
5 .. epigraph::
6
7    | *A was an archer, who shot at a frog;*
8    | *B was a butcher, who had a great dog.*
9
10 Before we start learning to use the Inform system, it's probably sensible
11 to consider briefly how IF, which has many narrative elements, differs from
12 regular storytelling.  Before we do *that*, though, let's look at an example
13 of a familiar folk tale.
14
15     "There was once a man called Wilhelm Tell, from high in the he lived by
16     his skills Swiss Alps near the town Altdorf.  A hunter and a guide,
17     proud mountaineer, in tracking and archery.  It happened one day that
18     Wilhelm visited the town to buy provisions, and he took his son Walter
19     with him.
20
21     The region was at the time governed by Hermann Gessler (a vain and
22     petty man appointed as vogt by the Austrian emperor), who attempted a
23     show of power over his subjects by placing his hat on a pole in the
24     town square, for everyone to salute.  Reluctant citizens were
25     "encouraged" by a troop of the vogt's soldiers, who made sure that
26     their bows were sufficiently respectful.
27
28     Wilhelm knew of the hat, and of the humiliating exercise in obeisance.
29     So far he had managed to avoid the town's square, sure that -- given
30     his open dislike for the vogt -- his refusal to bend the knee would
31     cause trouble.  Today, however, he needed to pass near the pole to
32     reach Johansson's tannery.
33
34     If Wilhelm had hoped for a lucky break, we'll never know.  The square
35     was filled with market-day crowds; the soldiers were especially keen in
36     their salute- enforcing duties, challenging everyone with loud shouts
37     and the occasional coarse expletive.  Wilhelm threw a protective arm
38     over his son's shoulder and walked determinedly without looking at the
39     pole or the guards.
40
41     A soldier called to him; Wilhelm took no notice.  Other guards focused
42     their attention on the archer.  "Salute the vogt's hat," he was told.
43     A tense silence followed.  Wilhelm tried to keep going, but by now he
44     was surrounded.  The men knew of him; one counselled Wilhelm to give a
45     cursory nod towards the hat and be done.  Everybody in the vicinity was
46     watching, so the disrespect could not be ignored.  There was a long
47     pause.  Wilhelm refused.
48
49     Word was sent to Gessler, who rushed to the square with reinforcements.
50     The little man was delighted at the chance of making an example of the
51     trouble-maker.  He mockingly recounted the many skills of Herr Tell,
52     speculating that such mastery maybe accounted for the pride that
53     prevented acknowledgement of the Emperor's authority.  The vogt
54     understood all that, and would give him a fair chance.  If Wilhelm were
55     able to shoot true at an apple from fifty paces, Gessler would be
56     inclined to show mercy; however, to make things interesting, the apple
57     was to be balanced on Walter's head.
58
59     Everything was set up.  Wilhelm selected and mounted an arrow and
60     slowly raised the bow, conscious of the motionless and brave stance
61     that Walter was displaying.  He pulled, feeling the tension mount on
62     the string and his fingers, through his hands, into his arms.  He'd
63     made much more difficult shots in the past, at fleeting deer, at
64     soaring birds; but this was the life of his son...  he could not fail,
65     would not fail.
66
67     Wilhelm let loose.  The arrow flew straight and true, violently pinning
68     the apple to the tree behind the boy.  The crowd exploded in a roar of
69     relief and admiration, and Gessler, disappointed, had no option but to
70     let them go.
71
72     Years later, Wilhelm led an uprising against the vogt... but that's
73     another story."
74
75 And now an extract from the same tale, this time in the form of a tiny text
76 adventure game.  If you're new to interaction with text adventures you'll
77 find some general instructions in "How to play an IF game" on page 209, and
78 you can see a complete transcript of the game in the "William Tell" story
79 on page 219::
80
81      A street in Altdorf
82      The narrow street runs north towards the town square.  Local folk are
83      pouring into the town through the gate to the south, shouting
84      greetings, offering produce for sale, exchanging news, enquiring with
85      exaggerated disbelief about the prices of the goods displayed by
86      merchants whose stalls make progress even more difficult.
87
88      "Stay close to me, son," you say, "or you'll get lost among all these
89      people."
90
91      >GO NORTH
92
93      Further along the street
94      People are still pushing and shoving their way from the southern gate
95      towards the town square, just a little further north.  You recognise
96      the owner of a fruit and vegetable stall.
97
98      Helga pauses from sorting potatoes to give you a cheery wave.
99
100      "Hello, Wilhelm, it's a fine day for trade!  Is this young Walter?
101      My, how he's grown.  Here's an apple for him -- tell him to mind that
102      scabby part, but the rest's good enough.  How's Frau Tell?  Give her
103      my best wishes."
104
105      >INVENTORY
106      You are carrying:
107        an apple
108        a quiver (being worn)
109          three arrows
110        a bow
111
112      >TALK TO HELGA
113      You warmly thank Helga for the apple.
114
115      >GIVE THE APPLE TO WALTER
116      "Thank you, Papa."
117
118      >NORTH
119
120      South side of the square
121      The narrow street to the south has opened onto the town square, and
122      resumes at the far side of this cobbled meeting place.  To continue
123      along the street towards your destination -- Johansson's tannery --
124      you must walk north across the square, in the middle of which you see
125      Gessler's hat set on that loathsome pole.  If you go on, there's no
126      way you can avoid passing it.  Imperial soldiers jostle rudely through
127      the throng, pushing, kicking and swearing loudly.
128
129      ...
130
131 Some of the more obvious differences are highlighted by these questions:
132
133 *   Who is the protagonist?
134
135     Our example of narrative prose is written in the third person; it
136     refers to the hero as "Wilhelm" and "he" and "him", watching and
137     reporting on his activities from afar.  In this sample IF game, you are
138     the hero, seeing everything through Wilhelm's eyes.
139
140 *   What happens next?
141
142     The regular narrative is intended to be read once, straight through
143     from beginning to end.  Unless you didn't pay attention the first time,
144     or you're planning to critique the story, there's generally no need to
145     go back and read a sentence twice; if you do, you'll find exactly the
146     same text.  The author leads the way and sets the pace; you, as the
147     reader, just go along for the ride.  In IF, that's usually much less
148     true.  The author has created a landscape and populated it with
149     characters, but you choose how and when to explore it.  The game
150     evolves, at least superficially, under your control; perhaps you
151     explore the street first and then the square, perhaps the other way
152     round.  There usually are multiple paths to be found and followed --
153     and you can be pretty certain that you won't discover them all, at
154     least on first acquaintance.
155
156 *   How does it all turn out?
157
158     You can tell when you've come to the end of a regular narrative -- you
159     read the last sentence, and you know there's no more.  In IF, it's
160     clear enough when you reach an end; what's much less apparent is
161     whether that's the only conclusion.  In the transcript from the example
162     game, you win by shooting the apple from Walter's head.  But what if
163     you miss?  What if you hit him by mistake?  Or fire instead at the
164     hated vogt?  Or even stand the tale on its head by bowing obsequiously
165     to the governor's hat and then going about your business?  All of these
166     are possible ways in which the game could come to an end.  The phrase
167     "what if" is the key to writing successfully, and should always be in
168     the forefront of an IF designer's mind.
169
170 *   Where did Helga come from?
171
172     You'll notice that Helga and her stall don't appear in the regular
173     narrative; she's a distraction from the tale's momentum.  But in the IF
174     game, she fulfils a number of useful functions: mentioning the names
175     "Wilhelm", "Walter" and "Frau Tell" (so that you know who the tale's
176     about), introducing the all-important apple in a natural manner and,
177     above all, providing an opportunity for the "I" in IF -- some
178     interactivity.  Without that -- the chance to interact with the tale's
179     environment -- the game is little different from a conventional piece
180     of fiction.
181
182 *   That item looks interesting; can you tell me more about it?
183
184     In the regular narrative, what you see is what you get; if you want to
185     know more about alpine life in the fourteenth century, you'll need to
186     consult another source.  IF, on the other hand, offers at least the
187     possibility of delving deeper, of investigating in greater detail an
188     item which has been casually mentioned.  For example, you could have
189     explored Helga's stall::
190
191            " ... How's Frau Tell?  Give her my best wishes."
192
193            >EXAMINE THE STALL
194            It's really only a small table, with a big heap of potatoes,
195            some carrots and turnips, and a few apples.
196
197            >EXAMINE THE CARROTS
198            Fine locally grown produce.
199
200     You see those descriptions only if you seek them; nothing you find
201     there is unexpected, and if you don't examine the stall, you've not
202     missed anything important.  Nevertheless, you've enhanced the illusion
203     that you're visiting a real place.  Such details would rapidly grow
204     tedious if the stall and its contents were described in full each time
205     that you pass them.
206
207 *   How do I work this thing?
208
209     Whereas the presence of Helga is an elaboration of the folk tale, the
210     shooting of the arrow (it's in the transcript in "William Tell" story
211     on page 219, not in the extract above) illustrates the opposite
212     principle: simplification.  The tale builds dramatic tension by
213     describing each step as Wilhelm prepares to shoot the apple.  That's
214     OK; he's been an archer all his life, and knows how to do it.  You, on
215     the other hand, probably know little about archery, and shouldn't be
216     expected to guess at the process and vocabulary.  Let's hope you know
217     that you need to shoot at the apple -- and that's all it takes.  The
218     game explains what was involved, but doesn't force you through each
219     mundane step.
220
221 Of course, all of these are generalisations, not universal truths; you
222 could find fine works of IF which contradict each observation.  However,
223 for our purposes as beginners in the craft of IF design, they represent
224 useful distinctions between IF and conventional fiction.
225
226 We'll come back to the "William Tell" tale in a later chapter, but before
227 then we'll work through an even simpler example.  And before either of
228 those, we need to download the necessary files which will enable us to
229 write Inform games.