DOTS in UNITY
Data-Oriented Technology Stack
2 min readFeb 2, 2022
Objective: To educate the reader about what DOTS is, and where we will see it in Game Development. DOTS is the future of Unity. The architecture of Unity is moving to adopt DOTS across all aspects. This is happening slowly, but by learning about DOTS now, the transition will be easier as we roll out DOTS across Unity features.
What is DOTS?
- ECS (Entity Component System) — The way we code, instead of Object-Oriented (OOP) with MonoBehaviours.
- C# Job System — How we write multithreaded code to take advantage of the multiple cores in the modern CPUs
- Burst Compiler — No extra work for us, our code compilation is optimized for the platform we’re building to
Why should we use it?
- Performance — More efficient data accessing/processing multithreading, optimized compile code.
- More reusable code — Easier to reuse code as projects grow due to the separation of data and behaviour.
- Easier to Manage Codebase — Data is data, behaviour is behaviour. Keeps things simple.
Why should you Not use it?
- Relatively New — There isn’t full DOTS support for the entire engine yet so you will most likely need a mix of DOTS and MonoBehaviours. (Animation still needs to be written using MonoBehaviours)
- Not for Beginners — A bit more challenging than MonoBehaviours.
Breakdown of ECS (Entity Component System)
Entity
- “Things”
- A rough equivalent of GameObjects
- Doesn’t do anything on its own
Component
- “Data”
- Belongs to an entity as MonoBehaviours belong to a GameObject.
- No Logic/Behaviour
System
- “Behaviour”
- Are not attached to any entities
- Queries only the components (data) that are needed
If you want to know more about me, feel free to connect with me on LinkedIn.