I'm having some pathing issues with a new NPC, and am puzzled by what I am seeing. I sure hope someone familiar with pathing can set me straight.
PathManager::FindRoute(Vertex,Vertex) checks for LOS to the starting path node. OK, this succeeds and makes sense.
But then it checks for LOS on the end path node, and fails.
Code:
if(ClosestPathNodeToEnd < 0) {
_log(PATHING__DEBUG, "No LOS to any end Path Node within range.");
return noderoute;
}
At this point, noderoute is an empty list.
I was kind of hoping that pathfinding would allow me to find a route to a distant node out of sight. I could have swore that it did so. Am I
misunderstanding this?
The particular case in question is a large outdoor zone (moors) with the NPC starting in a low area. The target vertex is out of LOS. Most of the zone
is LOS.
The reason I am looking into this particular code is that my NPC is moving
forward and then warping back to its original position. I believe that the
server is sending it underground, and the client moves it back. In any
event CalculateNewPosition2 is called with the destination vertex
rather than a path node. (Since no route was found, since the destination
is not in LOS).
If I had LOS and there were no hazards, I would not need pathfinding.