Welcome to the Builder Academy

Question possible mob memory bug

More
08 Aug 2012 15:49 #589 by Liko
Replied by Liko on topic Re: possible mob memory bug

Rumble wrote: It isn't very fair to newbies to put a mob in the hometown that will repeatedly kill a clueless newbie.


They shouldn't make it aggro, newbie shouldn't attack it, but like I said it all comes down how the mud owner wants to handle it.

Randian(0.0.0)
Owner/Developer

Please Log in or Create an account to join the conversation.

More
08 Aug 2012 16:03 #590 by zusuk
Replied by zusuk on topic Re: possible mob memory bug
Well I'm just giving over a perspective from a stock TBA view, if I understand the code correctly.

Assumption: MEMORY flag means that a mob, once attacked, will remember the victim until he dies (or MUD reboot, etc). But dying is one of the factors, as is evident by the forget() call in fight.c

That being the case, you can hit Mr. Mercenary #1... flee from him, and forget you fought him.

Later, go hit Mercenary #2.. and die... his (#2) memory is cleared, but guess what... Mr. Mercenary #1 still will remember you

Which means on the way to pick up your corpse from your death to Mercenary #2, Mr. Mercenary #1 will jump you.

Now, if that was how you want that flag to behave, we both are on the same page.. I am of the opinion that the flag should behave differently.

Website
www.luminariMUD.com

Main Game Port
luminariMUD.com:4100

Please Log in or Create an account to join the conversation.

More
08 Aug 2012 18:12 #595 by Liko
Replied by Liko on topic Re: possible mob memory bug

zusuk wrote: Well I'm just giving over a perspective from a stock TBA view, if I understand the code correctly.

Assumption: MEMORY flag means that a mob, once attacked, will remember the victim until he dies (or MUD reboot, etc). But dying is one of the factors, as is evident by the forget() call in fight.c

That being the case, you can hit Mr. Mercenary #1... flee from him, and forget you fought him.

Later, go hit Mercenary #2.. and die... his (#2) memory is cleared, but guess what... Mr. Mercenary #1 still will remember you

Which means on the way to pick up your corpse from your death to Mercenary #2, Mr. Mercenary #1 will jump you.

Now, if that was how you want that flag to behave, we both are on the same page.. I am of the opinion that the flag should behave differently.


True,
Well here is how I wrote fixing it without getting into extract character.

1. Open fight.c and search int damage and add:
Code:
struct char_data *tch;

2. Then search forget and right under it add:
Code:
if (GROUP(ch)) { while ((tch = (struct char_data *) simple_list(GROUP(ch)->members)) != NULL) { if (tch == ch) continue; if(MOB_FLAGGED(tch, MOB_MEMORY)) forget(tch, victim); } }

Close and compile.

What this code does is searches the mobs group and if the groups member is flagged with memory it makes them forget the victim. Let me know if this works. I have no memory mobs in my game. :)

Randian(0.0.0)
Owner/Developer

Please Log in or Create an account to join the conversation.

More
09 Aug 2012 03:10 #606 by Vatiken
Replied by Vatiken on topic Re: possible mob memory bug
I gave this some thought, and I agree with Zusuk that the intended affect of death should whipe the dying PC from the memory of all NPCs that might remember him/her. I've updated the svn with a fix for this problem, as well as a fix for the issue of a dying PC respawning at his corpse from time to time. I'm not sure if this will fix the OP original issue, but if it doesn't the hunt will continue.
Code:
Index: comm.c =================================================================== --- comm.c (revision 322) +++ comm.c (working copy) @@ -473,7 +473,13 @@ } else { write_to_descriptor (desc, "\n\rCopyover recovery complete.\n\r"); GET_PREF(d->character) = pref; + enter_player_game(d); + + /* Clear their load room if it's not persistant. */ + if (!PLR_FLAGGED(d->character, PLR_LOADROOM)) + GET_LOADROOM(d->character) = NOWHERE; + d->connected = CON_PLAYING; look_at_room(d->character, 0); Index: handler.c =================================================================== --- handler.c (revision 322) +++ handler.c (working copy) @@ -930,10 +930,19 @@ if (FIGHTING(k) == ch) stop_fighting(k); } - /* we can't forget the hunters either... */ - for (temp = character_list; temp; temp = temp->next) + /* Whipe character from the memory of hunters and other intelligent NPCs... */ + for (temp = character_list; temp; temp = temp->next) { + /* PCs can't use MEMORY, and don't use HUNTING() */ + if (!IS_NPC(temp)) + continue; + /* If "temp" is hunting our extracted char, stop the hunt. */ if (HUNTING(temp) == ch) HUNTING(temp) = NULL; + /* If "temp" has allocated memory data and our ch is a PC, forget the + * extracted character (if he/she is remembered) */ + if (!IS_NPC(ch) && MEMORY(temp)) + forget(temp, ch); /* forget() is safe to use without a check. */ + } char_from_room(ch);

tbaMUD developer/programmer

Please Log in or Create an account to join the conversation.

More
09 Aug 2012 11:08 #610 by Liko
Replied by Liko on topic Re: possible mob memory bug

Vatiken wrote: I gave this some thought, and I agree with Zusuk that the intended affect of death should whipe the dying PC from the memory of all NPCs that might remember him/her. I've updated the svn with a fix for this problem, as well as a fix for the issue of a dying PC respawning at his corpse from time to time. I'm not sure if this will fix the OP original issue, but if it doesn't the hunt will continue.

Code:
Index: comm.c =================================================================== --- comm.c (revision 322) +++ comm.c (working copy) @@ -473,7 +473,13 @@ } else { write_to_descriptor (desc, "\n\rCopyover recovery complete.\n\r"); GET_PREF(d->character) = pref; + enter_player_game(d); + + /* Clear their load room if it's not persistant. */ + if (!PLR_FLAGGED(d->character, PLR_LOADROOM)) + GET_LOADROOM(d->character) = NOWHERE; + d->connected = CON_PLAYING; look_at_room(d->character, 0); Index: handler.c =================================================================== --- handler.c (revision 322) +++ handler.c (working copy) @@ -930,10 +930,19 @@ if (FIGHTING(k) == ch) stop_fighting(k); } - /* we can't forget the hunters either... */ - for (temp = character_list; temp; temp = temp->next) + /* Whipe character from the memory of hunters and other intelligent NPCs... */ + for (temp = character_list; temp; temp = temp->next) { + /* PCs can't use MEMORY, and don't use HUNTING() */ + if (!IS_NPC(temp)) + continue; + /* If "temp" is hunting our extracted char, stop the hunt. */ if (HUNTING(temp) == ch) HUNTING(temp) = NULL; + /* If "temp" has allocated memory data and our ch is a PC, forget the + * extracted character (if he/she is remembered) */ + if (!IS_NPC(ch) && MEMORY(temp)) + forget(temp, ch); /* forget() is safe to use without a check. */ + } char_from_room(ch);


I know the little code I posted works if the same named mob(merc) is grouped together that if they all remember player, that once one merc kills him, it searches their the kills group and removes the victim from their memory.

Randian(0.0.0)
Owner/Developer

Please Log in or Create an account to join the conversation.

More
09 Aug 2012 12:13 #611 by zusuk
Replied by zusuk on topic Re: possible mob memory bug
Thanks Liko/Vatiken for the fix(es) :)

Website
www.luminariMUD.com

Main Game Port
luminariMUD.com:4100

Please Log in or Create an account to join the conversation.

Time to create page: 0.203 seconds