§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 1 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 Going, Pushing Things in Directions for ways to add more relative directions, such as context-sensitive understanding of OUT and IN
See Room Descriptions for ways to modify the room description printed
See Ships, Trains and Elevators for rooms which move around in the map and for directions aboard a ship
Unless we arrange otherwise, this will be the first room in the game because it is the first we have defined. For subsequent rooms, we do not have to say explicitly that they are rooms, as long as they are connected to a room on the map. For instance, this will automatically make Thames Street End a room:
If we have some concern that the room name will be confused with an existing name, we can be more explicit about it using "called":
And now we get "inside", which generates a space treated as its own area on the map.
And if we like we can declare a number of rooms for which we will come back and write the descriptions later. There is no obligation for the description to occur at the first definition of the room.
For efficiency, we can also write multiple sets of connections at once:
Clicking Go will translate this description into a sketchy but working simulation of Port Royal, in which we can type movement commands like EAST or SOUTH to explore the streets. Looking at the World tab of the Index, we can also see a schematic map of the simulation as it currently stands. Like the rest of the Index, this is provided entirely for the author's benefit, and is not visible to the player. (Though if we do decide that we want players to have access to a printed map while they play, Inform can help: we will return to the layout of Port Royal in the chapter on Publishing.) The following Test command allows us to type TEST ME and explore the map we just devised:
|
|
Unless we arrange otherwise, this will be the first room in the game because it is the first we have defined. For subsequent rooms, we do not have to say explicitly that they are rooms, as long as they are connected to a room on the map. For instance, this will automatically make Thames Street End a room:
If we have some concern that the room name will be confused with an existing name, we can be more explicit about it using "called":
And now we get "inside", which generates a space treated as its own area on the map.
And if we like we can declare a number of rooms for which we will come back and write the descriptions later. There is no obligation for the description to occur at the first definition of the room.
For efficiency, we can also write multiple sets of connections at once:
Clicking Go will translate this description into a sketchy but working simulation of Port Royal, in which we can type movement commands like EAST or SOUTH to explore the streets. Looking at the World tab of the Index, we can also see a schematic map of the simulation as it currently stands. Like the rest of the Index, this is provided entirely for the author's benefit, and is not visible to the player. (Though if we do decide that we want players to have access to a printed map while they play, Inform can help: we will return to the layout of Port Royal in the chapter on Publishing.) The following Test command allows us to type TEST ME and explore the map we just devised:
|
|
|
|
|
|
|
|
|
|