x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

[Bug Report] AI pawn moving when not supposed to

Branch: Binary

Build Version: 4.7.6-2513093

Description:

The ai seems to move towards the edge of nav meshes when their destination is on another unconnected nav mesh. Also if the destination is not on any nav mesh then the ai won't move at all. This behavior seems inconsistent.

Repro Steps:

  • Create project new project "PatialPathTest" from the "Top Down" template with no starter content

  • In the level move the "NavigationMeshBoundsVolume" to y=2130

  • Create a new "Nav Mesh Bounds Volume" instance named "NavMeshBoundsVolume" and place it in (x,y,z)=(-490,-1590,220)

  • Create a new "Empty Actor" instance named "Target" and place it in (x,y,z)=(-490,-1590,120)

  • Create a new "TopDownCharacter" instance named "TopDownCharacter2" and place it in (x,y,z)=(-490,240,216)

  • Open "TopDownCharacter" blueprint to make following changes:

  • Create new variable "TargetActor" of type "Actor"

  • Make "TargetActor" variable "Editable" and "Expose on Spawn"

  • Close "TopDownCharacter" blueprint

  • On the level, set the "TargetActor" varible of the "TopDownCharacter2" instance to "Target"

  • Create new "TopDownAIController" blueprint that subclasses the "AIController" blueprint

  • Create graph in "TopDownAIController":

  • ![alt text][1]

  • Close "TopDownAIController" blueprint

  • On the level, set the "AI Controller Class" variable of the "TopDownCharacter2" instance to "TopDownAIController"

  • Play Game

  • Notice how "TopDownCharacter2" moves towards the left even though there is no possible path to get to "Target"

  • Stop Game

  • Move "Target" to (x,y,z)=(-180,-1590,120)

  • Play Game

  • Notice how "TopDownCharacter2" does not move because there is no possible path to get to "Target"

  • Stop Game

  • Move "Target" back to to (x,y,z)=(-490,-1590,120)

  • Scale Cube2 to XScale=100 to make a wall along the entire walkable floor

  • Play Game

  • Notice how "TopDownCharacter2" moves towards the left even though there is no possible path to get to "Target" and there is now an impassable wall

Notes:

  • I looked into the source and found in cause of this behavior in AIController

  • 683: FPathFindingResult PathResult = NavSys->FindPathSync(Query); 684: if (PathResult.Result != ENavigationQueryResult::Error) 685: { ... 696: RequestID = RequestMove(PathResult.Path, Goal, AcceptanceRadius, bStopOnOverlap, CustomData); 697: }

  • FindPathSync will find path with "DT_PARTIAL_RESULT" aka partial path and FindPathSync will return ENavigationQueryResult::Fail based on the code below. But request move will be made as long as PathResult is not Error, regardless of if it's Success or Fail. So "TopDownCharacter2" will move.

  • Conversion from Detour path status to ENavigationQueryResult:

    dtStatusSucceed(Status) ? (dtStatusDetail(Status, DT_PARTIAL_RESULT) ? ENavigationQueryResult::Fail : ENavigationQueryResult::Success) : (dtStatusDetail(Status, DT_INVALID_PARAM) ? ENavigationQueryResult::Error : ENavigationQueryResult::Fail); [1]: /storage/temp/42262-partialpathbug.png

Product Version: Not Selected
Tags:
partialpathbug.png (94.7 kB)
more ▼

asked May 11 '15 at 10:13 PM in Bug Reports

avatar image

Mastodon
88 7 10 14

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

UE4 4.8 will give you a way to configure movement requests so that partial paths are treated as pathfinding failure, so in both cases, where destination is unreachable, but on navmesh, and destination is not on navigation altogether, the move request will fail.

If you'd like an opposite approach, so that AI moves even if destination is not on navmesh, then I suggest first projecting the goal location to navmesh (possibly with big query extent) and then use the result as actual move goal.

Cheers,

--mieszko

more ▼

answered May 18 '15 at 01:50 PM

avatar image

MieszkoZ STAFF
7.3k 223 57 412

avatar image Mastodon May 20 '15 at 09:19 PM

That's awesome, I'm glad I will be able to deal with this issue in 4.8

Thanks Mieszko

avatar image Mastodon Jun 10 '15 at 11:40 PM

Version 4.8 came out today, so I went back to check if this was still an issue.

I'm happy to report that the solution provided works perfectly.

alt text

Thank you so much Mieszko!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question