[crossfire] Map cache

Brendan Lally brenlally at gmail.com
Thu Aug 25 18:45:31 CDT 2005


On 8/25/05, Anton Oussik <
     
     antonoussik at gmail.com
     
     > wrote:
>
     
      A solution I propose is to pre-load large maps and keep them around in
     
     >
     
      memory in case they are needed. 
     
     
Depends what you mean by pre-load. It might be possible to have the
server check each map when it loads, and then load all maps on exits
leading of from that map in an independent thread.

Of course this requires that the map loading be thread-safe, and I'm
fairly sure it isn't.

An alternitive (which might be easier) would be to have a seperate map
loading thread at all times, and when a player enters an exit, not
change their map to the new one, but instead place them in 'limbo' if
the map isn't loaded (a unique map which is 1x1 and has no objects.
Then the player object would need to check every tick to see if their
map is ready. This still poses some problems with what to do with the
command queue, if a player has hit multiple arrow keys, should they be
discarded?

The other approach is to simply say that all the world maps put
together are fairly small, compared to the amount of memory many
servers have these days (and this is increasingly more and more true),
so it would be possible to just load all maps at start up, and keep
them loaded until they reset.

    
    


More information about the crossfire mailing list