Go Back   EQEmulator Home > EQEmulator Forums > Support > Support::Linux Servers

Support::Linux Servers Support forum for Linux EQEMu users.

Reply
 
Thread Tools Display Modes
  #1  
Old 01-16-2014, 06:18 PM
jdoran
Hill Giant
 
Join Date: Jul 2012
Posts: 212
Default pathing messing up after the last node

I ran into another problem I'd like to share. I'm not 100% sure that the fix will work for all cases, but I think it is a good place to start.

At some point near the end of an NPC's path, the movement code will notice that there is LOS to the destination with no hazards. This is independent of the culling code. There are timers that periodically check for this situation, and abandon the calculated route when possible.

This works great. However I've seen cases where the pathing code will travel direct for a bit, and then calculate a new route to a nearby path node. The NPC wanders off, and then comes back to the destination. Sometimes this route recalculation has occurred more than once.

I'll advance the argument that once a safe direct path is found, that FindRoute should never be used again. Let the NPC head straight towards its destination.

When this direct path is selected, the Route list is cleared. Code later notices an empty route and tries to calculate a new one.

The following change has corrected this in my tests:

Code:
@@ -1059,6 +1059,13 @@ VERTEX Mob::UpdatePath(float ToX, float ToY, float ToZ, float S
                        return To;
                }
        }
+
+       // do not recalculate route once a direct path is selected
+       if ((Route.size() == 0) && (PathingTraversedNodes > 0) && (SameDestination))
+       {
+               return To;
+       }
+
        mlog(PATHING__DEBUG, "  Calculating new route to target.");

        Route = zone->pathing->FindRoute(From, To);
The check on Route.size will be true if a route has been cleared, or if
a route has never been calculated. The PathingTraversedNodes check
rules out the later case. The "return To" directs the NPC to head directly
to its destination.

Last edited by jdoran; 01-16-2014 at 07:23 PM.. Reason: see that I need SameDestination in some cases
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 02:10 AM.


 

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