Re: Autoloot

From: Ron Poulton (ron@res.com)
Date: 07/25/95


> Merc does this simply and easily.  I've been looking at Merc 2.2 source.  
> In a Merc pfile, which is text-based and parsed when loaded, has text 
> labels for every field.  It's a little wasteful, but you could use 3 
> letter identifiers in place of the long labels.  The beauty of the setup 
> is that the pfile entries can be in any order.  The parser loads a line 
> at a time and decides what to do with each one.
> 
> Setting default values is easily accomplished.  Initialize them just 
> before the pfile is loaded.  Then old pfiles are converted to new pfiles 
> the next time the user connects.

It's a method that's very easy to have a program automatically upgrade if 
anything is added to the structure.  This is exactly what I was talking 
about.  And I think the 'waste' is overcome if the file's not necessarily 
a text file, but a binary file.

Instead of, say:

  Name:Cromtiklorach
  Class:3

I would prefer the structure as:

<1>Cromtiklorach<0><2><3>

<1> is ASCII 1, meaning "the next null-terminated string is the name", 
then Cromtiklorach<0> is the string, then <2> means "the next numeric is 
the class", etc.  This method is what I was using rather than text files, 
and it's very efficient if written properly.

If an entire player file were read in as a block and then parsed, the MUD 
wouldn't have to spend a lot of time chopping up a text file into 
separate pieces.



This archive was generated by hypermail 2b30 : 12/07/00 PST