liveBook · Manning

Chapter 12: Unity DOTS

What you will learn in chapter 12 of High Performance Unity Game Development

The chapter introduction connects the existing data-oriented design to DOTS and distinguishes how SIMD and parallel processing increase throughput.

After this chapter you will be able to

What it builds on

Section by section

Introduction

The chapter introduction connects the existing data-oriented design to DOTS and distinguishes how SIMD and parallel processing increase throughput.

Key terms: SIMD vectorization, parallel processing, CPU cores, data-oriented design, flat arrays, L1 cache, Unity DOTS, code complexity

12.1 Adding SIMD vectorization using the Burst compiler

Explains how SIMD processes multiple array values at once and why the book’s array-based DOD architecture makes Unity Burst useful despite its costs.

Key terms: SIMD, wide registers, floats, DOD architecture, arrays, Unity DOTS, Burst compiler, server-side validation

12.1.1 GameData

This subsection changes the GameData types needed to make the enemy-movement calculation compatible with Burst.

Key terms: Burst compiler, NativeArray<>, GameData, managed memory, Vector2, float2

12.1.2 Allocating data

This subsection shows how to allocate NativeArray gameplay data and why it must be disposed of manually.

Key terms: NativeArray<type>, garbage-collected, dispose

12.1.3 Moving enemies

This subsection adapts enemy movement to Burst-compatible native arrays, updates the related bounds check, and reports the resulting performance improvement.

Key terms: [BurstCompile], native arrays, in, ref, enemyPosition, moveEnemies(), float2, Vector2.sqrMagnitude, math.lengthsq(), checkEnemyOutOfBounds()

12.2 Parallelizing work with Jobs

This section shows how Unity Jobs parallelizes array-based enemy movement, how the job handles reads and writes, and when scheduling overhead affects performance.

Key terms: Jobs, MonoBehaviours, main thread, worker threads, arrays, [ReadOnly], [NativeDisableParallelForRestriction], AliveEnemyIndices, EnemyType, EnemyVelocity

12.3 ECS and code complexity

This section explains how ECS maps to the book’s DOD architecture, why this project does not need a full ECS conversion, and how Unity systems can still work with GameData as the source of truth.

Key terms: Entity Component System, ECS, Entity, Component, System, EnemyPosition, GameData, Logic, Components, Systems

12.4 Parallelizing GameObject transform access with TransformAccessArray

This section adapts a pooled-enemy Board to update GameObject transforms in parallel with TransformAccessArray, while managing pool mappings and their lifecycle.

Key terms: TransformAccessArray, AliveEnemyIndices, m_enemyToPoolIndex, m_poolToEnemyIndex, SpriteParent, Show(), pool objects, Hide(), m_enemyTransforms, OnDestroy()

12.5 Conclusion

The chapter conclusion weighs the performance benefits of Unity DOTS against its code complexity and argues for adding tools selectively to a data-oriented design.

Key terms: Burst, SIMD instructions, Jobs, parallel processing, ECS, Entity, Component, System, data-oriented design, TransformAccessArray

12.6 Summary

This section summarizes how Burst, Jobs, ECS, and TransformAccessArray affect performance and complexity in Unity DOTS.

Concepts explained in this chapter

← Chapter 11: Branching, performance, and extendibility

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.