[crossfire] Re: map and player persistence question

Lalo Martins lalo at exoweb.net
Sun Sep 11 05:43:42 CDT 2005


Can I ask that, when you collect answers to your satisfaction, you put
them together in a single document, and stick it on the wiki?  These are
very useful questions for new hackers trying to understand the system.

I'll tell you what I know, but it may be slightly inaccurate in the details.

And so says Alex Schultz on 11/09/05 09:28...
>>
     
      Is there any mechanism for state changes to a map that
     
     >>
     
      will not be cleared after a short amount of time? If
     
     >>
     
      so where is the source code that deals with that?
     
     >>
     
     
     >
     
      Well, if you're referring to the apartment style maps, you would want to
     
     >
     
      look at the saving code in common/maps.c
     
     >
     
     
     >>
     
      Are changed maps ever saved to disk for any reason in
     
     >>
     
      crossfire?  By changed, I mean maps with items dropped
     
     >>
     
      on them, or generated monsters, or whatever.
     
     >>
     
     
     >
     
      Again, apartment/guild maps.
     
     
There are two relevant mechanisms, both referred to commonly as
"uniqueness".

First, a map can be "unique" (by setting the unique flag to true on the
exit object that leads to it).  Hmm, that's not precise; an _exit_ can
be unique.  Yes, that's better.  (Although we refer to this feature as
an "unique map".)

If an exit is unique, a player that goes trough it will be taken to a
special version of the target map; this version is different for each
player, and is persistent - when it resets, its whole contents will be
saved to disk.  However, they are saved to the player's directory.

The other thing in unique items.  When a map reset, any cell that has
any items marked "unique" (except for exits... I think) will be saved to
an "overlay" map file, which is in turn saved to a special directory.

The way this is usually put to use, is by marking a few _floor_ objects
as "unique", so that those cells will always be saved.  You may hear
people referring to this practice as "unique floor" or "unique squares".
 Guild houses (iirc) have a room or two with unique floor, so that you
can keep your loot there.

best,
                                               Lalo Martins
--
      So many of our dreams at first seem impossible,
       then they seem improbable, and then, when we
       summon the will, they soon become inevitable.
--
     
     http://www.exoweb.net/
     
                       mailto:
     
     lalo at exoweb.net
     
     
GNU: never give up freedom                 
     
     http://www.gnu.org/
     
     
    


More information about the crossfire mailing list