Chapter 5: The Viewpoint Character
5.4. Background, Memory, and Knowledge

In IF, as in all interactive storytelling, an essential problem is that the player does not begin the game knowing everything that the player character should, and so may implausibly bumble through situations that the player character should be quite comfortable in. If the player character has friends, an unusual job, a home or environment we're not familiar with, a secret past, these will all be a blank to the player.

Some games get around this by making the player character an amnesiac, or positioning him as a newcomer to a strange world in which his disorientation is explicable; but there are stories that cannot be told this way, and so we need other methods of getting the player to know what the player character already does.

Our first opportunity to inform the player about the player character is in the opening text of a game:

When play begins:
    say "The funeral is exactly a month ago now, but Elise's shoes are still on the shoe tree."

We may also want to write descriptions of objects to give extra background information the first time the player encounters them:

A thing can be examined or unexamined. A thing is usually unexamined. After examining something: now the noun is examined; continue the action.

The description of the newspaper is "A rolled-up newspaper[if unexamined], and thus a symbol of your newly-single state: Elise always had it open and the Local Metro section next to your plate by the time you got out of the shower[end if]."

To expand on this, we could give the player a THINK ABOUT or REMEMBER command, with which he can call up information about people he meets or references he encounters in descriptions, so that he could (for instance) next type REMEMBER ELISE. Merlin demonstrates one way to implement a character with memory; One of Those Mornings puts a twist on this by letting the player FIND things which he knows his character possessed at some time before the game started.

Once the game is under way, we may also want the player character's perspective to change as a result of what he's encountered. It is sometimes reasonable to let the player understand references to characters who are currently off-stage, as in Puncak Jaya; or respond to actions differently depending on what the player has previously done, as in Tense Boxing; or change the way we describe objects in light of new knowledge about them, as in Zero.

* See Looking for more ways to change the description of a room depending on player experience


245
* Example  Merlin
A REMEMBER command which accepts any text and looks up a response in a table of recollections.

WI
267
* Example  One of Those Mornings
A FIND command that allows the player to find a lost object anywhere

WI
284
* Example  Puncak Jaya
When a character is not visible, responding to such commands as EXAMINE PETER and PETER, HELLO with a short note that the person in question is no longer visible.

WI
137
* Example  Tense Boxing
An overview of all the variations of past and present tenses, and how they might be used.

WI

Here we have a box that prints out its current state and its history each time we open and close it:

"Tense Boxing"

The Temporal Prism is a room. "A room of angled mirrors, in whose surfaces you can see what is now; what just was; what has always been. A final mirror is broken and its frame gapes blackly."

The mysterious box is in the Temporal Prism. It is an openable closed container.

To assess the box:
    if the box was not open then say "The box was not open.";
    if the box was open then say "The box was open.";
    if the box had not been open then say "The box had not been open.";
    if the box had been open then say "The box had been open.";
    if the box is not open then say "The box is not open.";
    if the box is open then say "The box is open.";
    if the box has not been open then say "The box has not been open.";
    if the box has been open then say "The box has been open."

Before opening the mysterious box:
    say "You are about to open the box.";
    assess the box.

Before closing the mysterious box:
    say "You are about to close the box.";
    assess the box.

After opening the mysterious box:
    say "You now open the box.";
    assess the box.

After closing the mysterious box:
    say "You now close the box.";
    assess the box.

Note that "was..." and "was not..." and so on may describe conditions more complicated than simple properties: we could equally well ask "if the box has been in the sack", "if the box had been carried by the player", and so on.

The past ("if the box was...") and past perfect ("if the box had been...") are especially useful for cases where we want to report on an action after the state of the item has changed; so, for instance:

After taking the mysterious box:
    if the box had not been carried by the player, say "You lift the mysterious box for the first time.";
    if the box had been carried by the player, say "You again pick up the mysterious box."

Test me with "open box / close box / open box / take box / drop box / take box".

This is in many respects similar to a rule beginning "After taking the mysterious box for the first time...", but it is superior in most circumstances, for two reasons.

First, it will respond correctly even if the player has somehow carried the box before without taking it explicitly: for instance, if another character gave him the box, if the box were moved into his inventory as a result of another action, or if the player carried the box at the start of play. Inform begins its reckoning of time when the game begins, so if the box is defined as being open at the outset, "if the box has been open" will always be true.

Second, "after taking... for the first time" fires only the first time the player attempts to take something. If the player tried to take the box, failed, and then tried again later, the "for the first time..." rule would not fire; our "if the box has not been carried..." rule would.

136
*** Example  Zero
A box which called "horribly heavy box" after the player has tried to take it the first time.

WI


PreviousContentsNext