@ForgingStation
  @ForgingStation
Forging Station | Dynamic Collision Avoidance System with Spatial Partitioning - Unity ECS/DOTS @ForgingStation | Uploaded October 2020 | Updated October 2024, 8 hours ago.
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 -

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.
en.wikipedia.org/wiki/Space_partitioning

Quadrant System in Unity ECS -
youtube.com/watch?v=hP4Vu6JbzSo

Quad Tree -
youtube.com/watch?v=OJxEcs0w_kE

*** Music - Please - Wayne Jones***
Dynamic 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

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

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER