Crossfire Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CF: Saving files for random maps



> I have a few questions or topics for discussion about the map files
> in CrossFire, especially in relation with the random map generator.

Some of which I can address, I think.  Thanks for your comments.

> The random map generator tries to use the standard routines as much
> as possible, which is nice in theory but brings a few minor
> annoyances:
> - The style files (treasurestyles, monsterstyles, ...) are small maps
>   loaded from CF/lib/maps/styles/*.  Since these maps are loaded with
>   the standard routines, they stay in memory for a while, then are
>   swapped out to the temporary directory and stay there for two hours
>   or more.  IMHO, it would be much better if these maps would be
>   reset immediately (i.e. they would never appear in the list given
>   by the 'maps command).  This would save memory and disk space.

It's possible I could do this with a little research into how to 
delete a map from memory.  I could simply call the reset function
on each style map when I leave the style function.  I wasn't
worried about memory/disk space....  These suckers are usually
small.

> - The generation of random maps causes files to be created in
>   CF/lib/maps/random/*, as well as files in /tmp.  It would be nice

I think I have fixed this:  the only writing which was being done
in the LIBDIR was done by me trying to open the output file for
writing.  In the server, I never actually SAVE the map:  I only do
that in the standalone version.  So what I saw was zero-length files
getting created.

I fixed this up so it shouldn't write anything in the /random dir.
It just needs to exist, I think.

>   books in var instead).  If the maps are randomly generated, there
>   should be no need to put files in CF/lib/maps/*: the only storage
>   space needed for random maps should be the /tmp directory (until
>   the map resets).

I think that's how it works now, in my own personal version of the
code which I'll give to you to evaluate in a little while (this week
sometime).

> So...  Is there a way to reset a map immediately after using it?
> Is it possible to have a map in memory (or in /tmp) which has no
> reference to a file in CF/lib/maps?

I'm interested in the answer to this:  disposing of the maps is
a good idea.

Raphael, I still can't repeat your weird problems with maps.

PeterM
-
[you can put yourself on the announcement list only or unsubscribe altogether
by sending an email stating your wishes to crossfire-request@ifi.uio.no]