[DGD]Ponderings, by jack handy

Stephen Schmidt schmidsj at union.edu
Mon Apr 17 21:39:45 CEST 2000


On Mon, 17 Apr 2000, James Bearden wrote:
> This may be a bit off subject as far as the driver goes, but I'm using dgd 
> for my driver and I *think* most people use it for muds.

I've actually gotten the opposite perception; most people,
at least most on this list, are not using it for muds, or
indeed, for games of any kind. I've often wondered if that's
true, and if so, why, but have no real answer. But...

> I got to thinking 
> about the way most people define their objects as living or non living. Most 
> do it with a heartbeat tick type thing which as I understand it (I may be 
> wrong) the objects just starts ticking at a defined rate when it exists. 

Actually, for the reason noted elsewhere in the original post:

> If I had npc's and pc's both inherit the 
> heartbeat/skill array and create massive amounts npc's and pc's with their 
> own ticks running because they are defined as 'living' objects in the mud, 
> wouldnt that create some sort of effect on resources?

most muds are coded so that NPCs turn off their heartbeats when
they are at full healing. Thus, the NPC inherits the heartbeat
code (making it a living object) but most of the time, don't
use it. (Typically, only when in combat, when healing up from
combat if they survive it, or when moving if they do that.
Movement is usually done by call_other, not by heart_beat,
but the principle's the same either way.)

If you do not do it that way, if all living objects call
heart_beat all the time, your mud wedges rapidly. Do Not
Do That  :)

You can probably even shut down the player's heart_beat if
you feel like doing that, if you're not using it for anything
other than combat (or, if you can detect when you're not
using it for other things that you might use it for, and you
can reliably restart it when you need it).

> So then I thought, why not have one central time, and when something queries 
> to go off balance it looks at the current time, and then ticks for the 
> amount I want it to instead of constantly ticking.

That's essentially what call_other() does. (At least, that's
what I was told it does, back when I was a programmer on a
MudOS mud, and I understand that DGD is probably similar
on this point. Please correct me if DGD differs here....)
 
> Or would that be even more complicated for what its worth, if its even worth 
> anything.

It is more complicated, because you have to maintain a sorted
list of pending events, but it is (much!) less CPU-intensive
if you're going to have a lot of objects with long delays. 
 

Stephen Schmidt

It is vain to expect a well-balanced government without a
well-balanced society.
			-- Gideon Welles




List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list