@ForgingStation
  @ForgingStation
Forging Station | DOTS Pathfinding with NavMeshQuery - Implementation - Unity ECS @ForgingStation | Uploaded August 2020 | Updated October 2024, 8 hours ago.
In this video, we will explore one of many ways to implement a multithreaded burst-compiled pathfinding solution using Unity's experimental but highly performant NavmeshQuery API.

DOTS based pathfinding using NavmeshQuery is highly performant. There is an in-detail comparison of classic and DOTS based navigation here - youtu.be/1YtkeGDWuC8

We will be building upon the already existing entity spawner system - youtu.be/2IYa1jDGTFs

There is plenty of room for optimization especially if you cannot reuse cached path as frequently as this / if you want to squeeze out as much performance as you can.

To highlight these areas, I would alter unit system class to use entity-command buffer instead of entity manager so caching and retrieving can happen in a parallel job. You might have to reconsider while using the Unit buffer, more so if you are ever going to implement DOTS navigation on handheld devices as you need to keep a lower memory footprint.

Here the same path is copied over to multiple entities which is a huge red flag on devices with low memory. We can retrieve the path from our dictionary and iterate over waypoints for many entities. This might require NativeHashMap as we are moving entities in a parallel job.

Another aspect that is missing here is exceptional handling, which has to be implemented so we can know if a path calculation failed and for what reason, so we can retry pathfinding.

Last but not least - NavmeshQuery is still experimental. API calls / the API itself might change in the future. I will try and update it when it happens.

******************
Source Code - github.com/ForgingStation/NavMeshQuery-Implementation

Path Utils class - github.com/Unity-Technologies/UniteAustinTechnicalPresentation/blob/master/StressTesting/Assets/Scripts/Utils/PathUtils.cs

Geometry Utils class - github.com/Unity-Technologies/UniteAustinTechnicalPresentation/blob/master/StressTesting/Assets/Scripts/Utils/GeometryUtils.cs
******************

Again, Do not forget to have a look at this - github.com/zulfajuniadi/unity-ecs-navmesh
which helped me a lot in understanding how NavMeshQuery needs to be used!!!
DOTS Pathfinding with NavMeshQuery - Implementation - Unity ECSCan a car carry water?!! Playing with - nvidia - Flex - Fluid Simulation - UnityDynamic Collision Avoidance System with Spatial Partitioning  - Unity ECS/DOTSUnity DOTS Navigation - Click To Move - New Input SystemAI Car - Unity Hybrid ECS/DOTSCrowd Simulation Part - 1. Closest Approach CalculationBasic Flocking Optimization - Android Build - 20000 Boids - Unity ECS/DOTSCollision Avoidance using Boids behaviourCOMPLETLY failed - Nothing went as planned with crowd simulation!My RayTraced Computer Room. Not what I expected!Shader Graph & Unity DOTS - Flocking SimulationNew Input System With Unity DOTS-ECS

DOTS Pathfinding with NavMeshQuery - Implementation - Unity ECS @ForgingStation

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER