[crossfire] Map cache

Mark Wedel mwedel at sonic.net
Fri Aug 26 01:51:56 CDT 2005


  The problem is that it often isn't the world maps that cause the lag.

  It is peoples personal apartments or the like where people pile many thousands 
of different objects.  I believe the worse case was the communal apartments. 
I'd imagine other cases right now might be guilds.

  The 'problem' with preloading is how do you know what maps to load?  Looking 
at all the maps on the server and figuring which to load would take a non 
trivial amount of time.

  Also, these maps still need to be saved out periodically, which may also take 
a non trivial amount of time.

  In addition, as the server is right now, when maps are in memory, the objects 
on them are processed, when not in memory, they aren't.  Thus, keeping a map in 
memory would result in that map being processed, which could mess some things up.

  The best solution is to do something similar to what Brendan suggests - 
seperate map loading, freezing the player.  I had tried to do something like 
that many years ago, never worked very reliable.

  Better long term would be for each map to have its own thread.  With multi 
core/thread cpu's, this makes more and more sense.

  However, that requires some prety significant changes.  First being that any 
function that declares any variables as static is not thread safe.


    
    


More information about the crossfire mailing list