Extent set for supported agents is ignored

Hi!

It seems like no matter what extent I enter in “supported agents”, there is no effect at all. I try to set the default extent to a large value since I don’t know the height of the navmesh, just the XY location. When I go through the code for the navmesh projection (ProjectPointToNavigation) it seems to always use the extent from the UNavMovementComponent and ignoring the config. When I use the debugger to modify the extent it works as expected.

So how can I project the location to the navmesh. Should the “supported agents” be associated with the UNavMovementComponent or pawn somehow? If I have many supported agents which extent will be used etc? The setup of “supported agents” seems kinda strange to me.

Hi ,

Try following the steps listed here:

https://drive.google.com/a/epicgames.com/file/d/0BxVvQib8bPZkZmhsbkpQMlJJUXc/view

After setting it up the way he does, do you still see these errors occurring?

Hi!

I don’t see how the video is related to the issue. The navmesh setup is working since as I said if I use the debugger it works properly.

My problem is that the default extent is ignored in ProjectPointToNavigation. Resulting in that my move requests fails even though there are navmesh over or under the point. I only know the position in the XY plane, therefore I would need to project that point to the navmesh.

I can raycast myself but thought ProjectPointToNavigation would just be able to do that for me. Therefore I assume it isn’t working properly when this fails.

Thanks!

Are you doing this in blueprints or c++? The reason I linked the video is because following the steps he provides allows the supported agents system to work, which would at least limit what may be causing the error you are seeing. What specific steps are you taking that cause this to occur on your end? Does this occur in a clean, blank project with no additional content or is it limited to one project?

I’m using c++ and the MoveTo method in the AIController. This issue seems to exist in all projects as long as the move location is further away from the navmesh than half the agent’s height. This have to do with the implementation of ProjectPointToNavigation and the extent parameter passed to it by MoveTo.

So basically if I e.g. request a move at (0,0,0) when the closest navmesh point is at (0,0,200) with an agent of height 100, and project to navmesh enabled. The move will fail since the point wasn’t possible to project to the navmesh. This happens no matter what default query extent I set for the navmesh (it’s ignored unless the agent’s extent in a zero vector).

In my case at least it would make most sense to return the closest position on the navmesh in the Z axis within the extent no matter of the agent’s height. The agent’s height doesn’t seem related to projecting a point to the navmesh in my opinion. Guess there must be some use case I don’t consider?

Hi ,

Can you send me a copy of the project you are experiencing this in with steps to reproduce in that project? I haven’t been able to reproduce this on my end.

I found a solution that works for me. Turned out that if I disable the bProjectGoalOnNavigation flag in FAIMoveRequest it seams to work as I wanted. Don’t understand the point of setting the flag project to navmesh any longer though.

Unfortunately I can’t share my project, but I assume you are testing the UNavigationSystem::SimpleMoveToLocation method since you got it to work? I tested and could get it to work with the UNavigationSystem::SimpleMoveToLocation too. I discovered by going through the source that the implementation is not the same as AAIController::MoveTo for some reason (which explains why only one had problems).

However if you want to investigate this more I believe that the main problem is that the agent’s height value is used instead of the configured default extent when projecting the location. I don’t know all use cases but I can’t see any relation to the agent’s size and the project to navmesh method’s ability to successfully project the location to the navmesh.

May be a fix could be to just pass a zero vector as extent to ProjectPointToNavigation in AAIController::MoveTo? Or adding the ability to override the extent yourself in the FAIMoveRequest. I don’t know =)

Thanks!

Hi ,

I’m happy to hear you found a solution that works for you. I’m going to mark this as answered for tracking purposes and pass on your suggestions to be assessed by the development staff.