Issues from the digests and Wout's list

Chris Gray cg at ami-cg.GraySage.Edmonton.AB.CA
Sun Apr 20 21:25:58 New Zealand Standard Time 1997

[Chris L:]
:The only solution there is to bind "drink" et all to the player
:objects (or something that all players always carry).	Drink then
:resolves on the player, and the verb then goies out looking for an
:object to satisfy.
:It can make for an expensive parser.

Why? Parsing is easy, since you don't have much searching to do to find
the verb to use. The verb has to then figure out what objects it ought
to be using, but since that code can, if desired, be specific to that
verb, it can make a more intelligent choice, since it likely has ready
access to all of the objects around. Once the verb picks the objects(s)
to use (or prints some reasonable failure message, which is the whole
point of doing things this way), it can trigger custom methods on the
objects involved. I've never seen the benefit in all the duplication
and inconsistency that comes from having the verbs on the objects.
Custom code on the objects, yes, but only when they need to have a
behaviour different from the default.

One problem I've never satisfactorily answered for myself is that of
what order to do the checks in. If you have a verb 'plugh' that takes
a direct and an indirect object, there can be checks/modifiers for that
verb on the player, in the room, and on both objects. What is the best
order for calling them? Does it vary from verb to verb? My "generic"
verb handler code currently does: player, room, direct-object,
indirect-object. I can't swear that all specific verbs do that, however!

Chris Gray   cg at ami-cg.GraySage.Edmonton.AB.CA

More information about the MUD-Dev mailing list