Guards can initiate dialogue even though you are far above them
1. Tcl, setflying 1, or levitate. Setspeed 1000
2. Hit someone(commit a minor crime), make the guards pursue you
3. Fly up above them, and stop, let the guards try to find the exact position below you
4. Guard open dialogue with you
See picture to understand
#2 Updated by rexelion . 6 months ago
Seems like the cause is in PathFinder::checkPathCompleted(). It doesn't take into account the z-component of the displacement from the target. Taking the vertical distance into consideration should fix this issue, but it may break something else, so maybe we can check it in AiPursue?
#3 Updated by Miloslav Číž 6 months ago
This is weird, MWMechanics::AiPackage::pathTo(...) takes 3D point as the path destination but then only checks if the path is completed with checkPathCompleted that only uses XY. What if you tell an NPC to walk up a spiral stairs for example? I think it'll bug, but will have to try this.
#4 Updated by rexelion . 6 months ago
I've just tested it on a spiral staircase in Wolverine Hall, guards were able to find me several flights up. I think it works because the path created by the pathfinder in this case is not empty as there are points on the pathgrid that are closer to the player than the one the guard is currently standing on, even if he is directly below/above me, but when the player is levitating, the closest point (and final in the path) is the one directly below. The PathFinder::mPath is empty, horizontal distance is close to 0, PathFinder::checkPathCompleted returns true, and so does AiPackage::pathTo.
#5 Updated by Miloslav Číž 6 months ago
Thanks for testing, I'm trying it too. For anyone else, you can make an NPC travel to your position with "aitravel player->getpos x, player->getpos y, player->getpos z" in the console. You can also use this to reproduce the issue without attacking the guards, just invoke the command while flying high above ground.