Improve pathfinding AI
According to testers the OpenMW pathfinding AI is even worse than in the original game.
The main reasons for this seem to be:
1. A mechanism called "shortcutting" that ignores the pathgrid if a LOS-check to the destination succeeds. This does not work well and just ignores many types of obstacles. Perhaps this could be improved by casting the ray from the feet instead of head. Or get rid of it completely. Not sure if original MW is doing such a thing.
2. The handling for NPCs getting stuck is basically nonexistent. Getting stuck is not preventable with the limited path grid information available in the game files, so it needs to be handled gracefully. Possible improvements: run into a random direction (according to Hrnchamd that's what the original game does), or attempt to return to a pathgrid point.
3. It likes to run in circles occasionally.
#5 Updated by scrawl . over 3 years ago
The running in circles problem seems to happen whenever the path is recalculated. This is easy to see, set an NPC to aifollow on the player, then run back and forth while the following NPC is at a moderate distance, they will keep running in circles indefinitely.
#9 Updated by Cory Cohen over 2 years ago
As I'm about to mention in a forum post, I was unable to upload the save game to the forum so I instead uploaded it here. This save (for me at least) has Huleeya turning in circles fairly continuously, which I thought might be useful for debugging this problem.
#10 Updated by David Teviotdale over 2 years ago
- File itermerel4.zip added
I am told that Itermerel in the "Escort Itermerel" quest http://www.uesp.net/wiki/Morrowind:Escort_Itermerel tends to run in circles while following the player.
For testing, I've attached a save game where this quest has started.
At the save point, Itermerel is at the Temple in Balmora. He will run towards the player from this location, and then continue to follow the player.
#11 Updated by Marc Ernoult over 2 years ago
I tested the save. I am unable to create running in circle.
But if Itermerel is exactly on the other side of an obstacle (a rock, a rope between 2 stakes), he keep running in front of him and stay blocked and does no attempt to go around the obstacle (at least during like 30s)
#13 Updated by Marc Ernoult over 2 years ago
the lastests commits decrease the frequency of the stuck following NPC, but it still happends if all the following conditions are true :
- the following NPC can see the PC (in the sense that in 1st person view you can see his head)
- the suface of the object that NPC is blocked on is wide (at least 3 times the width of a NPC) and close to orthogonal to the line between NPC and PC
- the distance between NPC and PC is small
#15 Updated by Tonya Marshall over 1 year ago
Bug # 3524. Last night going out one of the exits of Suran I was met with a frost atronach, fought him, then found a corpse of a hlaalu guard inside the wall.
This morning a hlaalu guard, again tried to battle a cliff racer through the wall, my initial bug report.
#24 Updated by Nelsson Huotari about 1 month ago
Bad pathfinding, precisely the problem with AI running towards an obstacle, can be easily reproduced and investigated:
Write in console:
player->coe 2,-7 (Teleport to Dren Plantation)
player->togglepathgrid (See movement nodes)
Hit npc "Frinnius Posuceius". Run behind an obstacle where there are no path nodes, e.g. rocks next to hut. NPC's will try to run through the rocks. You can also reproduce running-in-circles -behavior by keeping enough distance with Frinnius Posuceius and letting him and his friend try to shortcut-chase you through one campfire next to a hut.