(v0.50) DOTS Tutorial - Build a Multiplayer AR app
  • What is the Purpose of this DOTS Tutorial?
  • Important Notes For Using This Gitbook
  • Unity ECS
    • Intro to Unity ECS
    • Create a Unity ECS Project
    • Spawn and Move Prefabs
    • Spawn and Move Players
    • Spawn Bullets and Destroy Player
    • Publish Builds in Unity ECS
  • Unity DOTS Physics
    • Intro to Unity DOTS Physics
    • Use DOTS Physics for Prefabs, Players, and Bullets
    • Use DOTS Physics for Collisions
  • Unity DOTS NetCode
    • Intro to DOTS NetCode
    • Create a Network Connection using DOTS NetCode
    • Load a Game using DOTS NetCode
    • DOTS NetCode and Prefabs
    • DOTS NetCode and Player Prefabs
    • Use DOTS NetCode for Collisions and Destroying Bullet Prefabs
    • Dynamically Changing Ghosts Between Interpolated and Predicted
  • UI Builder and UI Toolkit
    • Intro to UI Toolkit
    • Create a ScreenManager
    • Style a View
    • Create a ListView
    • Responsive Game UI
    • Navigate Between Scenes Using ClientServerBootstrap
  • Multiplayer (NetCode+, UI Toolkit+)
    • Intro to Unity NetCode Multiplayer
    • Host or Join a Multiplayer Session on LAN
    • Broadcast a LAN Multiplayer Game
    • Keep Score and Update Game UI
    • Send Ghosts with NetCode Using Relevancy
  • AR Foundation
    • Intro to AR Foundation
    • Set Up AR Foundation and ARKit
    • Spawn a Player using AR Foundation
    • Update UI using AR Foundation
Powered by GitBook
On this page
  • What you'll develop in this ECS section
  • Functionalities included
  • Entity Component System (ECS)
  • 😃☯ Learning Unity ECS will be worth it! Look at these performance gains:
  • 😳 ☯ Unity ECS will be painful at times (costs of ECS):
  • Unity resources
  • To be best prepared for the code-alongs
  1. Unity ECS

Intro to Unity ECS

This gitbook explains "how" to implement ECS in Unity. It does not explain "what" ECS is, but we make sure to provide links to external resources throughout the gitbook that explain the "what."

PreviousImportant Notes For Using This GitbookNextCreate a Unity ECS Project

Last updated 2 years ago

What you'll develop in this ECS section

Github branch link:

Functionalities included

  • Sub Scenes and conversions

    • Setting components and variables during conversion

  • Using EntityManager to make structural changes

  • Using command buffers to make structural entity changes

    • Setting up command buffers to run parallel jobs with CreateCommandBuffer().AsParallelWriter()

  • Adding, setting, and removing components

  • Generating authoring components and IConvertGameObjectToEntity interfaces

  • Entity queries and .ForEach()

    • Setting local variables for entity queries

    • Scheduling a job with .Schedule()

    • Scheduling a parallel job with .ScheduleParallel()

    • Running on the main thread with .Run()

    • Combining job handles with JobHandle.CombineDependencies()

  • Create and destroy entities programmatically

  • Create and move entities based on user input

  • Create an entity from a prefab

    • Adding cameras to entities

  • Hybrid ECS

  • New Build Configuration system

    • Creating a base shared configuration

  • Sub-second "play" start

Entity Component System (ECS)

...and if you can spare 0 minutes to understand ECS:

😃☯ Learning Unity ECS will be worth it! Look at these performance gains:

😳 ☯ Unity ECS will be painful at times (costs of ECS):

Sure, ECS is exciting, but from the Forum threads we linked to above, you can see that there is plenty of complexity that needs to be managed.

Learning a functional programming paradigm can be difficult. Shifting out of a OOP mindset dominance can be difficult, too. ECS demands both, to some degree.

Luckily, Unity's current ECS architecture is actually a hybrid (of both Monobehaviour and ECS), which eases you into the data-oriented paradigm if you are totally new to it.

Unity resources

To be best prepared for the code-alongs

If you can spare 32 minutes listen to explain Unity's ECS and their hybrid approach (A MUST-WATCH IF HAVE NEVER WORKED WITH ECS)

If you can spare 64 minutes listen to Blizzard's explain general concepts in ECS (Not Unity-specific ECS, actually Blizzard's own game engine, but the architectural concepts are the same) <-- ESPECIALLY RECOMMENDED FOR NETCODE

If you can spare 42 minutes listen to Unity's 5-part series overview of ECS: , , , . for more explanations of ECS

If you can spare 23 minutes listen to explain ECS

If you can spare 9 minutes listen to (RIP 💀) explain ECS

Read the high-level overview of how Unity thinks about and implements ECS:

Read through the explanation of Unity Editor's ECS-specific windows

Unity documentation for Unity.Entities 0.50.1-preview.2: . Refer to this for more information.

Unity forums for DOTS: . Pretty responsive to questions.

Unity samples for ECS: . More in-depth and complicated examples.

Big brain discussion on ECS vs. GameObjects: . If you are a bit more hardcore.

Join our Discord for more info
Far North Entertainment
Timothy Ford
Part 1
Part 2
Part 3
Part 4
Part 5
Code Monkey
Brackeys
https://docs.unity3d.com/Packages/com.unity.entities@0.50/manual/index.html
https://docs.unity3d.com/Packages/com.unity.entities@0.50/manual/editor-workflows.html
https://docs.unity3d.com/Packages/com.unity.entities@0.50/manual/
https://forum.unity.com/forums/data-oriented-technology-stack.147/
https://github.com/Unity-Technologies/EntityComponentSystemSamples/blob/master/ECSSamples/ReleaseNotes.md
https://forum.unity.com/threads/whats-your-opinion-on-ecs-video-by-bobby-anguelov.1029871/
Join our Discord for more info
https://github.com/moetsi/Unity-DOTS-Multiplayer-XR-Sample/tree/Building-the-Project/
So, yeah... Watch at least one of the videos. Top rec is the first one (Far North Entertainment)
Screenshot from the Far North Entertainment video above.