[MUD-Dev] Re: MUD Design doc (long)
cg at ami-cg.GraySage.Edmonton.AB.CA
Sun Jan 3 10:13:11 New Zealand Daylight Time 1999
>The most reasonable thing is probably to have some kind of 'default
>function' (be it via inheritance or some other construction) that handles
>everything but the 'unusual case,' where the builder overloads this
>'default function' with his scripting code. This should probably be done
>regardless of whether you implement all your commands in the scripting
>language or in your static server.
If your system allows dynamic procs and the controlled calling of them,
there are further twists that you can do to make things easier and more
consistent. Have your 'default function' always run, and perform all
of the checks that need to be done before anything specific to the
object in question needs to be tested. At that point, check for the
existence of a special processing function for this verb on that object,
and call it if found. Otherwise do the normal default processing. In
either case, you may or may not want to do common 'after-special-case'
processing, depending on the result of that special case. In fact, all
the real work may be done there, and 'normal default processing' consists
of nothing at all.
With this sort of scheme (or whatever variant a given system allows for),
the standard checking and work is done in precisely one place, and special
handling consists only of the part that differs from the standard stuff.
Of course it gets a bit more complicated than the above - some special
stuff might be only pre-action checks. Some might be alternatives for
the core of the action. Some might be post-action additions. There can
be special checks/actions attached to the character, the object and the
current location. It gets messy, but is doable, and once done properly,
special objects, etc. can be setup fairly easily, and you still have
reasonable confidence that changes to the main processing will affect
everything that they should.
Don't design inefficiency in - it'll happen in the implementation. - me
Chris Gray cg at ami-cg.GraySage.Edmonton.AB.CA
More information about the MUD-Dev