R: [MUD-Dev] DGN - Method of controling NPC's.

Ghilardi Filippo ghilardi at dsdata.it
Fri Dec 5 11:32:35 New Zealand Daylight Time 2003

From: Tony Hoyt 

> And it revolves around controling Mobs.
> The ideas was this, Mobs/NPC's in general where seperate
> applications that where launched via Cron jobs and then acted like
> a local client to the server. The jobs where cron-ed due to allow
> for a random selected time to occure before the NPC to spawn.
> Thus every NPC in the game was really just a seperate
> mini-local-client that controled a unique character type.

I would never use Cron jobs for a couple reasons...

  - What happens if mob/npc isn't killed? Cron will spawn another

  - Using Cron you spawn mob/npc at very precise hours/times....

those issues can be worked around but there's other solutions that
have more freedom in case you need.

You could simply setup a deamon that read from a configuration file
what to spawn and at wich frequency and variance... Then make this
deamon to spawn whatever is needed. Doing so, you have a common
place that can keep informations on what is active, what isn't and
need to be spawned or when. I think that is more flexible (and at
same time very similar with what you tought initially)

Another point is if is really necessary to have a different
executable for each mob. Depending on size of your world it could
end up having thousands of them in memory. Could be interesting to
have a single executable to deal with a bunch of mobs of the same

ciao ciao
MUD-Dev mailing list
MUD-Dev at kanga.nu

More information about the MUD-Dev mailing list