Chapter 4: Time and Plot

§4.1. The Passage Of Time; §4.2. Scripted Scenes; §4.3. Event Scheduling; §4.4. Scene Changes; §4.5. Flashbacks; §4.6. Plot Management

arrow-up-left.pngContents of The Inform Recipe Book
arrow-left.pngChapter 3: Place
arrow-right.pngChapter 5: The Viewpoint Character
arrow-down-right.pngIndexes of the examples

§4.1. The Passage Of Time

A game that makes heavy use of time may want to give the player a hint that time is important - and an easy way to keep track of how it's going - by adding the current time to the status line, instead of the score. To do this, we would write

When play begins: change the right hand status line to "[time of day]".

All else being equal, time passes at a rate of one minute per turn. But this need not be so: we can imagine a game where turns take much less time, or much more; or a game in which the passage of time was sometimes suspended, or one in which different actions required different amounts of time to perform.

Situation Room provides a way to print 24-hour time, while Zqlran Era 8 implements a completely new measurement of time, for a game set on an alien world.

Uptempo and The Hang of Thursdays speed up time's passage: turns take fifteen minutes in the former, or a quarter day in the latter.

Timeless makes certain actions instant, so that they don't count against the clock; this is sometimes useful in timed situations where the player needs to review the situation before going on with a tricky puzzle. Endurance systematically extends this idea to allow us to assign different durations to any action in the game. The Big Sainsbury's goes the opposite direction, and meticulously adds a minute to the clock for all implicit take actions, just so that the player isn't allowed to economize on moves.

An alternative approach to time is not to tell the player specifically what hour of the day it is at all, but to move from one general time period to another as it becomes appropriate - when the player has solved enough puzzles, or worked his way through enough of the plot. To this end we might use scenes representing, say, Thursday afternoon and then Thursday evening; then our scene rules, rather than the clock, would determine when Thursday afternoon stopped and Thursday evening began:

Thursday afternoon is a scene. Thursday evening is a scene.

Thursday afternoon ends when the player carries the portfolio.

Thursday evening begins when Thursday afternoon ends.
When Thursday evening begins:
    say "The great clock over St. Margaret's begins to chime 6.";

Though this gives time a loose relation to the number of turns played, it feels surprisingly realistic: players tend to think of time in a game in terms of the number of significant moves they made, while the random wandering, taking inventory, and looking at room descriptions while stuck don't make as big an impression. So advancing the game clock alongside the player's puzzle solutions or plot progress can work just as well as any stricter calculation.

* See Passers-By, Weather and Astronomical Events for cycles of day and night scenes

* See Waiting, Sleeping for commands to let the player wait until a specific time or for a specific number of minutes

* See Clocks and Scientific Instruments for clocks that can be set to times and that have analog or digital read-outs

* See Timed Input for discussion of extensions allowing real-time input


arrow-up.pngStart of Chapter 4: Time and Plot
arrow-left.pngBack to Chapter 3: Place: §3.9. Passers-By, Weather and Astronomical Events
arrow-right.pngOnward to §4.2. Scripted Scenes

*ExampleSituation Room
Printing the time of day in 24-hour time, as in military situations.

*ExampleThe Big Sainsbury's
Making implicit takes add a minute to the clock, just as though the player had typed TAKE THING explicitly.

*ExampleUptempo
Adjust time advancement so the game clock moves fifteen minutes each turn.

*ExampleTimeless
A set of actions which do not take any game time at all.

**ExampleEndurance
Giving different actions a range of durations using a time allotment rulebook.

***ExampleThe Hang of Thursdays
Turns take a quarter day each, and the game rotates through the days of the week.

Suppose that our game takes place on an alien planet that does not follow Earth time. On this planet, we want to track time with different units. We also want time to advance in those units, and we want to be able to set a schedule of timed events.

paste.png "Zqlran Era 8"

The Barren Lavender Surface of Zql is a room. "It is late twilight on Zql. Overhead, two crescent moons, both green, mark the sluggish passage of time. A cold wind is blowing over the pale purplish ground cover, but it does not penetrate your airtight suit."

A Zqlran date is a kind of value. 14-88 specifies a Zqlran date with parts zqls and frbs. Current zqlran date is a zqlran date that varies. The current zqlran date is 8-22. Previous zqlran date is a zqlran date that varies. The previous zqlran date is 8-20.

When play begins:
    now left hand status line is "[current zqlran date], or [current zqlran date in words]".

To say (Zqlra - a Zqlran date) in words:
    say "[zqls part of Zqlra] Z, [frbs part of Zqlra] f."

Inform automatically supplies a way to say a new unit, which will look similar to the format in which we defined that unit in the first place. But we can (as shown here) create our own alternative say phrases to express the units in other ways as well.

Next, we need to meddle with time advancement so that time is tracked in Zqlran date rather than in minutes. This requires borrowing a trick from a later chapter, to replace Inform's built-in time handling with an alternative time handling rule of our own:

The Zqlran time rule is listed instead of the advance time rule in the turn sequence rules.

This is the Zqlran time rule:
    increment turn count;
    now the previous zqlran date is current zqlran date;
    increase the current zqlran date by 0-02;
    repeat through the Table of Zql Schedule:
        if era entry is greater than previous zqlran date and era entry is not greater than current zqlran date:
            say event entry;
            say paragraph break;
            blank out the whole row.

Table of Zql Schedule

era

event

8-24

"A wisp-thin cloud blows rapidly across the face of Nepenthe, the lesser of the two green moons."

8-28

"The cloud across Nepenthe clears."

Note that we could if we wished use a different device for scheduling events: this one simply prints text at scheduled eras, but we might also (for instance) make the event entry be a rule for Inform to follow, and tell Inform to carry out that rule at the scheduled time.

***ExampleZqlran Era 8
Creating an alternative system of time for our game, using new units.

Suppose that our game takes place on an alien planet that does not follow Earth time. On this planet, we want to track time with different units. We also want time to advance in those units, and we want to be able to set a schedule of timed events.

paste.png "Zqlran Era 8"

The Barren Lavender Surface of Zql is a room. "It is late twilight on Zql. Overhead, two crescent moons, both green, mark the sluggish passage of time. A cold wind is blowing over the pale purplish ground cover, but it does not penetrate your airtight suit."

A Zqlran date is a kind of value. 14-88 specifies a Zqlran date with parts zqls and frbs. Current zqlran date is a zqlran date that varies. The current zqlran date is 8-22. Previous zqlran date is a zqlran date that varies. The previous zqlran date is 8-20.

When play begins:
    now left hand status line is "[current zqlran date], or [current zqlran date in words]".

To say (Zqlra - a Zqlran date) in words:
    say "[zqls part of Zqlra] Z, [frbs part of Zqlra] f."

Inform automatically supplies a way to say a new unit, which will look similar to the format in which we defined that unit in the first place. But we can (as shown here) create our own alternative say phrases to express the units in other ways as well.

Next, we need to meddle with time advancement so that time is tracked in Zqlran date rather than in minutes. This requires borrowing a trick from a later chapter, to replace Inform's built-in time handling with an alternative time handling rule of our own:

The Zqlran time rule is listed instead of the advance time rule in the turn sequence rules.

This is the Zqlran time rule:
    increment turn count;
    now the previous zqlran date is current zqlran date;
    increase the current zqlran date by 0-02;
    repeat through the Table of Zql Schedule:
        if era entry is greater than previous zqlran date and era entry is not greater than current zqlran date:
            say event entry;
            say paragraph break;
            blank out the whole row.

Table of Zql Schedule

era

event

8-24

"A wisp-thin cloud blows rapidly across the face of Nepenthe, the lesser of the two green moons."

8-28

"The cloud across Nepenthe clears."

Note that we could if we wished use a different device for scheduling events: this one simply prints text at scheduled eras, but we might also (for instance) make the event entry be a rule for Inform to follow, and tell Inform to carry out that rule at the scheduled time.