[MUD-Dev] Magnetic Scrolls' magical parser

Nathan Yospe yospe at hawaii.edu
Tue Apr 29 07:36:52 New Zealand Standard Time 1997


On Mon, 28 Apr 1997, Adam Wiggins wrote:

:> adjective, IIRC the input was actually:
:> 
:> 	> plant pot plant in plant pot
:> 
:> This sort of complexity seems to be lacking from the current mud 
:> 'mainstream' in its entirety. Most of which I have come across seems to 
:> be parsing such as:
:> 
:> 	*  First word of input is the command, look it up in our hash 
:> 	   table of commands
:> 
:> 	*  Call the function corresponding to the command, passing the 
:> 	   rest of the input (ie everything after the first word) as 
:>            parameters to the function
:> 
:> So, you might have function prototypes for your command functions as: 
:> 
:> 	void function (Player player, String parameters);
:>   
:> All command functions would have their own parameter parsing algorithms; 
:> so, for the above example, function 'plant' would be passed 'pot plant in 
:> plant pot' as its parameters.
:> 
:> This is utterly simplistic, and although quite easy to implement, does 
:> not make me happy in any way! I've looked about the web for things on 
:
:See, I consider this a strength.  I would *never* type a command like
:"plant pot plant in plant pot", and if I did, I would hate to think
:that the parser would try to interpret it.  Of course, I generally
:like descently fast-pased muds...this would fit into more of a MUSH-style
:situation where you could spend more time crafting your commands.
:I like a simple set of tools with which to interact with the environment,
:that are never ambiguous and always easy for me to type.  The 'plant pot..'
:stuff is confusing for everyone, player and coder alike, so I'm not sure
:what the advantage is.

Actually, I designed my entire NLP around this type of worst case
scenario. I figured if it could correctly parse the worst I could concieve
of to throw at it, there was virtually nothing that could throw it through
a loop. So, on to the parse at hand:

plant the pot plant in the plant pot.
strip "plant" and pass it to the verb search... verbs searched inwardly on
all active scopes. Once ID'd, pass "the pot plant in the plant pot." to
the verb... assuming no local overrides of "plant" (or, eventually, no
overrides that can handle the parse... parse failure means next in line
gets a shot) the action is interpreted by the standard "plant", which uses
the <direct object> <locational specification> <key + indirect object>
form. "in" makes the parse pretty simple. It ends up as <the pot plant>
specified as do, <the plant pot (in)> as the location specifier, and a
default on the ido.

:On the other hand, NLP has come of interest to me of late as we've tried
:to make NPCs respond to communications from players.  Most muds have
:a simple keyword thing, ie:

:You say, 'Could you cast fly on me, please?'
:>
:The mage guildmaster says, 'Get out of here!  Quit wasting our time and go
:buy a horse or something!'
:
:One of my favorites from a mud I've played over the years...anyhow, this
:is obviously quite stupid, as it just searches your say string for the
:word fly, and would also respond to 'Someone kill that fly!'

This is probably the only practical way to do this, though boolean
operations on the search results are essential unless you want to be
terribly limited. (IE "cast" && "fly", "cast" ^^ "fly", "cast" || "fly").

:We've done some basic stuff with trying to break the sentence into major
:parts, which allows the mob scripts to easily determine insults, inquiries,
:statements, etc.  Still all very basic; I'm wondering if any of you have
:played with this at all?

Yeah, NLPs are a lot of fun, though a bit of a hair yanker at first. A few
months of hacking at it will result in some stunning breakthroughs,
especially if you nab some advanced linguistics theory texts specific to
the problem *grin*

   __    _   __  _   _   ,  ,  , ,  
  /_  / / ) /_  /_) / ) /| /| / /\            First Light of a Nova Dawn
 /   / / \ /_  /_) / \ /-|/ |/ /_/            Final Night of a World Gone
Nathan F. Yospe - University of Hawaii Dept of Physics - yospe at hawaii.edu





More information about the MUD-Dev mailing list