I have recently started exploring the capabilities of what is exposed in UE4’s navigation system interface and Recast. One my goals is to discern whether the capability to modify the area cost and entry cost of NavMesh Polygons during run-time exists.
For example, let’s say a character has a flashlight and, when this flashlight is turned on, certain AI characters should either benefit or be hindered by updated properties of nav mesh polygons (similar to how a NavModifier Volume and NavAreas changed the properties when the nav mesh is generated). The light would be encapulated by either a cone or a combination of simple collision volumes. Ideally, these collision volumes could be projected onto the nav mesh to modify the area properties. I realize this might be quite performance intensive. Ideally, this operation could be done periodically (amortize the pain) or even asynchronously.
From preliminary investigations, I haven’t been able to identify any exposed functionality that would accomplish this. It appears that NavModifier Volumes only update NavMesh when it is generated in the editor. This is also true for the NavModifierComponent.
I thought about using NavQueryFilters that could change during runtime but that is only sufficient with lights whose location would never change during the course of a game session.
I’ve read through the solutions presented here Modify pathfinding cost - DetourNavMeshQuery subclass - World Creation - Unreal Engine Forums . Solution three looks like it presents the most potential. However, I don’t really want to change how the pathfinding cost is determined. What I really want to do is modify the properties of the nav mesh areas/polygons while still using the existing pathfinding cost algorithm.
Is there any kind of dynamic run-time modifier to the nav mesh available at this time? If not, where might be the best place to start for extending existing functionality to create one.