5.6. Viewpoint

| Chapter 5: The Viewpoint Character |

| 5.6. Viewpoint

Inform automatically creates a character for the player - a bland, personality-free entity at the outset, as we've seen. But there is no reason why the player need stick to this same identity throughout the game. Conventional fiction often jumps from one viewpoint character to another, and so can IF.

To do this at the most elementary level, we simply at some point

> change player to Janine;

where Janine is a person we've already defined in the code. Now the player is in whatever location Janine inhabits, carries whatever Janine carries, and wears whatever Janine is wearing. Terror of the Sierra Madre shows off this effect, and also demonstrates how to make the command prompt remind the player which character he currently controls. Some games instead give this information in the status line or after the name of the location when looking, producing output like

> The Bottomless Acherousia (as Charon)

We could do the same by adding a line such as

> After printing the name of a room while constructing the status line or looking:
> say "[roman type] (as [the player])"

Of course, we'll need a good deal of other work to make Janine a distinct person from whichever character the player was before. The distinction may come from changed capabilities of the new character, which we can express through new rules about actions; e.g.,

> Instead of listening when the player is Janine:
> say "Your childhood accident left you unable to hear any but the loudest noises. Currently there is only silence."

Janine may also have new, different perspective on her surroundings, expressed through the descriptions of the things she looks at; Uncommon Ground makes a "by viewpoint" token for text alternatives, allowing us to tag our descriptions to indicate which variations should be shown to which viewpoint characters. The Crane's Leg 1 and 2 offer more elaborate and specialized ways of customizing the player character's observations to depend on how he relates (physically and in attitude) to the things around him.

If we want to change the tense and person of narration from the conventional present second person, we may do this as well, though at the present stage of Inform the effect relies on external extensions.

121
| Example Terror of the Sierra Madre Multiple player characters who take turns controlling the action. |
WI

445
| Example Uncommon Ground Making a "by viewpoint" token, allowing us to design our own text variations such as "[show to yourself]quaint[to Lolita]thrilling[to everyone else]squalid[end show]" depending on the identity of the player at the moment. |
WI

51
| Example The Crane's Leg 1 A description text that automatically highlights the ways in which the object differs from a standard member of its kind. |
WI

377
| Example The Crane's Leg 2 A description text generated based on the propensities of the player-character, following different rulebooks for different characters. |
WI

> Names of rules can be listed in tables. This is convenient if, for instance, we decide that we'd like to swap the rules we use for a specific purpose, as in this continuation of our earlier example of automated description: "The Crane's Leg, Grown Longer" Material is a kind of value. The materials are wood, glass, stone, cloth, paper, clay, and metal. A thing has a material. Color is a kind of value. The colors are red, orange, yellow, green, blue, indigo, violet, black, brown, and white. A thing has a color. A thing is usually white. A height is a kind of value. 3 feet 11 inches specifies a height. A thing has a height. Definition: a thing is tall if its height is 6 feet 0 inches or more. Definition: a thing is short if its height is 2 feet 0 inches or less. Imitation relates various things to one thing (called the ideal). The verb to imitate (it imitates, they imitate, it is imitating) implies the imitation relation. A table is a kind of supporter. A table is usually wood. The height of a table is usually 3 feet 8 inches. The ordinary table is a table. Every table imitates the ordinary table. A rock is a kind of thing. A rock is usually stone. The ordinary rock is a rock. The height of a rock is usually 0 feet 3 inches. Every rock imitates the ordinary rock. The description of a thing is usually "[comparison with ideal][run paragraph on]". To say comparison with ideal: say "You observe [the noun]:[paragraph break]"; choose row with character of the player in Table of Descriptive Reporting; follow instructions entry. This is the comparative observation rule: let the sample be the ideal of the noun; if the sample is not a thing: say "Nothing special, really."; rule succeeds; if the material of the noun is not the material of the sample: if the height of the noun is not the height of the sample: if the noun is shorter than the sample, say "Unusually short at [height of the noun], and made of [material of the noun]."; otherwise say "Unusually tall at [height of the noun], and made of [material of the noun]."; otherwise: say "Distinct mostly in being made of [material of the noun]."; otherwise: if the height of the noun is not the height of the sample: if the noun is shorter than the sample, say "Unusually short at [height of the noun]."; otherwise say "Unusually tall at [height of the noun]."; otherwise: say "In every respect [a sample]." The Pleasure Garden is a room. "At the riverbank, a pleasing garden, having many curving paths and one straight." The low table is a table in the Pleasure Garden. The height of the low table is 2 feet 3 inches. On the low table is a yellow metal rock called a gold nugget. A willow is in the Pleasure Garden. The height of the willow is 20 feet 2 inches. Understand "possess [any person]" or "be [any person]" as possessing. Possessing is an action applying to one thing. Carry out possessing: now the player is the noun; say "You swap bodies!" The crane is a person in the Garden. The height of the crane is 4 feet 0 inches. Table of Descriptive Reporting
> character | instructions
> yourself | comparative observation rule
> crane | bird observation rule
This is the bird observation rule: if the noun is shorter than the player, say "Small, like a duck[if the color of the noun is not white]; and [color of the noun][end if]."; otherwise say "Supremely tall[if the color of the noun is not white] and [color of the noun][end if]." Test me with "examine table / examine nugget / examine willow / possess crane / examine table / examine nugget / examine willow".

Previous | Contents | Next