Re: Question about mobs fighting each other

From: Skylar (skylar@ifconfig.intserv.com)
Date: 07/23/96


On Tue, 23 Jul 1996, Mud Admin wrote:

> I want to have my MOBs attack and kill each other, as well as PCs. For 
> example, the aggressive_evil citygaurds would keep out evil NPCs as well 
> as evil PCs. Nice theory, huh? 

Yeah, I like it... makes things seem more realistic.


> So, I go into mobact.c and take the IS_NPC(ch) check from the aggressive 
> checks. Now my MUD will crash at random, and I cannot tell why. But this 
> is the only code change I have made to stable code.

After reading this, I did the same thing on a stock copy of pl11 because I
thought it might be kind of funny to see in action... some problems;
Aggressive mobs dont make any check to see if vict = ch when attacking 
(normally they wouldnt need to, but when they're attacking eachother, you
 probably want them to not attack themselves as well... its probably the
 root cause of the crashes).
The mud crashes durring the helper part of mobact... I'm not sure, but I
think its probably because the mob ends up assisting themselves fighting
themselves, or it could be some madness where they're assisting themselves
right after they've killed themselves or something similarly insane :)



> a) Is there a better way of having fighting MOBs?

Make more extensive checking to make sure everything is a-ok, checking
that probably issnt needed at all under the current stock system, so
issnt present in the code.  Also, you might want to add some sanity to
the whole scheme and make say, certain races attack other races and
certain clans attack other clans... if just all aggr mobs are attacking
other aggr mobs by the time any players arrive on the scene every place
on the mud that loads a group of aggressives in one room will have just
one surviving mob who is going to probably be pretty hurt from slugging
it out with his "comrades".


> b) Is there a way I can tell more about how/what more specifically is 
> going wrong that is causing it to crash? I am getting nothing in the 
> syslog or anything. Just bang, dead.

Check out gdb... read the man pages for it extensively, its probably your
second best friend after grep as far as implementor's tools go.



-Sky


ImpMUD    -  circle-coders.intserv.com (207.8.156.36) 9000
Exile     -  exile-rp.intserv.com  (207.8.156.59)     4000
Angstland -  angry.infowar.com (207.8.156.??)         4000



This archive was generated by hypermail 2b30 : 12/07/00 PST