[MUD-Dev] Re: MUD verb handling (Was: DevMUD - thoughts.1)

Adam J. Thornton adam at phoenix.Princeton.EDU
Sun Oct 25 10:07:55 CET 1998


On Sun, Oct 25, 1998 at 12:54:34PM +0100, The Arrow wrote:
> For example, assume Bubba the human tries to pick up a rock, the rock object
> have a a before handler for the OnGet verb that checks the strength of the
> actor and prints "The rock is to heavy for you." message and returns false
> if the actors strength is to small, making the rock ungetable for Bubba.

Has anyone delved deeply enough into the Inform code to see how separable
the parser/tokenizer/semantic parts are?  It seems like there should
be--for a generic MUD project, although *not* necessarily for Inform or
Hugo--very distinct steps.  The first part needs to break input into
separate chunks: this is the verb, this is a direct object, this is a
preposition (and needs to be flexible enough that, for example, a
point-click-drag paradigm rather than a type-at-the-prompt paradigm could
be done too).  The second needs to assign those chunks to data objects
within the system: the string EAT maps to verb #34.  The third does the
check to see whether the direct object is something that supports an EAT
method, either directly or through a superclass, and Does The Right Thing
with it.

The first is very low-level indeed, of course, and probably should be done
in native code.  The second depends on the interface to the world data, and
so should probably be in the game language.  The third is itself world
representation data and must be done in the game language if the system is
to have any flexibility.

Inform or Hugo might be good models.  They might not.  I've never dealt
with their internals.  I know TADS isn't: I ported Dave Baggett's Sun code
to Linux in '92, and I looked into doing an HTML TADS port a few months
ago.  That language, alas, was designed for a 16-bit DOS system, and the
implementation is incredibly crocky; the source is well-nigh unreadable.

Adam
--
adam at princeton.edu 
"There's a border to somewhere waiting, and a tank full of time." - J. Steinman




More information about the mud-dev-archive mailing list