3. Place

Recipe Book

RB §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

now the printed name of the Church is "Lightning-Struck Ruin";
now the description of the Church is "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 story 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 story 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 story 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.";
      now the watch is 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 story 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 description activity and the printing a locale paragraph about 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 Also

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

Examples

147.
A room which changes its description depending on whether an object has been examined.
152.
A room whose description changes depending on the number of times the player has visited.
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.
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.
358.
A debugging rule useful for checking the priorities of objects about to be listed.
359.
An object that is only visible and manipulable when a bright light fixture is on.
4.
A room whose description changes slightly after our first visit there.
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.
362.
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.

RB §3.2 Map

A work of IF contains many spectacles and activities, and these must not all present themselves at once, or the player will be overwhelmed. One way to spread them out is in time, by having them available only as a plot develops, but another is to spread them out literally in space. The player has to walk between the Library and the Swimming Pool, and thus bookish and athletic tasks are not both presenting themselves at once. There have been valiant "one-room" IFs, and it forms a respectable sub-genre of the art, but most works of any size need a map.

Inform, following IF conventions, divides the world up into locations called "rooms", connected together by so-called "map connections" along compass bearings. Thus:

The Library is east of the Swimming Pool.

The example Port Royal develops a medium-sized map from such sentences. This develops in Port Royal 2 to include connections which bend around, allowing the rooms not to lie on an imaginary square grid.

Because it is useful to group rooms together under names describing whole areas, Inform also allows rooms to be placed in "regions". Thus:

The Campus Area is a region. The Library and the Swimming Pool are in the Campus Area.

Port Royal 3 demonstrates this further. A&E ★★ shows how regions can be used to write simple rules which regulate access to and from whole areas of the map.

Many old-school IF puzzles involve journeys through the map which are confused, randomised or otherwise frustrated: see Bee Chambers for a typical maze, Zork II for a randomised connection, Prisoner's Dilemma ★★ for a change in the map occurring during play. A completely random map takes us away from traditional IF and more towards a different sort of old-school game, the computerised role-playing game with its endless quests through dungeons with randomly generated treasures and monsters. This style of map - building itself one step at a time, as the player explores - can sometimes be useful to provide an illusion of infinite expanse: see All Roads Lead To Mars .

While the standard compass directions are conventional in IF, there are times when we may want to replace them without other forms of directional relationship. Indirection renames the compass directions to correspond to primary colors, as in Mayan thinking. The World of Charles S. Roberts ★★ substitutes new ones, instead, introducing a hex-grid map in place of the usual one.

See Also

Going, Pushing Things in Directions for ways to add more relative directions, such as context-sensitive understanding of OUT and IN.
Room Descriptions for ways to modify the room description printed.
Ships, Trains and Elevators for rooms which move around in the map and for directions aboard a ship.

Examples

5.
A partial implementation of Port Royal, Jamaica, set before the earthquake of 1692 demolished large portions of the city.
8.
Another part of Port Royal, with less typical map connections.
10.
Division of Port Royal into regions.
Layout where the player is allowed to wander any direction he likes, and the map will arrange itself in order so that he finds the correct "next" location.
125.
A maze with directions between rooms randomized at the start of play.
134.
A "Carousel Room", as in Zork II, where moving in any direction from the room leads (at random) to one of the eight rooms nearby.
286.
Renaming the directions of the compass so that "white" corresponds to north, "red" to east, "yellow" to south, and "black" to west.
A button that causes a previously non-existent exit to come into being.
Replacing the ordinary compass bearings with a set of six directions to impose a hexagonal rather than square grid on the landscape.
101.
A&E ★★
Using regions to block access to an entire area when the player does not carry a pass, regardless of which entrance he uses.

RB §3.3 Position Within Rooms

Inform's division of geography into "rooms" is a good compromise for most purposes. The rooms are cut off from each other by (imaginary or actual) walls, while all of the interior of a given room is regarded as the same place.

Suppose we want things to happen differently in different corners of the same room? Inform can already do this a little, in that the player can be inside an enterable container or on an enterable supporter. For instance:

Instead of opening a door when the player is on the bed, say "You can't reach the handle from the bed."

If we need to have divided-up areas of the floor itself, the standard approach is to define a small number of named positions. We then need to remember at which of these locations the player (or something else) currently stands.

Further Reasons Why All Poets Are Liars allows the player to be in different parts of a room by standing on a box which can be in different places: thus only the box needs an internal position, not the player, simplifying matters neatly.

Another interesting case is when one room is entirely inside another (such as a hut in a field, or a booth in a large convention hall), so that the exterior of the room should be visible from another location. Starry Void ★★★ gives a simple demonstration of a magician's booth that can be examined from the outside, opened and closed, and entered to reach a new location.

See Also

Continuous Spaces and The Outdoors for making the space between rooms continuous.
Combat and Death for the use of position in a room in determining combat maneuvers.
Entering and Exiting, Sitting and Standing for automatically getting up from chairs before going places.
The Human Body for letting the player take different postures on furniture or on the floor.
Furniture for cages, beds, and other kinds of enterable supporters and containers.

Examples

The young William Wordsworth, pushing a box about in his room, must struggle to achieve a Romantic point of view.
7.
Starry Void ★★★
Creating a booth that can be seen from the outside, opened and closed, and entered as a separate room.

RB §3.4 Continuous Spaces and The Outdoors

Suppose we want to blur the boundaries between rooms, in an environment where there are no walls: out of doors, for instance?

The simplest cases involve making something exceptional visible in more than one place. Carnivale ★★ features an exceptionally large landmark seen by day; Eddystone ★★ an exceptionally bright one by night. Waterworld allows a very distant object (the Sun) to be seen throughout many rooms, but never approached. View of Green Hills ★★★ gives the player an explicit command for looking through into an adjacent room.

Three systematic examples then present outdoor landscapes with increasing sophistication. Tiny Garden ★★ gives the multiple rooms of an extended lawn descriptions which automatically adapt to say which directions lead into further lawn area. Rock Garden ★★ provides a relation, "connected with", between rooms, allowing items in one to be seen from the other: an attempt to interact with a visible item in a different area of the garden triggers an implicit going action first. Stately Gardens ★★★ provides a much larger outdoor area, where larger landmarks are visible from further away, and room descriptions are highly adaptive.

In an outdoor environment, the distinction between a one-move journey and a multiple-move journey is also blurred. Hotel Stechelberg ★★ shows a signpost which treats these equally.

See Also

Position Within Rooms for making the space within a room continuous.
Windows for another way to see between locations.
Doors, Staircases, and Bridges for still a third way to be told at least what lies adjacent.
Passers-By, Weather and Astronomical Events for more on describing the sky.

Examples

216.
A backdrop which the player can examine, but cannot interact with in any other way.
62.
A lawn made up of several rooms, with part of the description written automatically.
Signposts such as those provided on hiking paths in the Swiss Alps, which show the correct direction and hiking time to all other locations.
212.
Carnivale ★★
An alternative to backdrops when we want something to be visible from a distance but only touchable from one room.
213.
Eddystone ★★
Creating new commands involving the standard compass directions.
366.
A simple open landscape where the player can see between rooms and will automatically move to touch things in distant rooms.
80.
A LOOK [direction] command which allows the player to see descriptions of the nearby landscape.
367.
Stately Gardens ★★★
An open landscape where the player can see landmarks in nearby areas, with somewhat more complex room descriptions than the previous example, and in which we also account for size differences between things seen at a distance.

RB §3.5 Doors, Staircases, and Bridges

Inform's "door" kind provides for a tangible thing which comes between one room and another. A door can be open or closed, and openable or not: it can be locked or unlocked, and lockable or not. Here we create a conventional door, a natural gap in the rocks, and a (fixed in place) wooden ladder:

The fire door is an open door. The fire door is east of the Projection Booth and west of the Fire Escape.
The narrow crevice is an open unopenable door. The crevice is east of the Col du Prafleuri and west of Rocky Knoll Above Arolla.
The wooden ladder is an open unopenable door. The ladder is above the Stableyard and below the Hay Loft.

Most doors are visible from both sides: they are single objects but present in two rooms at once, which raises a number of complications. Inform normally uses the same description looking from each way, which is not very interesting: When? and Whence? ★★★ demonstrate neat ways to describe the two sides differently, and Whither? adds the option for the player to refer to doors as "the west door" and "the east door" automatically.

Neighbourhood Watch ★★ goes further by making a door behave differently on each side: from the "outside" you need a key, but "inside" it opens on a latch. Finally, Garibaldi ★★★ shows how to access information about the two sides of a door.

Higher Calling demonstrates doors which automatically open as needed: though using the Inform extension Locksmith by Emily Short is probably easier and better. Elsie ★★, conversely, demonstrates a door that closes one turn after the player has opened it.

Certain complications apply when characters other than the player have to see and interact with doors that exist in other rooms. Wainwright Acts demonstrates the syntax needed to handle this technically quirky situation.

Something Narsty and Hayseed provide a "staircase" kind useful for vertically arranged, always-open doors like staircases and (fixed in place) ladders.

One Short Plank ★★ implements a precarious plank bridge across a chasm as an open unopenable door.

See Also

Windows for climbing through a window from one room to another.
Ropes for portable connections between rooms, much of the development of which could be adapted to handle portable ladders. "Doors" are never allowed to move.
Magic (Breaking the Laws of Physics) for a hat that lets the player walk through closed doors.
Modifying Existing Commands for ways to allow the player to unlock with a key he isn't currently holding.

Examples

A staircase always open and never openable.
63.
When?
A door whose description says "…leads east" in one place and "…leads west" in the other.
89.
A refinement of our staircase kind which can be climbed.
All doors in the game automatically attempt to open if the player approaches them when they are closed.
A technical note about checking the location of door objects when characters other than the player are interacting with them.
321.
A door whose description says where it leads; and which automatically understands references such as "the west door" and "the east door" depending on which direction it leads from the location.
A locked door that can be locked or unlocked without a key from one side, but not from the other.
106.
A plank bridge which breaks if the player is carrying something when he goes across it. Pushing anything over the bridge is forbidden outright.
151.
Elsie ★★
A door that closes automatically one turn after the player opens it.
22.
Garibaldi 1 ★★★
Providing a security readout device by which the player can check on the status of all doors in the game.
64.
Whence? ★★★
A kind of door that always automatically describes the direction it opens and what lies on the far side (if that other room has been visited).

RB §3.6 Windows

Calvin Coolidge once described windows as "rectangles of glass." For us, they have two purposes: first, they offer a view of landscape beyond. In the simplest case the view is of an area which will not be interacted with in play, and therefore does not need to adapt to whatever may have changed there:

The window is scenery in the Turret. "Through the window you see miles and miles of unbroken forest, turning from green to flame in the hard early autumn."

More interesting is to adapt the view a little to provide a changing picture: a forest may not change much, but a street scene will. Port Royal 4 ★★ allows us to glimpse random passers-by.

The trickiest kind of window allows the player to see another room which can also be encountered in play, and to interact with what is there. Dinner is Served ★★ presents a shop window, allowing people to see inside from the street, and even to reach through.

Vitrine handles the complication of a window misting up to become opaque, and thus temporarily hiding its view.

Second, windows provide openings in walls and can act as conduits. Escape ★★ shows how a "door" in the Inform sense can become a window. A Haughty Spirit ★★★ provides a general kind of window for jumping down out of: ideal for escapers from Colditz-like castles.

See Also

Doors, Staircases, and Bridges for a door which can be partially seen through.

Examples

116.
An electrochromic window that becomes transparent or opaque depending on whether it is currently turned on.
21.
Escape ★★
Window that can be climbed through or looked through.
217.
A window between two locations. When the window is open, the player can reach through into the other location; when it isn't, access is barred.
272.
A cell window through which the player can see people who were in Port Royal in the current year of game-time.
181.
Windows overlooking lower spaces which will prevent the player from climbing through if the lower space is too far below.

RB §3.7 Lighting

At any place (room, or inside a container) light is either fully present or fully absent. Inform does not usually try to track intermediate states of lighting, but see The Undertomb 2 ★★ for a single lantern with varying light levels and Zorn of Zorna ★★★ for multiple candles that can be lit for cumulative changes to the light level.

Light can be added to, but not taken away: rooms and things can act as sources of light, by having the "lighted" and "lit" properties respectively, but they cannot be sinks which drain light away. The reason darkness is not a constant hazard in Inform-written games is that rooms always have the "lighted" property unless declared "dark". (We assume daylight or some always-on electric lighting.) A "dark" room may well still be illuminated if a light source happens to be present:

The Deep Crypt is a dark room. The candle lantern is a lit thing in the Deep Crypt.

Hymenaeus allows us to explicitly refer to torches as "lit" or "unlit", or (as synonyms) "flaming" or "extinguished".

For light produced electrically we might want a wall switch, as in Down Below ★★, or a portable lamp, as in The Dark Ages Revisited .

The fierce, locally confined light thrown out by a carried lamp has a quality quite unlike weak but ambient daylight, and Reflections exploits this to make a lantern feel more realistic.

When the player experiences darkness in a location, Inform is usually very guarded in what it reveals. ("It is pitch dark, and you can't see a thing.") Hohmann Transfer ★★ gives darkness a quite different look, and Four Stars ★★★ heightens the other senses so that a player in darkness can still detect her surroundings. The first of the two examples in Peeled allows exploration of a dark place by touch.

It is sometimes useful to check whether a room that is not the current location happens to contain a light source or be naturally lighted. This poses a few challenges. Unblinking ★★★ demonstrates one way of doing this, so long as there are no backdrop light sources.

Cloak of Darkness ★★★★ is a short and sweet game based on a light puzzle.

See Also

Room Descriptions for an item that can only be seen in bright light, when an extra lamp is switched on.
Looking Under and Hiding for a looking under action which is helped by the fiercer brightness of a light source.
Going, Pushing Things in Directions for making it hazardous to walk around in the dark.
Electricity and Magnetism for batteries to power a torch or flashlight.
Fire for a non-electrical way to produce light.

Examples

An electric light kind of device which becomes lit when switched on and dark when switched off.
312.
Understanding "flaming torch" and "extinguished torch" to refer to torches when lit and unlit.
352.
Emphasizing the reflective quality of shiny objects whenever they are described in the presence of the torch.
363.
Peeled
Two different approaches to adjusting what the player can interact with, compared.
26.
Down Below ★★
A light switch which makes the room it is in dark or light.
51.
Flickering lantern-light effects added to the Undertomb.
348.
Changing the way dark rooms are described to avoid the standard Inform phrasing.
81.
Unblinking ★★★
Finding a best route through light-filled rooms only, leaving aside any that might be dark.
347.
Zorn of Zorna ★★★
Light levels vary depending on the number of candles the player has lit, and this determines whether or not he is able to examine detailed objects successfully.
349.
Four Stars 1 ★★★
An elaboration of the idea that when light is absent, the player should be given a description of what he can smell and hear, instead.
291.
Cloak of Darkness ★★★★
Implementation of "Cloak of Darkness", a simple example game that for years has been used to demonstrate the features of IF languages.

RB §3.8 Sounds

It is too easily assumed that room descriptions are what the player sees, but as The Undertomb demonstrates, they might just as easily include ambient sounds.

So Inform's "listening to" action is the audio equivalent of "examining", rather than "looking". Despite this the player can type LISTEN, which Inform understands as listening to the everything in the location at once. A simple but effective way to handle this is shown in The Art of Noise ★★★.

Four Stars 2 adjusts the idea of "visibility" to make it behave differently for listening purposes: this introduces a formal idea of "audibility".

See Also

Lighting for heightened hearing in darkness, and the rest of "Four Stars".

Examples

A small map of dead ends, in which the sound of an underground river has different strengths in different caves.
364.
Using "deciding the scope" to change the content of lists such as "the list of audible things which can be touched by the player".
95.
Things are all assigned their own noise (or silence). Listening to the room in general reports on all the things that are currently audible.

RB §3.9 Passers-By, Weather and Astronomical Events

Out of doors, nature is seldom still. Clouds scull by at random, as in Weathering , and provide some variety in what would otherwise be lifelessly static room descriptions. In much the same way, passers-by and other diversions make a city street a constant bustle: see Uptown Girls ★★★ for this human breeze. A more nagging sense of atmosphere can be experienced in Full Moon .

Orange Cones ★★★ offers traffic that is present on every road in the story unless a room is marked off with orange cones -- and this is allowed to change during play.

Night and Day and Totality ★★ each schedule celestial events to provide a changing display in the sky above, and this time running like clockwork rather than at random.

See Also

Scene Changes for meteors and a moon-rise.

Examples

131.
The automatic weather station atop Mt. Pisgah shows randomly fluctuating temperature, pressure and cloud cover.
157.
Random atmospheric events which last the duration of a scene.
Cycling through a sequence of scenes to represent day and night following one another during a game.
144.
Totality ★★
To schedule an eclipse of the sun, which involves a number of related events.
120.
Orange Cones ★★★
Creating a traffic backdrop that appears in all road rooms except the one in which the player has laid down orange cones.
132.
Uptown Girls ★★★
A stream of random pedestrians who go by the player.