Learn Unity's Entity Component System to Optimise Your Games
4.7 (226 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
2,247 students enrolled

Learn Unity's Entity Component System to Optimise Your Games

Update your Unity programming skills to take advantage of the new Data Orientated Technology Stack and Burst Compiler
4.7 (226 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
2,245 students enrolled
Created by Penny de Byl
Last updated 4/2020
English
English [Auto]
Current price: $20.99 Original price: $29.99 Discount: 30% off
5 hours left at this price!
30-Day Money-Back Guarantee
This course includes
  • 13 hours on-demand video
  • 4 articles
  • 75 downloadable resources
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
Training 5 or more people?

Get your team access to 4,000+ top Udemy courses anytime, anywhere.

Try Udemy for Business
What you'll learn
  • Take existing Unity projects created without the use of DOTs and convert them to employ parallel processing and the entity component system.
  • The advantages and disadvantages of using DOTs.
Course content
Expand all 75 lectures 13:10:01
+ Introduction
6 lectures 12:33

In this lecture Penny welcomes you to the course and gives an overview and the aims of the learning content.

Preview 03:08

In this lecture you will learn about the importance of following this course using the same version of Unity and packages.

What Version of Unity Should I Use?
07:09

This article provides more information for getting the correct version of Unity to use for this course.

What Version of Unity Should I Use 2.0.
00:13
Information Relevant to this Course
00:16

H3D has a bustling online student community.  Here's how to get involved.

Preview 01:15

Here's how to get the best experience from studying this course and answers to some popular student questions.

FAQs
00:31
+ DOTS in a Nutshell
9 lectures 01:38:34

In this lecture we will take an overview look at the data-oriented technology stack, discuss what it is and how it optimises the use of computer memory to enhance the processing capacity of your game projects.

Preview 10:13

In this lecture we will examine the classic way of spawning a lot of game objects and take a look at the performance.

Comparing the Old & the New Part 1
17:26

In this lecture we will prepare the codebase for conversion into parallel processing code by removing the move code on each game object and performing the same action inside a single script.

Comparing the Old & the New Part 2
10:56

In this lecture we will modify the code again to remove the movement script out of the Update loop and create a parallel processing job to do the work for us and increase the optimisation and frame rate.

Comparing the Old & the New Part 3
13:13

In this lecture we will start building the sheep scenario using the DOTS architecture and you will learn how to spawn entities from a game object prefab.

Comparing the Old & the New Part 4
13:38

In this lecture we will complete the DOTS version of the sheep moving simulation by adding a System script.

Comparing the Old & the New Part 5
11:04

In this lecture you will be challenged to make small changes to the code to modify how the sheep are moving in the scene.

Your First ECS Challenge
05:23

This lecture provides an overview of parallel processing to help you understand the types of tasks that benefit from synchronise execution as well as providing details of when you can and can't process in parallel.

Parallel Computing
08:40

In this lecture we will examine the special datatypes that come into play when working with the managed and unmanaged code contained in DOTS projects.

Structures, Classes and Blittable Types
08:01
+ Working with Entities
8 lectures 01:39:16

In this lecture we will go back to basics and convert a game object to an entity with Unity's built in conversion process and take a look at how to find an entities data for debugging after it is removed from the Inspector.

Creating and Debugging Entities
13:17

In this lecture you will learn how to create entities of different types and isolate them according to their data components.

Preview 11:58

In this lecture you will be challenged to work with the iComponentData to complete a project exercise.

Preview 03:25

In this lecture you will learn how to find entities the are in the world by using entity queries run from a Monobehaviour.

Performing Entity Queries
16:10

In this challenge you will hook up the entity queries to UI elements to display counts of entities as part of the user interface.

Entity Query Interface Challenge
10:02

In this lecture we are going to look at adding entities to a system at runtime.

Adding an Entity from Monobehaviour at Runtime
12:55

In this lecture we will cover how to create an entity from scratch with only code.

Constructing an Entity from Scratch
17:30

In this lecture we will begin by creating entities from the sheep mesh and hen examine the setting of LocalToWorld and NonUniformScale.

Constructing Sheep Entities from a Mesh Challenge
13:59
+ Transformation Mathematics in DOTS
5 lectures 52:57

In this lecture we will examine translations and the nuances of moving in local and world space.

Performing Translations
13:24

In this lecture we will examine how to turn an entity to face in the direction of a target.

Performing Rotations
12:54

In this lecture we will cover the mathematics behind performing a slerp in an ECS job.

Performing a Slerp to Face a Target
04:34

In this lecture we will examine the mathematics to rotate a an entity around a pivot point.

Rotating Around a Pivot Point
11:40

In this lecture you will be challenged to make an orbiting asteroid field using the knowledge you have learnt so far in the course.

Pivoting Challenge
10:25
+ Working with Custom Components
4 lectures 40:48

In this lecture you will learn how to put a player controller onto a game object and let the entities in the scene know where it is.

Getting Player Transformations into Entities
08:09

In this lecture you will learn how to extend structs to carry values that are specific to an entity and use them in a job.

Adding and Setting Data Values in a Custom Components
09:10

In this lecture you will discover how to modify the value inside component data while a job is running and use Native Arrays to store waypoint values.

Updating Custom Component Values
14:40

In this lecture you will be challenged to convert the waypoint system in the previous lecture into one where the entities move between waypoints that aren't on the same plane.

Waypoint Follow Challenge
08:49
+ Project: Space Wars Simulation
12 lectures 01:57:17

In this lecture we will calculate the closest planet (waypoint) to a ship and have it move to it and then orbit.

Finding Closest Planet
08:02

In this lecture we will work through the movement code to get the ships to approach and retreat from a planet based on their distance from it.

Attacking and Retreat Movement
08:23

In this lecture we will start putting together the code to get one entity to spawn another.

Spawning an Entity from an Entity Part 1
11:08

This lecture continues from the last working towards spawning bullet entities from the spaceships.

Spawning an Entity from an Entity Part 2
09:38

In this lecture we will define four locations that bullets can spawn from on the space ship and start working to add them into the code.

Spawning Entities from Another Location Part 1
09:35

In this lecture we will modify the code and add mathematics to position the spawn point of the bullets in line with gun positions.

Spawning Entities from Another Location Part 2
14:21

In this lecture we will create IComponentData and a System to monitor the lifetime of an entity and destroy it when it's life runs out.

Restricting the Lifetime of an Entity
16:40

Here's some new code to remove the depreciated IJobForEach from your destroy.

Restricting the Lifetime of an Entity Update
00:09

In this lecture we will add in code to prevent the ships attacking unless they are facing the planet and within a threshold distance.

Implementing Line of Sight in an Entity
07:56

In this lecture we will determine when a bullet bits the surface of a sphere and then set it up for removal.

Faking Collisions
09:34

In this lecture we will instantiate an explosion when the bullet collides with the planet.

Instantiating Explosions
13:31

In this lecture we will complete the space war simulation by making the particle explosions scale up after they've instantiated.

A System for Scaling Particles
08:20
+ Project: Infinite Cube World
6 lectures 01:14:40

In this lecture we will construct the basis of a landscape created with cubes where each of the cubes is an entity.

Creating a Landscape with Cubes
11:28

In this lecture you will learn how to use Perlin noise to modify the height of the cube landscape in realtime.

Using Perlin Noise for Height
13:53

In this lecture we will enhance the use of the Perlin Noise algorithm to create a more interesting landscape.

Enhanced Perlin Heights
11:36

In this lecture we will discuss how to change the material on one entity to another via the shared components.

Changing Materials on an Entity
14:59

In this lecture we will investigate the drop in frame rate experienced in the previous video and code in a fix.

Identifying Bottlenecks and Solutions to FPS Drop
10:29

In this lecture we will add a very simple player character and use it to build a landscape around as the player moves.  This will generate an endless environment.

Scrolling the Landscape with the Player
12:15
+ DOTS Physics
13 lectures 02:40:27

In this lecture you will put together your first ECS physics scene.

The Physics Components
07:29

In this lecture we will create a character controller for a physics enabled player character entity.

An ECS Physics-Based Character Controller
16:21

In this lecture you will be given the challenge of writing a duck spawner game object to inject 5000 ducks into the scene.

Spawning Multiple Physics Entities
05:48

In this lecture you will initially be challenge to have the player character spawn physics based bullets before the answer is revealed.

Shooting Physics Bullets Challenge
14:57

In this lecture we will work through the process of building a physics movement system for the bullets as well as adding a timed destroy to them.

Moving a Bullet with Physics
18:54

In this lecture we will update our physics project to version 0.2.5 of the Unity Physics package.

Upgrading a Package
19:49

In this lecture we will create a new system to monitor and detect physics collisions.

Detecting Collisions
16:37

In this lecture we will examine how to pass custom values from iComponentData items into a collision event job.

Using Custom Values in a Collision Event
10:18

In this lecture you will attempt to develop the code to destroy an entity when it is hit with a bullet.  The solution will to this challenge will be given at the end.

Destroying an Entity on Collision
09:26

In this lecture you will learn how to hook up a game object camera to follow an entity around by using an intermediate entity tracking object.

Entity Tracking with the Camera
10:53

In this lecture we will create a physics object that is a trigger and you will learn how to write a system to handle these events.

Detecting Physics Triggers
18:35

In this lecture you will learn how to convert your player character from a kinematic based physics system to a dynamic one.

Converting to a Dynamic Character
06:47

In this lecture you will be given a challenge to add a custom value to a trigger event that can be passed through from an iComponentData component.

Using Custom Values in a Trigger Event
04:33
+ Raycasting
10 lectures 01:59:48

In this lecture you will be given a challenge to create an initial tower defence scene with entity zombies moving between waypoints using coding concepts we've used before.

Starting with a Tower Defence Setup
19:56

In this lecture we will start working with the ECS Physics Raycasting system to create a Raycast Hit Job.

Performing a Raycast Hit Part 1
14:41

In this lecture we will use the raycast job to determine which entities have been hit by the ray and draw their hit points and surface normals.

Performing a Raycast Hit Part 2
16:55

In this lecture we will add the code to destroy any entities hit by the ray cast.

Destroying an Entity Hit by a Raycast
08:28

In this lecture we will start building a distance hit points job to find all physics entities within a specific radius of a game object.

Performing Raycast Distance Hits P1
12:32

In this lecture we will add in code to visualise how the distance hit job is working to find all physics objects close to a game object.

Performing Raycast Distance Hits P2
08:25

In this lecture we will search through all known physics entities in range of the towers and track the closest one.

Locating and Following The Closest Physics Entity
10:26

In this lecture we will add code to the simulation to destroy the closest tracked entity and look at a way to delay the destruction for extra effect.

Destroying Tracked Physics Entity
05:48

In this lecture you will be challenged to extend your project with sound effects and exploding zombies.

Destroying Zombie Challenge P1
10:41

In this lecture you will complete the destruction of a game element by adding in blood splatters made from more physics entities.

Destroying Zombie Challenge P2
11:56
+ Final Words
2 lectures 13:39

In this lecture Penny will provide some final words of advice or continuing to explore Unity's DOTS and ECS.

Some Final Words from Penny
02:23

Where you should take your game development learning journey next.

Where to now?
11:16
Requirements
  • Students should have a strong working understanding of the Unity game engine.
  • Students should be proficient in C#
Description

Unity's new Data-Oriented Technology Stack (DOTS) and Entity Component System (ECS) programming paradigm have been developed to optimize game development and open up new ways of accessing memory and parallel processing for developing high-performance C# code that takes advantage of contemporary multicore computers. Through the use of the Burst Compiler, your game programs become native code, able to run faster on multiple threads thus pushing the boundaries of the size of your virtual environments and the simultaneous processing of tens of thousands of game objects.

In this course, Penny demystifies Unity's new DOTS architecture and introduces intermediate Unity users to ECS by upgrading classic Unity projects and developing a multitude of examples of the use of DOTS concentrating on the most popular game mechanics. Using her internationally acclaimed teaching style and knowledge from over 25 years working with games, graphics and having written two award-winning books on games AI, Penny will take you from familiar object-oriented programming and upgrade your skill to the more memory efficient and optimized entity component architecture. Throughout, you will follow along with hands-on workshops designed to take you through every step of becoming familiar with ECS.  You will build on numerous scenarios that examine the basics of ECS programming through the new DOTS-specific math and physics libraries.

While DOTS is still in preview, this course aims to assist you in understanding how it works and how games are constructed with it.  The knowledge you obtain will further your ability to decipher future released Unity ECS tech demos and handle API updates.

This course requires Unity 2019.3.0f6. and the Hybrid Renderer Package 0.3.3.

Learn how to program and work with:

  • Entities and Components

  • The C# Job Systems

  • Collision Systems

  • Trigger Systems

  • User Input to Control Entities

  • Interfacing with classic Unity and game objects to entity-based systems.

Contents and Overview

The course begins with a section that compares the old way of working with game objects in Unity, through to the creation of a complete ECS system using the exact same scenario in each instance to give you time to compare the programming methods and optimizations gained through implementing DOTS.

Following this, you will dive deeper into the creation and debugging of entities while learning how to tag, identify and add data to them with custom components.  You will also learn how to find entities once they are injected into the game environment and to access and manipulate them at runtime.

After you've become comfortable with the nature of entities, you will discover how the new math library can be used to replicate many of the functions you've become familiar with in the Unity Mathf API.  The content will cover transformation, rotations, slerps, pivoting, following waypoints and pursuing and fleeing from targets.  A space-based scenario will be created with several planets and thousands of spacecraft programmed to attack, by generating even more thousands of bullets and finally explosions.

Next, you'll build a blocky Minecraft inspired landscape from cubes that can be infinitely generated in any direction by implementing Perlin Noise and examining how parallel processing (achieved through the C# Jobs system) dramatically speeds up processing that has in the past been limited to the main thread.

On completion of this exercise, a thorough examination of the new DOTS physics capabilities will take place.  All the classic Unity elements you've become used to will be replicated via the new physics API and ECS job systems.  You will learn about collisions, triggers, camera tracking, bullet physics and the basics of recreating Newtonian physics for moving dynamic and kinematic entities.

The course ends with a challenge and project to recreate a third person shooter in which a single player takes on a swarm of zombies.

At the completion of this course, you will be familiar with DOTS and the ECS and be able to further your skills by interpreting and making sense of the Unity tech demos as they are released, presenting updated API and introducing more and more functionality into DOTS.

What students are saying about Penny's courses:

  • Excellent course!! I am already in game development industry and there is one quote here that "Whenever you are not able to solve complex problem, its the right time to get back to the BASICS"

  • She is the best teacher ever in this platform

  • Most instructors are very smart people. Some are good at teaching and some are not. Penny is great at describing complex concepts without going down a dark cerebral rabbit hole that so many instructors feel obligated to do. It's like they need to demonstrate their knowledge by explaining every tiny aspect. Penny does not go there. She explains things clearly but does not overwhelm the student with more than they need to know.


Who this course is for:
  • Professionals and students who are comfortable using Unity but would like to upgrade their skills to implement the new Unity DOTS system.