[DGD]parse_string

Jason Cone jcone at usabilitysciences.com
Tue Apr 6 18:00:01 CEST 1999


> -----Original Message-----
> From: erlends at fairplay.no [mailto:erlends at fairplay.no]
> Sent: Tuesday, April 06, 1999 10:34 AM
> To: dgd at list.imaginary.com
> Subject: Re: [DGD]parse_string
>
> [...]
> You sure about that? I don't know your search order, but wouldn't two
> identical stones, one in the room, and one in another object, return
> the wrong one? Since you don't know which environment to look for the
> object in?


Pretty sure, yeah.  If I were to use the "OBJ from OBJ" rule with the "take"
verb and typed "take stone from stone" (it totally doesn't make sense, but
we'll go with it for the sake of demonstration), here's what would happen.
The syntax of the rule implies that the first OBJ has the second OBJ in its
inventory.  Hence, I will always find the first OBJ first; my search order
would always find the container before anything in its inventory.  Does that
make sense?  This example, is limited by the syntax of the rule, though.
Let's take a more problematic scenario.

Suppose we have the rule "OBJ in OBJ" associated with the "put" verb and
type "put stone in bag".  No problem... unless we have more than one stone
in the same immediate environment, that is.  If the stones are exactly
alike, then I default to the first stone I come across.  I really don't see
another way around this.  For a rule like this, though, here's my search
order (which is the same for everything):

* Search all top-level objects in my inventory
* Search all objects in each top-level inventory recursively
* Search all top-level objects in my immediate environment
* Search the inventory for reach top-level object in my immeidate
environment in the same fashion as the above

There are, of course, limits as to how deep you search the inventory of an
object in your immediate environment and can be customized on a call-by-call
basis to a find_object-like function (search depth can be specified).  It
seems to make the most logical sense, though, and tends to mimic what I
would do in real life.  That said, I'm totally open to a more intelligent
searching algorithm.

JC


List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list