Re: Autoloot

From: Sammy (samedi@clark.net)
Date: 07/26/95


On Tue, 25 Jul 1995, Ron Poulton wrote:

> > 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.
> 
> 
Yep.  I've been playing with merc 2.2 and circle 3bpl8.  Whichever one I 
eventually stick with, I plan on using a system like that.  For right 
now, though, the merc text files are a real convenience during 
development.  I s'pose I could throw a god-command in circle to text-save 
a player in merc format when I want to look at a pfile.  Guess I'll put 
that on my big list of small projects ;)

Sam



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