[DGD] Heartbeat

Jay Shaffstall jshaffst at netwalk.com
Tue Jan 14 17:58:56 CET 2003


>Any recommendations or things I should know about (but apparently can't 
>find) about setting up a timer/heartbeat, or anything similar, for 
>purposes of combat.

Use the call_out kfun to schedule a function to be called after a specified 
delay.  A heartbeat mechanism typically runs on every living object, 
calling a function every so often.  This can be a huge number of call_outs, 
each of which takes up resources and time to execute.  If you have a 
heartbeat mechanism, it should only run if it has something to do.

In the mudlib I'm working on, I have a combat daemon that is used to start 
and stop combats.  It creates a combat object to manage each combat, and 
the combat object itself has the equivalent of a heartbeat mechanism.  So I 
get a call_out for every combat, not for every participant of a combat.

I have yet to do a load test on this, though, so I can't say whether it 
keeps up with a large number of combats well or not.

Jay

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.dworkin.nl/pipermail/dgd/attachments/20030114/28060e55/attachment.html>


More information about the DGD mailing list