Project

General

Profile

Feature #2229

Improve pathfinding AI

Added by scrawl . almost 3 years ago. Updated about 4 hours ago.

Status:
New
Priority:
High
Assignee:
-
Category:
AI
Target version:
Start date:
12/25/2014
% Done:

0%

Severity:
Normal

Description

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.

itermerel4.zip (205 KB) David Teviotdale, 09/10/2015 12:03 PM

screenshot092.jpg View (95.7 KB) Who Knows, 09/11/2015 01:51 PM


Related issues

Related to OpenMW - Bug #1997: AI can mindlessly walk off a cliff Confirmed 10/09/2014
Related to OpenMW - Bug #2305: [Tribunal] Urvel Dulni gets stuck and never reaches the shrine Rejected 01/25/2015
Related to OpenMW - Bug #2556: Bloodmoon quest "To Catch a Thief" unbeatable with pathfinding bug Closed 05/16/2015
Related to OpenMW - Bug #3524: Hlaalu guard stuck running against wall in south Suran New 09/03/2016
Related to OpenMW - Bug #2812: AI pathfinding algorithm sometimes leads to traffic jams Closed 08/01/2015
Duplicated by OpenMW - Bug #3936: Pack rat pathfinding Rejected 06/27/2017

History

#1 Updated by scrawl . almost 3 years ago

  • Category set to AI
  • Priority changed from Normal to High
  • Target version changed from openmw-future to openmw-0.41

#2 Updated by Oleje Cheko over 2 years ago

  • Assignee set to Oleje Cheko

#3 Updated by scrawl . over 2 years ago

  • Related to Bug #2239: Cliff racers stand in line to fight my summons but don't try to attack me added

#4 Updated by scrawl . over 2 years ago

  • Related to Bug #1997: AI can mindlessly walk off a cliff added

#5 Updated by scrawl . over 2 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.

#6 Updated by scrawl . over 2 years ago

  • Related to Bug #2305: [Tribunal] Urvel Dulni gets stuck and never reaches the shrine added

#7 Updated by scrawl . over 2 years ago

  • Related to Bug #2556: Bloodmoon quest "To Catch a Thief" unbeatable with pathfinding bug added

#8 Updated by David Teviotdale over 2 years ago

See https://forum.openmw.org/viewtopic.php?f=6&t=2916 for notes on the "running in circles" issue.

#9 Updated by Cory Cohen about 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 about 2 years ago

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 about 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)

#12 Updated by Who Knows about 2 years ago

I can confirm what's reported in comment 11.
Except that he's still stuck after waiting for 10 minutes. The attached screenshot shows where that happens (next to the pawnbroker in Balmora).

#13 Updated by Marc Ernoult about 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

#14 Updated by Miroslav Remák about 1 year ago

  • Related to Bug #3524: Hlaalu guard stuck running against wall in south Suran added

#15 Updated by Tonya Marshall about 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.

#16 Updated by Marc Zinnschlag 10 months ago

  • Target version changed from openmw-0.41 to openmw-0.42

#17 Updated by Alexei Dobrohotov 7 months ago

  • Related to Bug #2812: AI pathfinding algorithm sometimes leads to traffic jams added

#18 Updated by scrawl . 7 months ago

  • Target version changed from openmw-0.42 to openmw-future

#19 Updated by scrawl . 7 months ago

  • Target version changed from openmw-future to openmw-1.0

#20 Updated by scrawl . 7 months ago

  • Assignee deleted (Oleje Cheko)

#21 Updated by Andrei Kortunov about 2 months ago

  • Duplicated by Bug #3936: Pack rat pathfinding added

#22 Updated by Andrei Kortunov about 1 month ago

  • Related to deleted (Bug #2239: Cliff racers stand in line to fight my summons but don't try to attack me)

#23 Updated by openmw hardcore about 4 hours ago

Yes, pathfinding needs to be improved. I sometimes witness this, npc will find the shortest path to you, but they will keep mashing themselves against an obstacle, when there is a clear path beside them.

Also available in: Atom PDF