Can I invalidate parts of the navmesh per agent?

I’ve been trying to think of a workable solution to my problem - a solution that won’t be incredibly expensive.

basically I need to work out if one of many many locations (cover positions) will involve the AI moving past the player, and invalidate them if that’s the case. A simple line check is not good enough - there are many edge cases that won’t work.

Next I thought I could calculate a search to each point and loop through every point on every search path. If any of them go past the player (line check) then that cover is invalid. This works, but it’s too expensive.

So next I thought of the navmesh. Really what I want to do is before the search starts - I invalidate the navmesh behind the player (from the point of view of that agent) This means that any positions behind the player and any that would involve moving through this are invalidated. This seems like a nice solution.

So a few questions -

1, is this possible?

2 - will it be too inefficient to work?

3 - if the answer to 2 is yes, does anyone have any ideas for solutions to this problem? it’s a tricky one.

I actually found doing the very expensive version did work, but it’s horrendously inefficient. good enough for now.

A practically acceptable solution here (from efficiency point of view) would be to query navmesh for polygons you want to “invalidate” and disable them on the detour level. This would boil down to either zeroing out ‘dtPoly::flags’ or changing 'dtPoly::areaAndtype(viadtPoly::setArea` call).

Having said that we don’t give out too many tools that will allow you to do that so you’ll need to implement missing functions yourself. We are going to implement a proper solution for it at some point, but it’s not high on our priority list.

Cheers,

–mieszko