HaywireInteractive / OnAllFronts-Public

UE5 MilSim FPS / RTS Game (formerly ProjectM)
MIT License
126 stars 24 forks source link

Consider "Dynamic Modifiers only" NavMesh for avoidance during navigation #919

Open Leroy231 opened 7 months ago

Leroy231 commented 7 months ago

Current avoidance can lead to stuck entities since if an entity is blocking a path it won't reroute navigation to a different path far away. See https://github.com/HaywireInteractive/OnAllFronts-Public/issues/1017 or screenshot below for more. Instead we could update NavMesh dynamically with all entities: https://dev.epicgames.com/documentation/en-us/unreal-engine/modifying-the-navigation-mesh-in-unreal-engine?application_version=5.3

Image

Leroy231 commented 20 hours ago

@Kizurou one other thing we should verify here: On L_Template_CitySample_Small ensure that this change doesn't tank the frame rate when you have lots of soldiers moving around. Also FMassTargetGridCellLocationFragment.bDidEntityMoveThisFrame will tell you if entity moved this frame in the new processor, just make sure it's configured to run after UMassTargetGridProcessor (which sets bDidEntityMoveThisFrame).

Leroy231 commented 20 hours ago

@Kizurou I also added one more subtask to the description: Verify if this change fixes BP_FunctionalTest_SimpleAvoidanceWithObstacles so that the moving soldiers will go around wall like expected path in screenshot below.