Understanding what DOTS is
The Unity Data-Oriented Technology Stack (DOTS) is a set of Unity packages that allows us to write data-oriented code easily. While there are plenty of packages in the DOTS stack, let’s focus on the three key ones that serve as pillars for the rest:
- Entities: Unity takes on the ECS pattern. It replaces GameObjects and MonoBehaviours with Entities, Components, and Systems (ECS, a paradigm in Unity that separates data (components) from logic (systems), enhancing performance and scalability), a cache-friendly way to store and update our scene objects. It provides considerable performance boosts, especially in games with lots of objects.
- Jobs: The Unity way to create multi-threaded code. It groups data and code that processes jobs. They are executed in parallel thanks to the job scheduler, which guarantees that explicit dependencies between jobs are respected. This avoids classic multi-threading issues like deadlocks and race conditions...