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