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