What follows is an overview of some ways I7 can be used to generate more writerly prose, especially in the context of room descriptions. It refers to several extensions; of these, “Complex Listing” and “Plurality” are bundled with Inform and part of the standard distribution, but “Room Description Control“, “Tailored Room Description“, “Introductions“, “Assorted Text Generation“, and “Automated Drawers” are available from the I7 extensions site.
Structuring information to provide narrative focus
Sorting for importance:
The beginning and the end of any set (a list, a sentence, a paragraph) are the positions of emphasis, which means that we can use them to direct the player’s attention. Postponing information to the end of a grouping can also have a humorous or surprising effect, if that information is incongruous with the tone of what’s gone before.
“Complex Listing” exists to help with this at the low level, since it lets the author create a table and sort it on whatever ordering principles he wants, and also create delimiters however he wants.
“Room Description Control” sets the order of paragraphs in a room description. (“Room Description Control” expects to be used with a set of “writing a paragraph about” rules that specify the actual form of the output. “Tailored Room Description” is one such set.) Something similar is possible with the default implementation of looking in Inform using “locale priority”. The use of locale priorities is exemplified in the example “Priority Lab”.
Unless we’re going for a humorous effect, we probably want to avoid lists like
You can see here a broken goldfish bowl, a gold ingot, a crumpled Snickers wrapper, the King of Sweden (naked), a deck of playing cards, two used toothpicks, President Obama, a swirling transdimensional vortex, and a cotton swab.
…because this totally fails to capture the way that a person looking at the room would prioritize objects.
In general, it’s a good idea to rescue human and other sentient characters from this kind of list entirely by giving them unique “writing a paragraph about” rules that change to reflect their attitudes and behavior: this makes them seem more like people and less like pieces of the furniture. Likewise, the swirling transdimensional vortex is probably a sufficiently surprising sight to deserve its own sentence, at least.
Even with that done, though, we might want to arrange the list to put the good stuff (say, the gold ingot) at the beginning; and for this purpose one might use “Complex Listing” to mark all treasures, or all items currently valuable to a puzzle, or whatever, with scores that indicate their priority, and then sort accordingly.
The same technique can be used to invert the order and put key objects at the end, if we prefer to make them appear as a surprise:
You can see here a broken goldfish bowl, a crumpled Snickers wrapper, a deck of playing cards, two used toothpicks, a cotton swab, and a gold ingot.
Not punchy enough? We could emphasize that ingot if we wanted:
Before printing the name of the gold ingot while listing nondescript items:
say "fantastically valuable ".
which would give us
You can see here a broken goldfish bowl, a crumpled Snickers wrapper, a deck of playing cards, two used toothpicks, a cotton swab, and a fantastically valuable gold ingot.
Or we could underline the afterthought joke:
You can see a broken goldfish bowl, a deck of cards, a crumpled Snickers wrapper, a cotton swab and two used toothpicks here.
Oh! And also a gold ingot.
In the standard Inform implementation, this could be achieved as shown in the “Priority Lab” example; in “Tailored Room Description”, by tweaking the paragraph for description of “deeply dull” items to save this item for last.
Grouping: Items that are related to one another are often best presented as a group or set:
You can see here a pair of playing cards (the Jack and the Queen), a poker chip, and a five-dollar bill.
The “grouping together” activity provides a hook for this for use with the standard Inform listwriter. “Complex Listing”, by contrast, does not deal with grouping together, because this would be incompatible with the other options it offers for ordering the list of objects precisely; but an author could set the order of objects in the listing table in such a way that like items were clustered in the list.
In the larger context of room descriptions, “writing a paragraph about” is an excellent way to create pairs and grouping, as in
Jack, Flo, and Patricia are huddled in urgently whispered conversation at the foot of the patient’s bed.
The documentation on “writing a paragraph about” in the Activities chapter demonstrates this.
Picturesque effects: Sometimes when I’m going for a strong visual image, I want to structure my description to emphasize something other than the objects as objects: the lighting in the room, the sensation of clutter, an oppressive mood. The key here usually is to use a writing a paragraph rule to draw together descriptions of objects that might otherwise be described separately.
For instance, the example “Reflections” suggests a way to combine shiny objects into their own paragraph:
The radiant light of the fallen torch reflects in the surfaces of the reflecting ball and Aladdin’s lamp.
You can also see a piece of chalk, a plumbline, an abacus and a canopic jar here.
That’s as far as the example goes because it’s trying to demonstrate simply, but we could extend the idea to get rid of the “You can also see” line entirely, and replace it with a single cohesive paragraph:
The radiant light of the fallen torch reflects in the surfaces of the reflecting ball and Aladdin’s lamp. The rest of your equipment – the piece of chalk, the plumbline, the abacus and the canopic jar – is barely distinguishable against the surrounding shadow.
or, if there’s only one dull thing on the ground,
The radiant light of the fallen torch reflects in the surfaces of Aladdin’s lamp and the reflecting ball. The piece of chalk, by contrast, is barely distinguishable against the surrounding shadow.
We’d do that simply by extending our rule for writing a paragraph about a shiny thing to include the other, not-so-shiny things as well; once these are mentioned in the paragraph they will not appear again in the “You can see…” line.
Rhetorical and poetic effects
Good human-generated prose demonstrates a sense of musicality. It avoids repetition where repetition would be dull, but relies on parallel constructions for shape. It offers the reader natural places to pause. It changes tempo.
This kind of thing is very very hard to teach to a computer — it’s not always that easy to teach to humans — so what follows is just the set of things I’ve found worth doing and accessible.
Ordering for rhythm: ancient rhetoricians were interested in lists — how they were ordered for best effect, and how the elements in them were set off. A particular favorite was the tricolon crescendo, in which three items are named, each longer and more impressive than the last.
That particular flourish really only works if you know the list elements in advance, but some of the concept remains applicable even in generated prose. Clustering elements in pairs and trios rather than flat lists (“a mango and an orange, a plum and an apple and a brown Bosc pear, …”) can improve the rhythm of a long list and contribute to a sense of richness or abundance.
This is not always easy to design in a way that will sound good and is probably a technique to be used sparingly, but one way to achieve it would be to use “Complex Listing” and to change the “rule for delimiting a list” to operate differently under some circumstances. Bronze demonstrates another variation, using just the “writing a paragraph about” activity, in the section on the Black Gallery.
One could even, if appropriate, mark objects with information about the syllabic length of their names, or their phonetic qualities, and assemble listing sub-groups depending on alliteration or rhyme. But it’s hard to imagine a circumstance where that wouldn’t simply be distracting unless the work was overall written in a poetic register.
Listing with alternative delimiters: “Complex Listing” allows the author to build lists with alternative delimiters, as for instance
semicolons: “Rome; Venice; Paris; Lourdes.”
periods: “Rome. Venice. Paris. Lourdes.”
dashes: “Rome — Venice — Paris — Lourdes.”
Several settings are built-in, but the set can be extended freely.
Rhetoricians also used to talk about asyndeton and polysyndeton, the omission or over-supply of connectives. “Complex Listing” supplies these options as well:
Asyndeton: “Rome, Venice, Paris, Lourdes.” or “Rome Venice Paris Lourdes.”
Polysyndeton: “Rome and Venice and Paris and Lourdes.”
Changing list delimiters alters the pace at which the player reads. Semi-colons create stronger pauses in the reading, as is especially appropriate if the listed items are not merely names but longer phrases. Asyndeton and polysyndeton are best used sparingly; polysyndeton produces a sometimes-comical galloping effect when read aloud, while asyndeton can move quickly but bring the reader up short at the end of the list because it lacks the usual marker that the list is about to end.
Variation: avoiding repetitive sentence structures to increase a sense of greater liveliness in the prose, so that (for instance) not every supporter’s contents are introduced with the sentence “On the [foo] are…”.
“Tailored Room Description” does this by default: it picks randomly from a set of template sentences for common situations, and since these sentences are stored in tables, the tables can be amended or extended freely by the author.
Parallel construction: repetition of a structure for emphatic effect, perhaps also omitting some words that would otherwise be repeated. For instance,
The place is a shambles. On the pedestal are a fig and a cookie; on the table, a cup, a plate, an apple core and a vase; on the bed, a laptop and a camera; and as for the shelf, it supports a book and a toothpick.
Notice that we don’t repeat “are” in the clauses about the table and the bed, because the verb is held over from the first clause in the sequence. This is really another fairly cheap trick using the writing a paragraph about rules. With Inform’s default behavior, it could be written so:
Include Plurality by Emily Short.
Definition: a room is cluttered:
if it contains less than two supporters:
if every supporter supports at least two things:
Definition: a supporter is grounded if it is in the location.
Rule for writing a paragraph about a grounded supporter when the location is cluttered:
say "The place is a shambles. ";
let N be the number of grounded supporters;
let index be 0;
repeat with item running through grounded supporters:
increase index by 1;
if index is 1:
say "On [the item] [is-are a list of things on the item]; ";
otherwise if index is N:
say "and as for [the item], [it-they] supports [a list of things on the item]. ";
say "on [the item], [a list of things on the item]; ";
say "[paragraph break]".
The implementation for use with “Tailored Room Description” would be very similar, except that we’d want also to check that our supporters were “mentionable”, to make sure we weren’t referring to any that we wanted to keep concealed.
Structuring the text to show awareness of what the player already knows
Another key indicator of human-like narration is that the description contains as much information as the reader needs, but no extra information; and that it shows an awareness of what has already been revealed.
Choice of articles: using “a” or “the” correctly depending on whether we’ve already mentioned a given item during the course of that same description.
This is not too difficult assuming that we’ve been consistently tracking what has been mentioned so far during a room description. “Tailored Room Description” does this by default, and provides the phrase
To say (N - a thing) as a possibly-known item:
if N is mentioned, say "[the N]";
otherwise say "[a N]".
to be invoked when we want to be sure to use the appropriate article-state.
Concision: describing the stand-out characteristics of a scene only. For instance:
There are doors west, south, and east. The east door is closed.
This is more compact and idiomatic than
There are doors west, south, and east. The west and south doors are open. The east door is closed.
…but because of the rules of conversational implication it conveys the same information to a typical speaker of English. On the other hand, after the player has manipulated the room a bit, we might want to change to
There are doors west, south, and east. All three are closed.
There are doors west, south, and east. The west door is open.
The extension “Assorted Text Generation” supplies some tools for generating appropriate sentences of the “All three are closed” variety. It provides the (somewhat unwieldy) phrase “selection of (description) conforming to the description (a second description)”. This tells Inform to look at all the elements of the first set, count how many of those also belong to the second set, and print a descriptive phrase, which might come out to
“None of them is…”/”Neither of them is…”
“All three of them are…”
“The black door is…”
and so on, depending on what needs to be specified under the current state of the world model. We would still need to apply another layer of logic to decide whether we want to list the open doors or the closed ones, but ATG spares the work of hand-producing the subsidiary text.
“Automated Drawers” applies these rules to a rather specialized domain, namely, describing which drawers in a multi-drawer set are open. It generates text such as
The large dresser has five drawers. The top drawer and the fourth drawer are closed.
There are two tiny inlaid drawers in the table. The left drawer is open.
This may not be of much use in all instances, but it provides some sample code that might be used as a reference for other similar prose problems.
Introductions of objects: adding contextual information about objects when they’re first seen, or when the narrator/player character is inclined to point out a particular fact to the player.
The “Introductions” extension exists to help with this, allowing the author to define some introduction text to be printed as part of the room description the first time the player encounters a specific object.
First impressions for a room: Another common case is that we want to have a sentence (or a paragraph) of the viewpoint character’s first impressions of a room, to be printed at the end of the room description. The example “Saint Eligius” in the manual shows how to do this; “Introductions” offers an even easier implementation by allowing the author to create introduction text for rooms as well as for objects within a room.
Segues: moving naturally from the description of one item into the description of the next when both are present. E.g.:
Fred is no favorite with Doctor Pearson, either, which is why you’re surprised to see the old man sitting serenely in the comfy chair, sipping a vodka gimlet.
…to appear only when we’ve just described Fred’s presence in the room.
“Introductions” provides a mechanism for defining segues of this kind, using a look-up table for the two objects (the one described last and the one described next). This is especially likely to be relevant for independently moving characters, where the NPCs might be in any of a number of configurations when the player first stumbles on them.
Where the initial room description is static and the order is known to the author in advance, it would be enough simply to write this text into the initial appearance of the items, as in
The initial appearance of Doctor Pearson is "[one of]Fred is no favorite with Doctor Pearson, either, which is why you're surprised to see the old man[or]Doctor Pearson is[stopping] sitting serenely in the comfy chair, sipping a vodka gimlet."
Elaboration and discovery: Sometimes it’s worth going the other direction from the introduction technique, and have additional information that only appears when the player looks more than once (in order to streamline their first impression of a room) or to reveal information that the player has discovered in the course of play.
This is something to do carefully and sparingly, because a player who realizes he’s missing vital information in every room unless he types LOOK twice is likely to get really annoyed about it. Nonetheless, I did this with Floatpoint in some of the opening rooms, because I wanted the player to have a sense of urgency and movement, and only to see his surroundings in more detail (with which, in any case, he didn’t have to interact to win) if he deliberately stopped to explore. Several players reported enjoying the effect, so it seems to have worked in that case.
Omitting objects from the initial description can be done easily using the concealment rules with “Tailored Room Description”; or by the expedient of leaving some items out of play and moving them into the room after the first look. Bronze demonstrates a related effect with the Bellroom section, where specific bells become present as the player finds out about them.