[MUD-Dev] [Theory?] Parsing of knowledge to allow for more interactive NPCs

holding99 at mindspring.com holding99 at mindspring.com
Fri Dec 21 02:41:50 New Zealand Daylight Time 2001

I had an idea today, and I hope that (unlike my last post on
influence points) someone will give me some feedback on its
feasibility, and possible implementation/design issues. Please
excuse me if this is no longer topical, or is considered a "solved"

Currently, text muds have a problem in that they do not understand
input in terms of world knowledge. For example, most parsers would
have a problem with the following input, mainly because of the

 > bow at Bubba
 > carefully look in my bag
 > get the ball from it
 > slowly give him it
 > quickly throw the knife in the bag at him

Now, while natural language parsers (NLPs) would probably have no
problem with the above set of inputs, I have not been able to truly
break into the literature describing how and why such parsers
work. Much of said literature also seems rather overpowered compared
to the tasks required for most muds. Therefore, I submit this humble
beginning with the hopes that either many people without experience
in NLPs can come up with something comparable, or that someone with
such experience can help me overcome the hurdles and barriers that I
am sure I will inevitably face. Therefore, on to my idea (which I do
not claim to be original):

All basic information is broken up into Chunks of differing types:

  Noun Chunk:
         Determiner (a, an, any, the)
         Ordinality (first, 2nd, etc)
         Other Adjectives (color, age, etc)
         Location (Prepositional Chunk)

  Prepositional Chunk
          (any preposition determining location or direction, ie on
          or to)
         Destination (Noun Chunk)

  Verb Chunk

  Action Chunk
         Actor (Noun Chunk)
         Action (Verb Chunk)
         Direct Object (Noun Chunk)
         Indirect Object (Noun Chunk)
         Target (Prepositional Chunk)
         Secondary Actor (Noun Chunk)
         Secondary Action (Verb Chunk)

In order to handle pronouns, all characters (both players and
mobiles) would keep track of three Noun Chunks: him, her, and
it. Each of these would refer to the last referenced person or thing
of the appropriate type. For example, given the input

 > get the ball from Alice and give it to Bob

the player's reference chunks would contain him(Bob), her(Alice),
and it(ball).

Using such a system, all of the previous commands could be described
in an Action Chunk:

 > (I)(Actor) [bow](Action) [at Bubba] (Target)

 > (I)(Actor) [carefully look](Action) in my bag(Target)

 > (I)(Actor) [get](Action) [the ball](Direct Object) [from it(the

 > (I)(Actor) [slowly give](Action) [him(Bubba)](Indirect Object)
   [it(the ball)](Direct Object)

 > (I)(Actor) [quickly throw](Action) [the knife in the bag](Direct
   Object) [at him(Bubba)](Target)

The possibilities of such a system are realized when consideration
of the 'say' command is used. For example, suppose the input is

 > loudly say that white dog in the street bit me!

The action chunk generated by this input would be

 > (I)(Actor) [loudly say](Action) [the white dog in the
   street](Secondary Actor) [bite/past](Secondary Action)
   [me(I)](Direct Object)

The information from this action chunk could then be handled in
several ways. For example, this allows complex languages to be
implemented, with understanding depending upon both the complexity
of the ideas produced (in terms of how "full" the various chunks
are), and in terms of the placement of the ideas within the
sentence. (It additionally allows for fractured translations based
upon grammar, such as the above translating to "Bite(past) me by dog
(white modifier street location)", as well as by word, such as "The
white (untranslated) in the street stabbed me!")

Also, having such information broken down by chunk allows a sort of
knowledge database to be built by NPCs, such that they could perform
a "reality check" on information given to them by players."

 > loudly say that white dog in the street bit me!  You say (rather
   loudly), "That white dog in the street bit me!"  Boffo the
   shopkeeper responds, "Laddie? Oh, he's never bitten anyone! 
   You're a liar!"

I will readily admit I currently have no idea how to efficiently
implement such a knowledge database. I am also aware that the
system, as it currently stands, does not do a very good job of
encapsulating ideas such as

 > say hello
 > ask Boffo how much is the doggie in the window?

Perhaps additional fields, such as a query field or a greeting
field, in the action chunk would solve this.

As I said, I am quite interested in hearing the opinions of others
in this system, especially in how to extend it to be more useful, or
in any fundamental shortcomings of such a system.

T.H. Cooke 

MUD-Dev mailing list
MUD-Dev at kanga.nu

More information about the MUD-Dev mailing list