DEV Community

Cover image for Introduction To DOTS!
Pratyush
Pratyush

Posted on

Introduction To DOTS!

DOTS

DOTS stands for Data Oriented Tech Stack.

This tech stack helps create games using a data-oriented architecture. By doing this, game projects can scale efficiently while remaining highly optimized.

DOTS consists of three components:

  • Entity Component System
  • Job System
  • Burst Compiler

Entity Component System (ECS)

The Entity Component System has three core parts:

  • Entity → This is an identifier
  • Component → This holds data of an entity
  • System → This performs logical operations on the entity's data

Fig 1.1 How ECS works

Example

There are four entities (Fig 1.1), each containing two components:

  • Transform rotation
  • Rotation angle

A system iterates through all entities and updates their Transform component with respect to their Rotation angle component.


Job System

The Job System makes writing multithreaded code easier by providing pre-implemented safety checks that detect race conditions during development. It also manages how jobs are distributed across CPU cores.

By default, Unity code runs on the Main Thread.

The Job System enables the use of multiple threads called Worker Threads.

Job System

Key Features

  • Jobs are assigned to worker threads
  • A worker thread can steal jobs from another thread if it finishes early and other jobs are waiting
  • Automatically handles synchronization between worker threads and the main thread

Burst Compiler

The Burst Compiler works with High-Performance C, which is a restricted subset of C# designed for optimization.

It uses LLVM to translate IL into highly optimized machine code tailored for the target CPU.

Top comments (0)