Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Server Code Submissions

Reply
 
Thread Tools Display Modes
  #1  
Old 06-12-2008, 05:38 AM
greggg230
Fire Beetle
 
Join Date: Jun 2008
Location: Vegas
Posts: 17
Default Aggro LOS fix (maybe..?)

I've just started playing around with the emulator a few days ago, and the only glaring bug I've noticed is that NPCs don't assist one another properly. No NPC will assist a MOB unless they have LOS on you--this is easily exploitable, obviously, and makes pulling mobs almost trivial.

I looked around in the code, and the solution seemed pretty obvious.

In aggro.cpp in the function EntityList::AIYellForHelp , a block of code checks for LOS in the following way:
Code:
if(useprimfaction || sender->GetReverseFactionCon(mob) <= FACTION_AMIABLE )
				{
					//attacking someone on same faction, or a friend
					//Father Nitwit:  make sure we can see them.
					if(mob->CheckLosFN(attacker)) {
#if (EQDEBUG>=5) 
						LogFile->write(EQEMuLog::Debug, "AIYellForHelp(\"%s\",\"%s\") %s attacking %s Dist %f Z %f", 
						sender->GetName(), attacker->GetName(), mob->GetName(), attacker->GetName(), mob->DistNoRoot(*sender), fabs(sender->GetZ()+mob->GetZ()));
#endif
						mob->AddToHateList(attacker, 1, 0, false);
					}
				}
The change is really easy. Just change if(mob->CheckLosFN(attacker)) to if(mob->CheckLosFN(sender)). That way, MOBs will assist each other whether or not they have LOS, but still with the restriction that they have LOS with either the MOB you aggroed or a MOB assisting that MOB.

I've tested it out a decent amount and things seem to be working fine. The only reason I can imagine the code would be like this intentionally is that the LOS function is expensive, but changing it this way shouldn't normally create a ton more work for the processor; my server showed no signs of slowdown or stress as a result in admittedly limited testing.
Reply With Quote
  #2  
Old 06-12-2008, 09:41 AM
John Adams
Demi-God
 
Join Date: Jul 2006
Posts: 1,552
Default

I'd like to see this on a relatively populated server where more than one player/group is aggroing stuff within the same range. That may be why it was tied to the aggroing party (hackhackhack).

Though I agree, I think this fix is nice and more in tune with how things should be. Nice work. TGC, anyone?
Reply With Quote
  #3  
Old 06-12-2008, 12:18 PM
cavedude's Avatar
cavedude
The PEQ Dude
 
Join Date: Apr 2003
Location: -
Posts: 1,988
Default

Aye, I'll merge it on TGC next reboot
Reply With Quote
  #4  
Old 06-12-2008, 01:39 PM
eq4me
Hill Giant
 
Join Date: Jul 2006
Posts: 166
Default

I always thought that LOS had something to do with aggro range. For example you could pull the single mob near the ladder from the Ghoul Suppliers room in LGuk when you aggroed him as soon as you saw him while climbing up said ladder. Climb to high and the whole room would come. But maybe something has changed since then.
Reply With Quote
  #5  
Old 06-12-2008, 03:55 PM
Congdar
Developer
 
Join Date: Jul 2007
Location: my own little world
Posts: 751
Default

I'm not sure if this is a good thing. If you want to link mobs, you should use the perl way to do it instead of a world wide change like this.
Reply With Quote
  #6  
Old 06-12-2008, 04:09 PM
greggg230
Fire Beetle
 
Join Date: Jun 2008
Location: Vegas
Posts: 17
Default

Quote:
Originally Posted by Congdar View Post
I'm not sure if this is a good thing. If you want to link mobs, you should use the perl way to do it instead of a world wide change like this.
I'm not sure I understand. This should be a world-wide change, as this is how MOBs should always act.

This has nothing to do with MOBs being linked in the sense that was implemented in Velious and later.
Reply With Quote
  #7  
Old 06-12-2008, 04:17 PM
Congdar
Developer
 
Join Date: Jul 2007
Location: my own little world
Posts: 751
Default

I said i wasn't sure. It seemed to me that assist is already working.
Reply With Quote
  #8  
Old 06-12-2008, 04:27 PM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

In testing this I would concentrate in dungeons, if you haven't already done this, bearing in mind there
is no pathing for aggroed mobs.

E.g. If I pull a mob and there is a mob around the corner that can't see me, but is within assist range
of the mob I am pulling, with this change, the unseen mob will run straight at me through the walls.

Should this second mob itself yell for help while it is 'running through the walls', possibly through
another room filled with mobs, there may be a chance of a chain-aggro event which pulls a load of mobs
through the walls.

I've not tested this or studied the YellForHelp code, but it is just a thought I had while wondering why
things are coded the way they are.
Reply With Quote
  #9  
Old 06-12-2008, 05:09 PM
greggg230
Fire Beetle
 
Join Date: Jun 2008
Location: Vegas
Posts: 17
Default

Quote:
Originally Posted by Derision View Post
In testing this I would concentrate in dungeons, if you haven't already done this, bearing in mind there
is no pathing for aggroed mobs.

E.g. If I pull a mob and there is a mob around the corner that can't see me, but is within assist range
of the mob I am pulling, with this change, the unseen mob will run straight at me through the walls.

Should this second mob itself yell for help while it is 'running through the walls', possibly through
another room filled with mobs, there may be a chance of a chain-aggro event which pulls a load of mobs
through the walls.

I've not tested this or studied the YellForHelp code, but it is just a thought I had while wondering why
things are coded the way they are.
That most likely would happen, but the aggroed mob would have to run through the wall and go into line of sight with a mob in another room or something, which seems like it would be pretty rare and pullers could adapt to it in those situations in which it does apply. Obviously, it'd be best to have pathing for aggroed MOBs and proper aggro code, but I think one out of two ain't bad right now. hehe
Reply With Quote
  #10  
Old 06-12-2008, 05:33 PM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

Quote:
Originally Posted by greggg230 View Post
That most likely would happen, but the aggroed mob would have to run through the wall and go into line of sight with a mob in another room or something, which seems like it would be pretty rare and pullers could adapt to it in those situations in which it does apply. Obviously, it'd be best to have pathing for aggroed MOBs and proper aggro code, but I think one out of two ain't bad right now. hehe
Since reading your initial post I was pondering the possibility of another way of doing things:

If the mob has LOS to the 'sender' but not the player, it runs to the current location of the 'sender'. At that point, it checks for LOS to the player. If it has it, it runs straight at him, if not, it checks for LOS to the 'sender' again and runs to that point. Rinse and repeat until it has no LOS to either, in which case it wipes it's hate list and goes back to where it was.

Not 'Live Like', but maybe a sort of middle-ground.
Reply With Quote
  #11  
Old 06-12-2008, 06:34 PM
ChaosSlayer
Demi-God
 
Join Date: May 2007
Posts: 1,032
Default

as far as i can say up untill today the AGRO and Assist worked 100% as on live - you pull 1 mob - his friend around the conner will agro, as well as agro any other friends in range.

the only problem was with mobs running through wall which cuased them to potentialy pass additional areas with other mobs who never would have been agroed on live.
in other words there is no problem with assist - only with mobs ability to ignore walls.
Reply With Quote
  #12  
Old 06-19-2008, 09:19 PM
greggg230
Fire Beetle
 
Join Date: Jun 2008
Location: Vegas
Posts: 17
Default

Has anyone tried this out? If so, how's it working? I've been busy with work the past few days so haven't had a lot of time for EQEmu.
Reply With Quote
  #13  
Old 06-23-2008, 04:36 PM
cavedude's Avatar
cavedude
The PEQ Dude
 
Join Date: Apr 2003
Location: -
Posts: 1,988
Default

This one is up on PEQ with this reboot. I'll post the reaction (if any)
Reply With Quote
  #14  
Old 06-25-2008, 07:45 PM
cavedude's Avatar
cavedude
The PEQ Dude
 
Join Date: Apr 2003
Location: -
Posts: 1,988
Default

This looks to be a good fix, and makes things more Live Like. It does make some encounters more difficult due to other broken systems, but that is no fault of this code. Moving to submissions.
Reply With Quote
  #15  
Old 06-26-2008, 05:44 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

I added in this code as well. It seems to work great. I had to reduce the agro range of NPCs in some zones to keep some overwhelming pulls from happening now that the LoS bug to pull by hiding around a corner doesn't work. That isn't an issue with this code though, just some adjustments that people might want to consider after adding this in.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 12:04 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3