Re: Zone Idleing code?

From: Herbert Kremser (
Date: 10/26/95

On Thu, 26 Oct 1995, Alex wrote:

> On Thu, 26 Oct 1995, Wout Mertens wrote:
> > You rebuild db.c a bit so it can load a single zone instead of all, you 
> > make all rooms a kind of linked list that can be deleted, and a timer. 
> > Simple, no? :)
> > 
> There are likely faster ways of doing this, for example, I know that the
> coder for my mud wrote up a zone idle'ing procedure that took him about
> 3 days.
I guess it's me which you are talking about  :)

> I would think that a better method might be to load each zone
> seperately (which is dnoe anyways I think) and then write idle'ing code
> that would free the memory from those zones except it would keep some
> sort of list of the available room numbers in memory (only the rooms
> would be idle'ed out because you'll need the objects and mobs for players'
> objects and maybe charmees and whatnot...)
The main part, not the work but the effect, is to idle out the objs and 
mobs. Also room descriptions are idled, as we have implemented it, but 
the rooms are still in place, so you still can use "goto" command. Make a 
zone come out of idle (reload the descriptions and all mobs and objs) 
whenever a char_to_room takes place. By this you don't have to change 
most of the existing code, otherwise you would have to check if a zone is 
idle in many places.

The reason why manually idling gives usually better results than OS
paging system, is that objs and mobs are usually stored close together,
but paging takes place in bigger amount of memory.
The parts of a mob which are checked often (every mobact) are most probably
in same block as the parts you need when something special happens (f.i.
you only need the description, which needs lot of memory, whenever
someone types look).
So the typical OS will page out & in _everything_ on any mobact or objact.
Ok, my mud isn't a circle one, but unless they really have changed
the let_the_OS_care_how_to_give_memory policy of gamma diku, this should
still be true.

[on public request 12 lines of signature deleted]  *snip* ;)

This archive was generated by hypermail 2b30 : 12/07/00 PST