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.