DOTS Pathfinding with NavMeshQuery - Implementation - Unity ECS
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 - https://youtu.be/1YtkeGDWuC8
We will be building upon the already existing entity spawner system - https://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 - https://github.com/ForgingStation/NavMeshQuery-Implementation
Path Utils class - https://github.com/Unity-Technologies/UniteAustinTechnicalPresentation/blob/master/StressTesting/Assets/Scripts/Utils/PathUtils.cs
Geometry Utils class - https://github.com/Unity-Technologies/UniteAustinTechnicalPresentation/blob/master/StressTesting/Assets/Scripts/Utils/GeometryUtils.cs
******************
Again, Do not forget to have a look at this - https://github.com/zulfajuniadi/unity-ecs-navmesh
which helped me a lot in understanding how NavMeshQuery needs to be used!!!
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «DOTS Pathfinding with NavMeshQuery - Implementation - Unity ECS», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.