Inform 7 Home Page / Documentation


§7.13. Traveling Characters

There are a number of ways we can make characters navigate our map. We might reasonably want them to approach and follow the player (as in Van Helsing); or to allow the player to follow characters who have left the room (as in Actaeon).

Characters who are less interested in the player will more likely follow their own courses around the available geography, however. A character may move randomly from room to room, as demonstrated in Mistress of Animals; he may follow a path that we have specifically written in advance, as Odyssey shows; or, most elegantly, he may use the "best route" calculation to find the best possible way to a given target room, as seen in Latris Theon.

This final method is arguably the neatest solution to character movement, allowing for characters to act in sophisticated ways; if we incorporate the Locksmith extension, other characters will even unlock and open doors that are in their way. The chief catch is that it should not be used too profligately with large numbers of characters, since on slow machines the processing power required to plan all their travel will make a noticeable difference to the running speed of the story.

All the same, the constraints are not so severe as to preclude having a moderate number of route-finding characters all wandering around at once. This does introduce a new problem, however: movement descriptions can become hard to follow if every turn produces long reams of reports such as

Joe enters the room from the south.
Lawrence opens the gate.
Lawrence departs to the west.
Lucy comes in from above.
Ted enters the room from the south.
Bill departs to the west.

Patient Zero tackles this problem by calculating all of the character movement without printing any text; it then combines similar or related events into coherent paragraphs, as in

Rhoda and Antony walk into the Post Office. Rhoda could have been rolling in chocolate and Antony looks as though dipped in french vanilla.

or

Antony opens the iron gate. He goes through.

* See Doors, Staircases, and Bridges for some technical details of allowing other characters to interact with doors when they're in rooms that don't contain the player


arrow-up.png Start of Chapter 7: Other Characters
arrow-left.png Back to §7.12. Characters Following a Script
arrow-right.png Onward to §7.14. Obedient Characters

*ExampleMistress of Animals
A person who moves randomly between rooms of the map.

**ExampleVan Helsing
A character who approaches the player, then follows him from room to room.

**ExampleOdyssey
A person who follows a path predetermined and stored in a table, and who can be delayed if the player tries to interact with her.

**ExampleActaeon
A FOLLOW command allowing the player to pursue a person who has just left the room.

***ExampleLatris Theon
A person who can accept instructions to go to new destinations and move towards them according to the most reasonable path.

****ExamplePatient Zero
People who wander around the map performing various errands, and in the process spread a disease which only the player can eradicate.