New Reaching Rules

As part of developing an extension to improve the handling of incorporated containers and supporters (see An issue with the U-Stor-It example), one of the main reasons that problems arise with that situation became clear: The reaching inside and reaching outside rules do not cover all of the significant categories of spatial arrangement that are supported by the existing world model.

I wrote an expanded version of the extension that introduces a new rulebook called the reaching past rules. These function similarly to the reaching inside and reaching outside rules, but they are applied only when an actor is trying to touch a target noun or second noun that has one or more degrees of separation from the actor via a spatial relation other than containment or support.

As an example of how these rules are applied, consider the scenario:

"Reach"

Yard is a room.
A tree is in Yard. It is fixed in place.
A branch is part of the tree. It is an enterable supporter.
A birdhouse is part of the branch. It is an enterable container.
A nest is in the birdhouse.
An egg is in the nest.

The player carries an enterable supporter called a rug.
The player carries an enterable container called a bin.

To this can be added some rules to better illustrate when reaching rules are checked:

First reaching outside something:
	say "<reaching outside of [container in question]>"; ["container in question" also works for supporters]
	make no decision.

First reaching inside something:
	say "<reaching inside of [container in question]>";
	make no decision.

and this will produce output such as:

Yard
You can see a tree here.

>DROP RUG
Dropped.

>PUT BIN ON IT
You put the bin on the rug.

>ENTER BIN
<reaching inside of rug>
(getting onto the rug)
You get into the bin.

>TAKE EGG
<reaching outside of bin>
<reaching outside of rug>
<reaching inside of nest>
<reaching inside of birdhouse>
Taken.

As can be seen, the existence of the branch and tree are ignored in the default model. The branch is ignored because, although it is a supporter, the birdhouse is not on the branch but is instead part of the branch. The tree is ignored because it is neither a container nor a supporter.

After adding the expanded extension and a similar tell-tale rule:

First reaching past something:
	say "<reaching past [container in question]>";
	make no decision.

the output becomes:

Yard
You can see a tree here.

>DROP RUG
Dropped.

>PUT BIN ON IT
You put the bin on the rug.

>ENTER BIN
<reaching inside of rug>
(getting onto the rug)
You get into the bin.

>TAKE EGG
<reaching outside of bin>
<reaching outside of rug>
<reaching past tree>
<reaching past branch>
<reaching inside of birdhouse>
<reaching inside of nest>
Taken.

The previously-skipped tree and branch are now checked via the reaching past rules. This makes it extremely easy to bar any action requiring touchability for things that are “up in the tree” with a rule like:

Reaching past the tree (this is the tree is not small rule):
	say "The tree is too tall to allow that from here.";
	deny access.

with the result of the last command now changed to:

>TAKE EGG
<reaching outside of bin>
<reaching outside of rug>
<reaching past tree>
The tree is too tall to allow that from here.

This is easier and/or more reliable than comparable methods of barring touchability in a situation like this. Note that if the player is repositioned so that the tree is not “between” the player and the branch, then the obstacle is removed when trying to get at something else “in the tree” (as a player would think about it):

>ABSTRACT ME TO BRANCH
[Abstracted.]

>LOOK
Yard (on the branch) (attached to the tree)
You can see a rug (on which is a bin (empty)) here.

>TAKE EGG
<reaching inside of birdhouse>
<reaching inside of nest>
Taken.

but the obstacle now exists when trying to reach something not in the tree:

>PUT EGG IN BIN
<reaching outside of branch>
<reaching past tree>
The tree is too tall to allow that from here.

If anyone would be interested in trying the alpha version of this extension, let me know.

7 Likes

The extension has been expanded a bit to include another rulebook, reaching across, which applies when both the actor and the touch target share the same position (i.e. are directly in the same room or container, or are directly on the same supporter). This is transcript from another test scenario, with responses from reaching rules marked by a preceding asterisk:

The Professor's Invention
Laboratory
An odd machine is situated here. Is this the "inertial amplifier" that the Professor told you about? Amidst its profusion of antennae lies a single switch.

An old, well-worn armchair is in one corner, incongruous in this setting.

Scientific paraphernalia clutters a large workbench.

On the workbench are some incomprehensible equipment and a red stapler.

Your baseball is lying on the floor nearby. It must have rolled down the steps after crashing through the window upstairs.

Rickety wooden steps leads back upstairs.

>X STAPLER
You see nothing special about the red stapler.

>TAKE IT
Best not to touch any of the Professor's things.

>GET IN ARMCHAIR
You get onto the large armchair.

>X BASEBALL
You see nothing special about the baseball.

>TAKE IT
*The armchair is set apart from everything else. You can't reach.

>GET UP
You get off the large armchair.

Laboratory
An odd machine is situated here. Amidst its profusion of antennae lies a single switch.

An old, well-worn armchair is in one corner, incongruous in this setting.

Scientific paraphernalia clutters a large workbench.

On the workbench are some incomprehensible equipment and a red stapler.

Your baseball is lying on the floor nearby.

Rickety wooden steps leads back upstairs.

>TAKE BASEBALL
Taken.

>TURN ON MACHINE
A high-pitched whine quickly cycles out of hearing range, and an odd feeling, like static electricity, crawls over your skin.

>X STAPLER
You see nothing special about the red stapler.

>TAKE IT
*You can barely move your arms, let alone move across the room. It feels like you are embedded in weeks-old gelatin.

>DROP BALL
You force your grip on the baseball to loosen, and it falls to the floor as though sinking through pudding.

>TAKE BALL
*You can barely move your arms, let alone move across the room. It feels like you are embedded in weeks-old gelatin.

>GET IN ARMCHAIR
*You can barely move your arms, let alone move across the room. It feels like you are embedded in weeks-old gelatin.

>TURN OFF MACHINE
*You strain against the weird resistance until your hand reaches the switch.

The unusual sensation fades instantly as the switch clicks home.

>TAKE BALL
Taken.

>GET IN ARMCHAIR
You get onto the large armchair.

>TURN ON MACHINE
*The armchair is set apart from everything else. You can't reach.

The governing reaching rules are:

Reaching across the Laboratory when the player is enclosed by the armchair:
	say "The armchair is set apart from everything else. You can't reach.";
	deny access.

Reaching across the Laboratory when the inertial amplifier is switched on:
	say "You can barely move your arms, let alone move across the room. It feels like you are embedded in weeks-old gelatin.";
	deny access.

Reaching across the Laboratory when the inertial amplifier is switched on and the noun is the inertial amplifier:
	say "You strain against the weird resistance until your hand reaches the switch.";
	allow access.
2 Likes

Sound great! I’ll likely need this in my game, which I’m just embarking on.