[MUD-Dev] Naming and Directories?

Mark Gritter mark at erdos.Stanford.EDU
Sat Mar 13 22:49:30 CET 1999

Mik Clarke writes:
> > [Mark Gritter:]
> >
> >  >In MUDs I'm familiar with, directories seem to be done in a very ad-hoc
> >  >fashion.  Objects may have no name associated with them at all, or a
> >  >name can be discovered only by exhaustive search.
> >  >
> >  >Dikus are a partiularly bad example here.  Doing a "tell" may involve
> >  >scanning the entire list of online players.  Objects (I mean driver-level
> >  >objects including mobs and items) are named only by their location in 
> >  >memory;
> >  >object prototypes have essentially meaningless integer IDs.
> Not a reply to Chris, but to the original, which seems to have escaped me.
> Given a task of sending a message to a specific player, when that player could be
> located anywhere within the mud, how do you propose to do it faster than by running
> the list of all connected players?  Sure, a binary index by name might help, but I
> suspect you'd have trouble seeing the saving...

Hans Staerfeldt suggest "search tries" in his response to my original e-mail.
The idea is that each node stores a name and 26 pointers to child nodes.  The
tree is searched by using successive letters as an index to the array of
pointers.  You can search for abbreviations easily in this scheme--- if
you run out of letters and the node has only one child, you've found the
full name.
I should write up a DevMUD module.  :)

It's true that you're unlikely to notice a big difference unless the name
lookup is done often.  Naming usually isn't the critical path, I'd imagine,
which is why I'm really more interested in the qualitative rather than 
quantitative aspects of directories.

Mark Gritter
mgritter at cs.stanford.edu

MUD-Dev maillist  -  MUD-Dev at kanga.nu

More information about the mud-dev-archive mailing list