Project Description
Implements a boids simulation in Unity using the Entity Component System (ECS).
I implemented the system in both Object-Oriented (OOP) and ECS styles to compare their performance and efficiency.
My Tasks
ECS Implementation
- Architecture: Pure DOTS using Entities 1.0, Burst Compiler, and the Job System.
- Flocking Logic: Currently uses a naive O(N^2) approach (brute-force neighbor check) inside a parallel IJobEntity.
- Movement: 2D logic on the X/Z plane with Y-axis rotation
- Obstacle Avoidance: Uses Unity Physics with a "Whisker" raycast system to scan angles and steer around static geometry
Object Oriented Design Implementation
- Architecture: Standard MonoBehaviour scripts attached to GameObjects.
- Logic: Single-threaded Update() loops.
- Movement: 2D logic on the X/Z plane with Y-axis rotation
- Purpose: Serves as a performance baseline to demonstrate the limitations of traditional Unity architecture when handling hundreds of autonomous agents.
Analyse
I'm satisfied with my implementation. I managed to accomplish what I set out to do within the time I had allotted myself. If I were to revisit the project, I would rework the algorithm implementation to use a spatial grid.
Project Context
This project implements a boids simulation in Unity using the Entity Component System (ECS).
Its goal is to explore high-performance by applying Data-Oriented Design (DOD) principles.