[MUD-Dev] Dealing with cloned NPCs

Thomas Sullivan one4k4 at yahoo.com
Fri May 30 07:23:27 New Zealand Standard Time 2003


No, not sheep.  Not yet, at least.

Here's my pickle.  I'm writing a codebase from scratch
(https://smud.sourceforge.net), I've posted here a couple times
before so somebody might remember it. Regardless.. There are a few
basics:

  It is written in Perl
  It uses MySQL
  It will use XML/mod_perl for client->server->client communications
  It currently uses Net::AIM as a client connection.
  (available via an AIM id I have yet to release..)

Ok, here's my question/thought.

  How do you coders deal with NPCs?  

Sounds like an easy one, and it may be that I'm overlooking the
simple facts.. But if I'm in a room and the "look" results are as
follows:

  You stand in the desert, with a wal-mart to your south.

  People here: Jum Jum Joey, a desert rat, a desert rat, an orc
  medic.

I want the user to be able to attack "a desert rat" and be able to
tell his friends to attack *the same* rat.. (grouping, etc..)

How can I deal with this?  My initial thought was some sort of udak
making it look like:

  (a)Jum Jum Joey, (b)a desert rat, (c)a desert rat..

etc..

The UDAK being the same regardless of what's there. (IE: If (b)
dies, the second rat is still (c))

But that seems hokey, and honestly the idea came to me while playing
Nethack (inventory menus..).

Do I make the descriptions different for each npc? Have cloned
copies with a column in the npc table saying what "attribute" this
npc has? So there can be: a field rat, a mangy field rat, a rabid
rat?

Sounds like they would have different physical attributes as well.

Do I make the NPC order simply attack the first one first?

Each NPC will be individually making its own check to see if it's
aggro'd on the PC(s) (or other npcs for that matter) in the room,
adding npc_ids or pc_ids to it's hate list and the combat daemon
will process them as it goes along..

In typing this it seems like simply attacking the first version of
the same npc would be a worthy solution but I wonder what others do?

(Kanga.nu is unavailable from work and I can't seem to find much in
the way of source.. does anybody have any examples?)

Thanks a bunch guys,

-Tom (www.poorheart.com)

_______________________________________________
MUD-Dev mailing list
MUD-Dev at kanga.nu
https://www.kanga.nu/lists/listinfo/mud-dev




More information about the MUD-Dev mailing list