[MUD-Dev] Re: Prepositions and parsing
gryphon at iaehv.nl
Sun May 11 11:34:47 New Zealand Standard Time 1997
On Fri 09 May, clawrenc at cup.hp.com wrote:
> >At the moment it seems that games only know
> >about 'inside' and 'outside', and there's no 'real-thing feeling' to
> >them when interacting. I.e. they have no size, weight or true
> >position. Unless you have those there seems to be little point in
> >thinking about more complicated ways of locating things.
> True. I'm attempting to resolve this from several angles, including
> moving to a real coordinate space system, giving objects dimensions,
> doing collision detection for things like trying to fit a dragon thru
> a mousehole or a boulder into a purse. etc. I suspect to really
> resolve the job I'll have to move to a 3D graphical system (I'm
> already leaning that way), but I'd like and try and resolve the
> virtual aspects first (which text represents perfectly),
I've written about an idea to improve on this deficiency of current games
on my design page in the faint hope somebody knowledgable would stumble
on it and be able to comment more intelligently. Preferably somebody who
could tell if the idea was feasible or not (and how it could be improved
on without adding overly much complexities).
The basic idea is to describe everything as 'boxes' with a given size.
There should be two types: solid boxes and virtual boxes. The first type
represents all objects in the game, the second all places that can be
distinguished from other places (not rooms but also things like e.g.
a forest). Boxes can be placed inside each other, and at a certain,
position relative to each other. It also allows players (who are re-
presented by such boxes too) to scramble over the roofs of buildings or
fly at second floor height through a street.
Personally I belief this can be achieved without need for graphical games,
and from what I've seen from those I didn't like them very much. They were
very shallow and, well, predictable. Perhaps in time things will change but
I tend to agree with those who say that it is easier to create an atmosphere
for a game with words.
> As a start on such, given a coordinate space say, (and no, the user
> won't ever see X,Y,Z coordinates) the question is how to parse and
> handle prepositions. I know the LIMA MUDLib can do it -- anybody here
> familiar with it, or want to dig into it?
Why not use: go to <something> and have your character move at a predefined
speed in the general direction of wherever something is (provided it can
be 'seen' from the current location. Things like 'above', 'below' and all
others are absolute to the world. And 'behind' is relative to the current
orientation of the character. You probably will have to have a list of
allowable prepositions and check those to see what they mean, but as far
as 'understanding' is concerned that's just common sentence parsing.
You have a small variety of possible sentence structures. The most common
one in games is <subject-noun> <action-verb> <directive object-noun>
<cooperative object (?)-noun>.
The subject can normally be omitted as it can only ever be 'I'.
The directive object usually can be extended by some extra words to indicate
the number of objects and to identify exacly which object is meant. I.e.
'three goldpieces' or 'third bread'. There may also be a pronoun in natural
The cooperative object (not sure if it's called like that in english) basically
tells what to do with the directive object. The noun part can have identifiers
prepositioned to it. This again can be a word like 'third' or it can be a
pronoun (e.g. 'big' or 'red') or it can be a preposition. The numerical
identifier is reasonably simple to identify I think. The pronoun must be
matched against alternative identifiers for objects within vision. Normally
on muds you can use the pronoun instead of the noun. I.e. it is allowed to
say 'get red' when you really mean 'get red bag'. Personally I find that this
is poor style but I suppose there's pressing coding reasons to do this. Or
maybe it's done to reduce the amount of typing needed? Prepositions are
probably the hardest to deal with, because they basically modify the meaning
of the noun. If you say 'put (the) bread IN (the) bag', the word IN is what
actually gives the noun its meaning. However interpreting this largely depends
on both the action and on the object involved. 'Put the bag in the bread' is
syntactically correct but will fail on the properties of the bread.
This means that to be able to interpret prepositions you not only need to
understand what each preposition you allow means, but you have to somehow
make clear which preposition works with each object in the game. On muds
this is pretty simple because there's only one preposition used: IN and
only one object that will work with that: containers. If you want to
extend on the number of prepositions you will have to also extend on the
way you represent objects. Actually interpreting the sentence is mostly
a matter of matching each word against a limited number of possibilities.
I'm not sure if this is of any real help. I've been writing as I was
thinking about it. Trying to see the problems and pitfalls with allowing
more complex commands to a game.
Yes - at last - You. I Choose you. Out of all the world,
out of all the seeking, I have found you, young sister of
my heart! You are mine and I am yours - and never again
will there be loneliness ...
Rolan Choosing Talia,
Arrows of the Queen, by Mercedes Lackey
More information about the MUD-Dev