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

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.

Currently, the map handling rountines work more or less like this:
- If a map has not been loaded yet, load it from CF/lib/maps/*.
- Keep the map in memory while there are some players on it.
- A few seconds/minutes after the last player has left the map,
  swap it out to disk in /tmp or some other place ($TMPDIR).
- If a player re-enters the map, reload it from /tmp.
- If nobody enters the map in two hours (or some preset time), the
  map is reset, which means that is is deleted from /tmp.

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.
- 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
  to avoid creating files in the lib directory (according to the
  GNU Coding Standards, the lib directory should be read-only and we
  should put files such as the list of high scores or the list of
  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).

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?

-Raphaël
-
[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]