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

Sheela Caur'Lir dstgasey at webhiker.dk
Fri Dec 5 04:13:25 CET 2003


From: "Tony Hoyt" <gmtonyhoyt at yahoo.com>

> 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.

> Does this method sound familure to anyone? Is there a clear case
> of something like this being done before?  I'm looking for
> examples and code as to how this can be done.  It sounds simple
> enough but I would like to see it in practice or perhaps just a
> small demo/proof of concept app so I may understand more of just
> HOW it works.

I'm afraid I cannot point to any direct source on this, but I can
offer my abstracts on how I did mine with my own enthusiast project.

Basically a MOB was as usually an object, and to all objects I could
assign states / modes. Thus if the environment changed around said
object it's state was changed into either a simpler or a more
complex state. Which meanst I could code each state as a small piece
of code seperately of the others.

Offcourse, one NPC may trigger on other stuffs than another so it
can get a tad hard to keep track of, but I liked it none the less.

Most often used states / modes would be "under attack", "idle" and
"meets another object" in which case the object(s) involved would be
checked against their data to see if they should be triggered or
not. But there was theoretically unlimited amount of states, you
could just program a new one.

Ie. Human Paladin NPC meets Skeleton, aggresion occurs and Paladin
attacks skeleton. But it could also be male wolf meets female wolf
and they go off to have a romp in the wilderness and begets 5 wolf
pups.

So I had one thread (or more if there were many of that type jobs)
running "idle" states ... the idea being that it should be possible
to make dynamic server load ... I never got that far. It did make it
easier to tweak the "combat" state fairly easy though, since it
relied upon data on the objects.

Well ... I found it easier at least, the other enthusiasts got a bit
confused on it. But then again, it was just a hobby project at the
time after all.

I'm unsure how the big commercial MMOG's do it, and quite interested
in hearing from such a source.

---
Jens L. Nielsen
(aka. Sheela Caur'Lir)
_______________________________________________
MUD-Dev mailing list
MUD-Dev at kanga.nu
https://www.kanga.nu/lists/listinfo/mud-dev



More information about the mud-dev-archive mailing list