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

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 08-03-2008, 06:39 AM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default BestZ Calculation for aggroed mobs, pet follow and mobs pathing back to spawn point

At the moment, when CalculateNewPosition2 is called for:

Pet's following their master
Aggroed mobs pursuing a player
Mobs pathing back to their spawn point (because player is FD/Dead/Zoned)

it is called with the checkZ parameter omitted. This defaults to false, and therefore mobs/pets can 'bounce' or disappear under the world in these situations, particularly over uneven ground
(I performed my tests in nektulos, eastkarana, and commons).

In mob.h, around line 736 or so, find:
Code:
bool CalculateNewPosition2(float x, float y, float z, float speed, bool checkZ = false);
and change it to:
Code:
bool CalculateNewPosition2(float x, float y, float z, float speed, bool checkZ = true);
Note that there is both a CalculateNewPosition and CalculateNewPosition2 function. You can ignore the first one as it is no longer used.

In my testing this morning, this seems to work well in the scenarios I listed above. (It won't stop all occurrences of mobs disappearing under the world, as there are other reasons that happens).

Of course, the extra Z checks will add some extra CPU overhead, so anyone running a populated server should keep an eye on that if they make this change.
Reply With Quote
 


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 07:12 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 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3