§3.3. Position Within Rooms

Inform's division of geography into "rooms" is a good compromise for most purposes. The rooms are cut off from each other by (imaginary or actual) walls, while all of the interior of a given room is regarded as the same place.

Suppose we want things to happen differently in different corners of the same room? Inform can already do this a little, in that the player can be inside an enterable container or on an enterable supporter. For instance:

Instead of opening a door when the player is on the bed, say "You can't reach the handle from the bed."

If we need to have divided-up areas of the floor itself, the standard approach is to define a small number of named positions. We then need to remember at which of these locations the player (or something else) currently stands.

Further Reasons Why All Poets Are Liars allows the player to be in different parts of a room by standing on a box which can be in different places: thus only the box needs an internal position, not the player, simplifying matters neatly.

Another interesting case is when one room is entirely inside another (such as a hut in a field, or a booth in a large convention hall), so that the exterior of the room should be visible from another location. Starry Void gives a simple demonstration of a magician's booth that can be examined from the outside, opened and closed, and entered to reach a new location.

* See Continuous Spaces and The Outdoors for making the space between rooms continuous

* See Combat and Death for the use of position in a room in determining combat maneuvers

* See Entering and Exiting, Sitting and Standing for automatically getting up from chairs before going places

* See The Human Body for letting the player take different postures on furniture or on the floor

* See Furniture for cages, beds, and other kinds of enterable supporters and containers


arrow-up.pngStart of Chapter 3: Place
arrow-left.pngBack to §3.2. Map
arrow-right.pngOnward to §3.4. Continuous Spaces and The Outdoors

We begin with the location and its fittings, and we create a kind of value which names the different internal positions we will allow.

paste.png "Further Reasons Why All Poets Are Liars"

Nook Obscure is a room. "Above the College kitchens, which make a humming sound, less tuneable than bees, but hardly less industrious, with shrill notes of sharp command and scolding intermixed: and below Trinity's loquacious clock, who never lets the quarters, night or day, slip by him unproclaimed, and tells the hours twice over with a male and female voice. In short, the kind of rubbish room they give to a northern villager. But you get a bed and a high shelf all of your own. And you long to find some Romantic way to look out of the window."

The window, the shelf and the bed are scenery in the Nook Obscure. The shelf and the bed are supporters. The bed is enterable.

Internal position is a kind of value. The internal positions are nowhere at all, over by the window, under the shelf and near the bed.

The box is an enterable supporter in Nook Obscure. The current box position is an internal position that varies. The current box position is near the bed. "Your packing case, stamped W. WORDSWORTH (KENDAL), is [current box position]." Instead of taking the box, say "It is filled with your peerless rock collection and too heavy to lift, but could be pushed." Instead of opening the box, say "It is securely nailed shut."

We create an action, "pushing it over to", for pushing a box around on the floor of a single location. (Calling this "pushing it over to" prevents clashes with the existing "pushing it to" action, which is for pushing things from one room to another.) Almost half of the text which defines the action is concerned with the two action variables, but they make the implementation of everything else so much easier that we end up writing less than if we hadn't used them.

Understand "push [box]" as a mistake ("You can push the box to the window, the bed or the shelf.").

Understand "push [something] to [something]" as pushing it over to. Pushing it over to is an action applying to two things.

The pushing it over to action has an internal position called the old position.
The pushing it over to action has an internal position called the new position.
Setting action variables for pushing something over to something:
    now the old position is the current box position;
    now the new position is nowhere at all;
    if the second noun is the window, now the new position is over by the window;
    if the second noun is the bed, now the new position is near the bed;
    if the second noun is the shelf, now the new position is under the shelf.

Check pushing it over to:
    if the noun is not the box, say "That's not something you can push." instead;
    if the player is on the bed, say "You can't reach from here." instead;
    if the player is on the noun, say "Not while you are standing on [the noun]." instead;
    if the new position is nowhere at all, say "You can only push [the noun] to the window, the bed or the shelf." instead;
    if the new position is the old position, say "The [noun] is already [new position]." instead.
Carry out pushing it over to:
    now the current box position is the new position.
Report pushing it over to:
    say "With some effort, you shove [the noun] from [old position] to [new position]."

Everything which remains simply provides a couple of puzzles to test this arrangement.

Euclid's Elements is on the shelf. Understand "euclid" or "book" as the Elements.
Instead of taking something (called the item) which is on the shelf:
    if the player is on the box and the current box position is under the shelf, continue the action;
    say "You cannot reach [the item], which is up on the shelf."

Instead of examining the window:
    say "This window opens rather unpromisingly onto the chapel wall opposite, so even granted the moonlight it is dark in here. Still, surely there's a poem here somewhere?"

Instead of examining the window when the player is on the bed:
    say "Just a blank patch of chapel wall."

Instead of examining the window when the player is on the box:
    if the current box position is near the bed:
        say "Tantalisingly, you are not quite able to spy the statue.";
    otherwise if the current box position is under the shelf:
        say "All you can see is the antechapel wall, and the dull silver gleam of the pealing organ.";
    otherwise:
        say "At last! You can just, standing on tiptoes on the box right up at the window, make out the top of the statue! Of such epiphanies are Poesy born. Let's see now... oh yes...[paragraph break]And from my pillow, looking forth by light[line break]Of moon or favouring stars, I could behold[line break]The antechapel where the statue stood[line break]Of Newton with his prism and silent face,[line break]The marble index of a mind for ever[line break]Voyaging through strange seas of Thought, alone.";
        end the story finally.

Test me with "get on bed / x window / get off / x window /get elements / get on box / x window / get elements / push box to shelf / get off / push box to shelf / get on box / get elements / x window / get off / push box to window / get on box / x window".

*ExampleFurther Reasons Why All Poets Are Liars
The young William Wordsworth, pushing a box about in his room, must struggle to achieve a Romantic point of view.

We begin with the location and its fittings, and we create a kind of value which names the different internal positions we will allow.

paste.png "Further Reasons Why All Poets Are Liars"

Nook Obscure is a room. "Above the College kitchens, which make a humming sound, less tuneable than bees, but hardly less industrious, with shrill notes of sharp command and scolding intermixed: and below Trinity's loquacious clock, who never lets the quarters, night or day, slip by him unproclaimed, and tells the hours twice over with a male and female voice. In short, the kind of rubbish room they give to a northern villager. But you get a bed and a high shelf all of your own. And you long to find some Romantic way to look out of the window."

The window, the shelf and the bed are scenery in the Nook Obscure. The shelf and the bed are supporters. The bed is enterable.

Internal position is a kind of value. The internal positions are nowhere at all, over by the window, under the shelf and near the bed.

The box is an enterable supporter in Nook Obscure. The current box position is an internal position that varies. The current box position is near the bed. "Your packing case, stamped W. WORDSWORTH (KENDAL), is [current box position]." Instead of taking the box, say "It is filled with your peerless rock collection and too heavy to lift, but could be pushed." Instead of opening the box, say "It is securely nailed shut."

We create an action, "pushing it over to", for pushing a box around on the floor of a single location. (Calling this "pushing it over to" prevents clashes with the existing "pushing it to" action, which is for pushing things from one room to another.) Almost half of the text which defines the action is concerned with the two action variables, but they make the implementation of everything else so much easier that we end up writing less than if we hadn't used them.

Understand "push [box]" as a mistake ("You can push the box to the window, the bed or the shelf.").

Understand "push [something] to [something]" as pushing it over to. Pushing it over to is an action applying to two things.

The pushing it over to action has an internal position called the old position.
The pushing it over to action has an internal position called the new position.
Setting action variables for pushing something over to something:
    now the old position is the current box position;
    now the new position is nowhere at all;
    if the second noun is the window, now the new position is over by the window;
    if the second noun is the bed, now the new position is near the bed;
    if the second noun is the shelf, now the new position is under the shelf.

Check pushing it over to:
    if the noun is not the box, say "That's not something you can push." instead;
    if the player is on the bed, say "You can't reach from here." instead;
    if the player is on the noun, say "Not while you are standing on [the noun]." instead;
    if the new position is nowhere at all, say "You can only push [the noun] to the window, the bed or the shelf." instead;
    if the new position is the old position, say "The [noun] is already [new position]." instead.
Carry out pushing it over to:
    now the current box position is the new position.
Report pushing it over to:
    say "With some effort, you shove [the noun] from [old position] to [new position]."

Everything which remains simply provides a couple of puzzles to test this arrangement.

Euclid's Elements is on the shelf. Understand "euclid" or "book" as the Elements.
Instead of taking something (called the item) which is on the shelf:
    if the player is on the box and the current box position is under the shelf, continue the action;
    say "You cannot reach [the item], which is up on the shelf."

Instead of examining the window:
    say "This window opens rather unpromisingly onto the chapel wall opposite, so even granted the moonlight it is dark in here. Still, surely there's a poem here somewhere?"

Instead of examining the window when the player is on the bed:
    say "Just a blank patch of chapel wall."

Instead of examining the window when the player is on the box:
    if the current box position is near the bed:
        say "Tantalisingly, you are not quite able to spy the statue.";
    otherwise if the current box position is under the shelf:
        say "All you can see is the antechapel wall, and the dull silver gleam of the pealing organ.";
    otherwise:
        say "At last! You can just, standing on tiptoes on the box right up at the window, make out the top of the statue! Of such epiphanies are Poesy born. Let's see now... oh yes...[paragraph break]And from my pillow, looking forth by light[line break]Of moon or favouring stars, I could behold[line break]The antechapel where the statue stood[line break]Of Newton with his prism and silent face,[line break]The marble index of a mind for ever[line break]Voyaging through strange seas of Thought, alone.";
        end the story finally.

Test me with "get on bed / x window / get off / x window /get elements / get on box / x window / get elements / push box to shelf / get off / push box to shelf / get on box / get elements / x window / get off / push box to window / get on box / x window".

7

***ExampleStarry Void
Creating a booth that can be seen from the outside, opened and closed, and entered as a separate room.