GridVids
Sign in with YouTube

Dynamic Collision Avoidance System with Spatial Partitioning - Unity ECS/DOTS

Forging Station Oct 10, 2020 12:22
Create an account to hide videos, mark them watched, or save them to Don't Miss.
Don't Miss
Create an account to hide videos, mark them watched, or save them to Don't Miss.
Mark watched
Create an account to hide videos, mark them watched, or save them to Don't Miss.
Hide
Open in popup Open on YouTube
Share video

Share video

Copy the GridVids link or iframe code.

Video link
Iframe code
Iframe content

In this video two of the most commonly used collision avoidance methods - placing an agent at an average location to avoid collision Vs avoiding the nearest agent - are compared. Simple yet optimized spatial partitioning methods can be used to achieve highly parallel collision avoidance behaviour for a large number of agents. I tried and failed while using unrestricted Ray Casting to find nearby agents though - as usually Ray Casting much be hidden behind a condition. Source Code - https://github.com/ForgingStation/Unity-DOTS_Collision_Avoidance_System UnitV2_Component - The componentData struct which holds the necessary data for every unit. Unit_Spawner_Base - A Monobehaviour class spawning entity with necessary components. Any code block with a comment - Debug - can be commented to increase performance. Unit_Movement_System - A system base operating on UnitV2_Component, responsible for movement and collision avoidance. Two methods demonstrated in this video exist as separate foreach loops on entities. Unit_Buffer - A dynamic buffer holding two locations between which units traverse. This system ac be clubbed with DOTS- NavMesh Query system to achieve collision avoidance while navigating. Bullet Points used while recording - Cloning the DOTS Navmesh Query Code - verify there is no difference in behaviour. RayCast problem HashKey calculation Spatial separation Hash bucket visualization with cell size 8 & 20 Persisting Map data throughout the frame and rebuilding the map - NativeMultiHashMap Collision Avoidance walkthrough, result & comparison Other papers on Collision Avoidance. Check out the following links to know more about spatial partitioning. https://en.wikipedia.org/wiki/Space_partitioning Quadrant System in Unity ECS - https://www.youtube.com/watch?v=hP4Vu6JbzSo Quad Tree - https://www.youtube.com/watch?v=OJxEcs0w_kE *** Music - Please - Wayne Jones***
Science & Technology
#DOTS Collision Avoidance System Using Spatial Partitioning - Unity #Unity ECS #Comparing Two Algorithms #spatial partitioning #Unity DOTS #Burst Compilation #Algorithms #Average VS Nearest Positioning #NavMeshQuery System