Re: Slow mobile_activity

From: Skylar (
Date: 02/23/96

On Sat, 24 Feb 1996, David Powell wrote:

> 	We have been having problems, as our mud grows, with mobile_activity()
> taking heaps of time.  It is only called every 10 seconds, but it is not
> uncommon for 3 seconds or more to be spent in this routine. I suspect this is
> The basic idea of this is to set the virtual alarm to go off a little before 
> the next pass has to begin, then process mobs as usual in mobile_activity()
> until the alarm goes off. Then after the next pass, do the same thing but
> continue processing in mobile_activity() from the mob it got up to on the last
> pass. The effect of this would be to hopefully remove the bottleneck of
> mobile_activity, but it would also remove the exactness of mobile pulses. I
> plan to do it so mob's still only get pulsed about every 10 seconds, but it
> would not be exact as it currently is (not really a problem).

How "biggish" is your mob base?  I've trippled the size my mobact.c by 
adding lots of crazy stuff like mobs that loot and wear gear, or switch
into gear thats better, fire bows and re-wield arrows if they have them,
hunt people, and attack eachother but never ran into any slowdown at all.
Of course I dont have a huge number of mobs running around, but then 
again, my mud is running on a tiny machine with only 12 megs of ram...

Anyways... as for halting the mobact run in the middle of the 
character_list and picking up where you left off... I dont know about 
that idea.  What happens if the ch you last stopped on dies between
PULSE_MOBILE's ?  If you're looking to make mobact a lil more efficient,
how about keeping seperate linked lists of the different types of mobs
that get acted upon, then go through those on their own activities
instead of cycling through the whole character_list ... re: 
aggr_activity(),  scavenger_activity(),  memory_activity() and so on.

my two gold coins ...


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