3.1. Room Descriptions

| Chapter 3: Place |

| 3.1. Room Descriptions

The printing of a room description is a more delicate business than it might initially seem to be: Inform has to consider all the objects that the player might have brought into the room or dropped there, and all the objects on visible supporters, and decide how to group and list them.

All of this behavior is handled by the looking command, so we find the relevant rules in the carry out looking rulebook. To go through the elements step by step:

Looking begins by printing the name and description of the room we're in. We can introduce variations into room names and descriptions by changing their printed name and description properties, as in

> change the printed name of the Church to "Lightning-Struck Ruin";
> change the description of the Church to "The beams overhead have been burnt away and the pews are charred. Only the stone walls remain.";

If we need more drastic effects, we can turn off or change either of these features by altering the rules in the carry out looking rulebook. For instance, to remove the name of the location entirely from room descriptions, we would write

> The room description heading rule is not listed in the carry out looking rules.

(A word of warning: there is one other context in which the game prints a room name — when restoring a save or undoing a move. To omit the room title here too, add

> Rule for printing the name of a room: do nothing.)

Ant-Sensitive Sunglasses demonstrates how to use activities to make more flexible room description text.

Next, the game determines what items are visible to the player and need to be described. These never include the player himself, or scenery, but other things in the environment will be made "marked for listing". This is also the stage at which Inform chooses the order in which items will be listed.

We are allowed to meddle by changing the priorities of objects, in case we want some things to be described to the player first or last in the room description; Priority Lab goes into detail about how. We can also force things to be left out entirely: Low Light handles the case of an object that can only be seen when an extra lamp is switched on, even though the room is not otherwise considered dark. Copper River implements the idea of "interesting" and "dull" objects: the game determines which items are currently important to the puzzles or narrative and mentions those in the room description, while suppressing everything else.

Then Inform carries out the writing a paragraph about... activity with anything that provides one; anything it prints the name of, it tags "mentioned". Thus

> Rule for writing a paragraph about Mr Wickham:
> say "Mr Wickham looks speculatively at [list of women in the location]."

will count Wickham and everyone he looks at as all having been mentioned, and will not refer to them again through the rest of the room description. More complicated uses of writing a paragraph abound. A developed system for handling supporters that don't list contents appears in The Eye of the Idol.

Inform then prints the initial appearances of objects that are marked for listing but not already mentioned; and then it performs the listing nondescript items activity, collating the remaining objects into a paragraph like

> You can see a dog, a hen, ...

We can pre-empt items from appearing in this paragraph or change their listing by intervening with a Before listing nondescript items... rule, as in

> Before listing nondescript items when the player needs the watch:
> if the watch is marked for listing:
> say "The watch catches your eye.";
> change the watch to not marked for listing.

If we wanted the watch always to be listed this way, it would be better to give it an initial appearance, but for conditional cases, the listing nondescript items activity is a good place to intervene. For instance, Rip uses this activity to incorporate changeable or portable items into the main description text for a room when (and only when) that is appropriate.

The listing nondescript items activity also allows us to replace the "You can see..." tag with something else more fitting, if for instance we are in a dimly lit room.

When the game compiles the list of nondescript items, it adds tags such as "(open)" or "(empty)" or "(on which is a fish tank)" to the names of containers and supporters. We can suppress or change the "(empty)" tag with the printing room description details of activity, as in

> Rule for printing room description details: stop.

And we can suppress the "(open)" and "(on which is...)" sorts of tags with the "omit the contents in listing" phrase, as in

> Rule for printing the name of the bottle while not inserting or removing:
> if the bottle contains sand, say "bottle of sand";
> otherwise say "empty bottle";
> omit contents in listing.

Finally, the looking command lists visible non-scenery items that sit on scenery supporters, as in

> On the table is a folded newspaper.

These paragraphs can be manipulated with the printing the locale paragraphs description activity.

Another common thing we may want to do is change the description of a room depending on whether we've been there before (as in Slightly Wrong) or on how often we've visited (as in Infiltration). Night Sky, meanwhile, changes the description of a room when we've examined another object, so that the player's awareness of his environment is affected by other things the character knows.

See Looking for ways to change the default length of room descriptions

321
| Example Ant-Sensitive Sunglasses What are activities good for? Controlling output when we want the same action to be able to produce very flexible text depending on the state of the world -- in this case, making highly variable room description and object description text. |
WI

344
| Example Priority Lab A debugging rule useful for checking the priorities of objects about to be listed. |
WI

345
| Example Low Light An object that is only visible and manipulable when a bright light fixture is on. |
WI

343
| Example The Eye of the Idol A systematic way to allow objects in certain places to be described in the room description body text rather than in paragraphs following the room description, and to control whether supporters list their contents or not. |
WI

341
| Example Rip Van Winkle A simple way to allow objects in certain places to be described in the room description body text rather than in paragraphs following the room description. |
WI

348
| Example Copper River Manipulating room descriptions so that only interesting items are mentioned, while objects that are present but not currently useful to the player are ignored. |
WI

In a very dense environment, we might want to offer the player room descriptions in which only the currently-interesting items are mentioned, while other objects are suppressed even if they are present. In effect, this takes the idea of scenery and makes it more flexible: different things might become background objects or foreground objects at different times during play. There are a wide range of possible reasons to do this -- to shift the narrative emphasis, to change the mood of the game by highlighting different parts of the environment, to show the game from the perspective of different viewpoint characters -- but in the following example, our goal is to show the player only the objects that are currently useful for puzzles. To do this, we need some notion of what puzzles are currently available and unsolved, so we make an "unsolved" adjective; we also need to know which things solve the puzzle, so we create a "resolving" relation, to indicate which objects resolve which problems. Given that information, we can create rules about which objects in the game world are currently interesting, which are currently dull, and describe accordingly: "Copper River" Section 1 - Procedure Resolving relates various things to various things. The verb to resolve (it resolves, they resolve, it resolved, it is resolved, it is resolving) implies the resolving relation. Definition: a thing is interesting if it is not dull. Definition: a person is dull: no. Definition: a thing is dull: if it is unsolved, no; if it resolves an unsolved thing, no; yes. Definition: a supporter is dull: if it is unsolved, no; if it resolves an unsolved thing, no; if it supports an interesting thing, no; yes. Definition: a container is dull: if it is unsolved, no; if it resolves an unsolved thing, no; if it contains an interesting thing, no; yes. After choosing notable locale objects: repeat with item running through unsolved things: set the locale priority of the item to 1. For printing a locale paragraph about a dull thing (called item): now the item is mentioned. Before printing a locale paragraph about a supporter (called item): now every dull thing on the item is mentioned. Before printing a locale paragraph about a container (called item): now every dull thing on the item is mentioned. Include Plurality by Emily Short. [This provides our "is-are" forms, etc., so that we don't have to define those from scratch.] Instead of searching a supporter: if the noun supports something interesting: say "[A list of interesting things on the noun] [is-are] on [the noun]"; if the noun supports something dull: say " (alongside [a list of dull things on the noun])"; say "."; otherwise if the noun supports something dull: say "There's nothing very useful here, only [a list of dull things on the noun]."; otherwise: say "[The noun] [is-are] completely bare." Instead of searching a container: if the noun contains something interesting: say "[A list of interesting things in the noun] [is-are] in [the noun]"; if the noun contains something dull: say " (alongside [a list of dull things in the noun])"; say "."; otherwise if the noun contains something dull: say "There's nothing very useful here, only [a list of dull things in the noun]."; otherwise: say "[The noun] [is-are] completely empty." Before listing contents when not taking inventory: group dull things together. Rule for grouping together dull things: say "assorted dull items". Section 2 - Scenario World and Objects The Kitchen is a room. "Your Aunt Fiona's kitchen looks as though it has been at the eye of a glitter storm. Fine, sparkling grit dusts every surface. The appliances are slightly askew, too, as though they hadn't quite settled after a vigorous earthquake." The shelf is a scenery supporter in the Kitchen. On the shelf is a can of beans, a can of potato leek soup, and a tin of deflating powder. The cabinet is a scenery container in the Kitchen. In the cabinet is a book of matches, a bottle of descaling solution, a fish hook, and a rusty knife. It is openable and closed. The counter is a scenery supporter in the Kitchen. On the counter is an espresso machine, a blender, and a mortar. The blender and the mortar are containers. In the mortar is a pestle. Understand "countertop" as the counter. The stove is a scenery supporter in the Kitchen. The oven is part of the stove. The oven is a closed openable container. The refrigerator is a fixed in place container in the Kitchen. Understand "fridge" as the refrigerator. The description is "The refrigerator is a dull blue-green, and has a puffy, marshmallow texture on the outside, which means that it's no good for sticking magnets to. Aunt Fiona has never been willing to explain where she got it." The refrigerator is openable and closed. In the refrigerator are a bottle of ice wine, a bag of carrot sticks, and an egg. Aunt Fiona is a woman in the Kitchen. Aunt Fiona can be inflated or deflated. Aunt Fiona is inflated. "[if Aunt Fiona is inflated]Aunt Fiona stands nearby. Or perhaps 'stands' is the wrong word: she has been sort of puffed up in her own skin like a balloon, and is now propped in a corner of the room with her head lolling back[otherwise]Aunt Fiona stands -- on her own two slender legs -- at the center of the room[end if]." Every turn when Fiona is unsolved and Fiona can see the player: if a random chance of 1 in 3 succeeds: say "[one of]Aunt Fiona's eyes follow you, wide and desperate, but it doesn't look like she's able to do anything[or]Aunt Fiona is still looking reproachful[or]A faint gurgling comes from Aunt Fiona[or]Aunt Fiona makes a funny croak noise[or]Aunt Fiona is still having trouble speaking. Perhaps her throat is as swollen as the rest of her[or]Aunt Fiona twitches[stopping]." There is a thing called a salmon. Understand "fish" as the salmon. The salmon can be scaly or prepared. The salmon is scaly. The description is "[if scaly]It looks delicious, but is still covered with scales[otherwise]The salmon has been scaled and is ready to eat[end if]." Before printing the name of the salmon when the salmon is scaly: say "very scaly ". Section 3 - Scenario Puzzles Definition: Aunt Fiona is unsolved if she is inflated. Definition: the salmon is unsolved: if the salmon is off-stage, no; if the salmon is scaly, yes; no. The deflating powder resolves Aunt Fiona. Instead of putting the deflating powder on Aunt Fiona: try throwing the deflating powder at Aunt Fiona. Instead of giving the deflating powder to Aunt Fiona: try throwing the deflating powder at Aunt Fiona. Instead of throwing the deflating powder at Aunt Fiona: if Aunt Fiona is inflated: say "You toss some of the powder in Aunt Fiona's direction, and with a sudden gaseous HUFF! she returns to her usual shape and size. [paragraph break]'Well!' she says, brushing herself off. 'That was bracing!' [paragraph break]You give her an embarrassed smile, to apologize for not curing her faster."; now Aunt Fiona is deflated; increase the score by 2; otherwise: say "[one of]You throw another hefty dose of the powder at your aunt. [paragraph break]'Thank you, child,' she says, sneezing. 'But I think you've done enough now.'[or]You throw another hefty dose of the powder at your aunt. [paragraph break]'You're too kind,' she wheezes, through a cloud of glittering dust.[or]You've probably done enough with the powder.[stopping]". Every turn when Aunt Fiona is deflated and the salmon is off-stage: move the salmon to the counter; say "'At least they didn't get this,' she says, producing from somewhere on her person a fresh-caught salmon. An odd pattern around its eye sockets makes it looks comically as though it wears spectacles. 'It's the Salmon of Knowledge,' she explains casually. 'We just need to scale and cook it.'" The bottle of descaling solution resolves the salmon. Does the player mean putting the descaling solution on the fish hook: it is unlikely. Does the player mean putting the descaling solution on the salmon: it is very likely. Instead of putting the bottle of descaling solution on the salmon: if the salmon is scaly: now the salmon is prepared; say "With just a single squirt of the descaling solution (which confusingly has a picture of bathroom tiles on the label), you remove the scales from the salmon, leaving its pink flesh ready for preparation."; increase the score by 2; otherwise: say "'Don't do that,' Aunt Fiona warns you. 'Excessive applications could damage the flesh.'" Test me with "look / get powder / drop powder / look / look in cabinet / get powder / put powder on fiona / look / open cabinet / look in cabinet / get solution / open fridge / put solution in fridge / look / get solution / put solution on salmon / look".

3
| Example Slightly Wrong A room whose description changes slightly after our first visit there. |
WI

152
| Example Infiltration A room whose description changes depending on the number of times the player has visited. |
WI

147
| Example Night Sky A room which changes its description depending on whether an object has been examined. |
WI

Previous | Contents | Next