Using Can Affect Navigation Generation

When I add the check boxes on my characters for Can Affect Navigation Generation and can even affect navigation (on the capsule component) My AI cuts holes in the recast navmesh. This is expected. But, what is not expected is that when the AI is crossing a tile, it sometimes gets stuck or turns around. The goal is to have AI cut small holes in the navigation so pathfinding calls with the EQS system will choose targets that are not obstructed by other actors

In this video the actors are using the move to command to run a patrol. When crossing over tiles they sometimes get stuck. and runs back and forth along the edge before moving forward. Any idea what might be causing this?

Making characters cut holes in the navmesh while moving is a conceptual hack. We do support doing that but I don’t encourage it. And you’re experiencing the reasons - when AI cuts holes in the navmesh and then tries to find a path the start of the path will be different then AI’s location, which will be visible in situations like yours.

If we really wanted to fix it we’d need to give users a way to indicate navigation area type used for cutting holes in navmesh by characters. This might be useful so I’ll add it to our backlog.

However, you shouldn’t need to do that. The recommended way to solve what I think you’re trying to solve here is to use avoidance, either our RVO or Detour Crowds. On the other hand you may run into other issues as well, so just give it a try and let me know what you run into.

Cheers,

–mieszko

1 Like

Yea I have tried using the Detour and RVO avoidance. RVO pushes objects off the navmesh still so it’s out of the question but with detour they still run into eachother. Simply adding the custom implementation in C++ does not seem to allow the detour actors to go around each other too effectively.

I’ve been looking into the detour code a bit and I can’t tell for sure but it looks like it might have to have avoidance groups set up as well. Is that correct? Also, having detour doesn’t seem to affect the pathfinding in EQS. This results in Meele units choosing inappropriate targets that other actors are blocking the path to.

Maybe having the Can Affect Navigation Generation change the weight on the navmesh rather than cut through it would help with this. I don’t know enough about the navigation system to say for sure.

If you want to have EQS generate AI-free spots then having characters apply navigation areas rather then cutting holes on the navmesh would be one of the ways to do it.

Alternatively you can have an EQS test that would check if given location is occupied, but currently there’s no fast way to get pawns in a radius around a specified location (it’s in the backlog though).