Entity Component System

From Unify Community Wiki
(Difference between revisions)
Jump to: navigation, search
(added Unity ECS page)
 
(Samples)
 
(7 intermediate revisions by one user not shown)
Line 2: Line 2:
 
== Introduction ==
 
== Introduction ==
  
The Unity Entity Component System (ECS) is a new data oriented framework for building games in Unity that is currently being developed by Unity Technologies as part of their [https://unity3d.com/performance-by-default “Performance by Default”] initiative. The [[Package Manager|package]] can be used on it's own but is deigned to work with the new [[Job System |C# Job System]] and [[Burst Compiler]] packages to vastly increase engine performance through automatic native code optimization and multi-threading support. Unity claims that using these new systems together can lead to as much as x100 speed improvements over the existing “classic” GameObject and MonoBehaviour system.
+
The Entity Component System (ECS) is a new official framework for writing highly optimized, data oriented code in Unity. It's currently being developed by Unity Technologies as part of their [https://unity3d.com/performance-by-default “Performance by Default”] initiative, along with the new [[Job System |C# Job System]] and [[Burst Compiler]]. The ECS [[Package Manager|package]] can be used by itself but is designed to work in unison with these other packages to vastly improve performance through automatic native code optimization and multithread support. Unity claims that using these new packages together can lead to as much as x100 speed improvements over the existing “classic” GameObject and MonoBehaviour architecture!
  
== Development Status ==
+
=== Development Status ===
+
Unity ECS is currently in "preview" and not yet considered production ready. You are free to use it to develop and release games today but should be aware that it's currently in active development and you may encounter bugs or stability issues when using it. Many features are also still missing and the API is likely to change before the official 1.0 release. However, trying out the package now allows you to prepare for the future of Unity and provide feedback that will have a direct effect on the final product. Visit the [https://forum.unity.com/forums/entity-component-system-and-c-job-system.147/ official forum] to get involved, ask questions or give feedback.
+
  
== Third-Party Alternatives ==
+
Unity ECS is currently in "preview" and is therefore not yet considered production ready. This means you're free to use it to build games today but should be aware that it's currently in active development so you may encounter bugs and stability issues. Some features are also missing and the API will continue to evolve and change before the official 1.0 release. Unity currently recommends only using the new ECS package for experimentation or if you're just starting your project and plan to release towards the end of 2019 or later. Since the package should be quite stable by then.
  
For developers looking for production ready entity component systems to use today, there are a few alternatives. Most notable frameworks are [https://github.com/sschmid/Entitas-CSharp Entitas] by Simon Schmid and [https://github.com/sebas77/Svelto.ECS Svelto.ECS] by Sebastiano Mandalà. Both of which have been battle tested in professional game productions.
+
=== Hybrid Approach ===
  
== Installation and Setup ==
+
This new ECS architecture will eventually replace most existing “classic” systems in Unity (transforms, game objects, renderers, etc.). This will however happen “under the hood”, meaning that traditional Unity workflows will remain mostly unchanged. (e.g. constructing prefabs and adding components to them) However, at the moment there are only a few Unity features implemented in ECS and it will take several years to transition most systems over. This means you currently have to use a somewhat awkward “hybrid approach” if you wish to use most existing Unity features like Physics or Animators with ECS. This is done by using a mix of “classic” and ECS components together.
  
To use the new ECS features you need to install the Entities package via the [[Package Manager]] (introduced in Unity 2018.1) which is accessible under the Window menu on the toolbar. Using this package with the latest version of Unity is recommended since older versions may not be compatible with the latest version or support all the latest features.
+
=== Installation  ===
  
== Example Projects ==
+
To use the new ECS features you need to install the Entities package via the [[Package Manager]] (introduced in Unity 2018.1) which is accessible from the toolbar menu “Window”. Using this package with the latest version of Unity is recommended since older versions may not be compatible or support all the latest package features.
  
* [https://github.com/Unity-Technologies/EntityComponentSystemSamples| Entity Component System Samples] - Official Unity ECS samples repository
+
=== Third-Party Alternatives ===
  
== Official Documentation ==
+
For developers looking for production ready ECS framworks or just want to explore other alternatives there are a few options out there. Most notable ones being [https://github.com/sschmid/Entitas-CSharp Entitas] by Simon Schmid and [https://github.com/sebas77/Svelto.ECS Svelto.ECS] by Sebastiano Mandalà. Both of which have been battle tested in professional game productions and are actively maintained.
  
Since the system is still under heavy development official documentation has not yet been created but you can view a work-in-progress draft [https://github.com/Unity-Technologies/EntityComponentSystemSamples/blob/master/Documentation/index.md here].
+
== Documentation ==
[[Category:Scripting]]
+
 
[[Category:ECS]]
+
* [https://github.com/Unity-Technologies/EntityComponentSystemSamples/blob/master/Documentation/index.md Unity ECS Documentation] - Official documentation (work in progress).
 +
* [[Unity ECS Overview]] - Covers main concepts and terminology.
 +
* [[Unity ECS FAQ]] – Answers to frequently asked questions about Unity ECS.
 +
* [[Unity ECS Cookbook]] - Tips, tricks and best practices for common situations.
 +
* [[Unity ECS Examples|ECS Examples]] - Collection of links to various sample projects.
 +
* [[Unity Hybrid ECS]] - Explains how to use both "classic" and ECS components together.
 +
 
 +
== Samples ==
 +
 
 +
* [https://github.com/ArturoNereu/ECS_101 ECS 101] - An introduction to Unity's new Entity Component System.
 +
* [https://github.com/KptEmreU/Roll-A-Ball-ECS-style Roll-A-Ball ECS] - Recreation of official Unity [https://unity3d.com/learn/tutorials/s/roll-ball-tutorial Roll-a-ball tutorial] in pure ECS.
 +
* [https://github.com/davidpol/SurvivalShooterECS Survival Shooter ECS] - A port of Unity's Survival Shooter tutorial project to the Entity Component System.
 +
* [https://github.com/UnityTechnologies/SpaceShooterECS Space Shooter ECS] - This project is meant to be a "Rosetta Stone" for understanding how to get started with Unity ECS.
 +
* [https://github.com/UnityTechnologies/MinecraftECS Minecraft ECS] - Workshop project showing how to make a voxel based game environment using hybrid ECS.
 +
* [https://github.com/seanmoakes/ClassicToHybrid Classic to Hybrid] - Shows how to progressively integrate ECS into existing Unity projects.
 +
* [https://github.com/Unity-Technologies/EntityComponentSystemSamples Samples] - Official Unity ECS samples repository on GitHub.
 +
* [https://github.com/Unity-Technologies/UniteAustinTechnicalPresentation Nordeus RTS Demo] - Source to Unite Austin presentation showing a massive RTS battle simulation.
 +
* [https://github.com/stella3d/job-system-cookbook C# Job System Cookbook] - Various examples showing how to use the job system at scale.
 +
* [https://github.com/Unity-Technologies/AnotherThreadECS Another Thread ECS] - Project showcasing entities and the C# Job System.
 +
* [https://github.com/keijiro/Voxelman Voxelman] - Fun example that shows how to use the new Entity Component System with Unity in an extreme way.
 +
* [https://github.com/PhilSA/ECSPhysics ECS Physics] - A custom C# physics engine made using pure ECS.
 +
* [https://github.com/keijiro/Firefly Firefly] - Example showing the creation of special effects using Unity ECS.
 +
* [https://github.com/zulfajuniadi/unity-ecs-navmesh Navmesh and MapBox] - A demo implementation of Unity Entity Component System with NavMesh.
 +
* [https://github.com/liuhaopen/UnityMMO Unity MMO] - Client and server built using Unity ECS, xlua and skynet.
 +
* [https://github.com/maajor/OSMTrafficSim OSM Traffic Sim] - A project to simulate city traffic.
 +
* [https://github.com/paullj/unity-ecs-instanced-sprite-renderer Instanced Sprite Renderer] - Simple example of how to create a performant instanced sprite renderer.
 +
* [https://github.com/EsProgram/uSpringBone uSpringBone] - High performance SpringBone using ECS and JobSystem in Unity.
 +
* [https://github.com/Xerios/ECS-Tween ECS Tween] - A very simple Unity tweening engine using pure ECS that works with GameObjects!
 +
* [https://github.com/bellicapax/bepu-physics-for-unity-ecs BEPU Physics for Unity ECS] - Translation in progress of BEPU Physics library v1 to Unity's ECS and Job System.
 +
* [https://github.com/Prastiwar/ECS2048 ECS 2048] - 2048 like game using Unity's ECS.
 +
* [https://github.com/DeadlyApps/Unity-ECS-ZombieSimulator ECS ZombieSimulator] - Pretty self explanatory ;)
 +
* [https://github.com/hecomi/UnityECSBoidsSimulation Boids Simulation] - Another boids simulation that is different from the one featured in the official samples.
 +
* [https://github.com/tertle/com.bovinelabs.entities Bovine Labs Entities] - Collection of useful extensions and more by Timothy Raines (tertle).

Latest revision as of 20:56, 3 January 2019

Contents

[edit] Introduction

The Entity Component System (ECS) is a new official framework for writing highly optimized, data oriented code in Unity. It's currently being developed by Unity Technologies as part of their “Performance by Default” initiative, along with the new C# Job System and Burst Compiler. The ECS package can be used by itself but is designed to work in unison with these other packages to vastly improve performance through automatic native code optimization and multithread support. Unity claims that using these new packages together can lead to as much as x100 speed improvements over the existing “classic” GameObject and MonoBehaviour architecture!

[edit] Development Status

Unity ECS is currently in "preview" and is therefore not yet considered production ready. This means you're free to use it to build games today but should be aware that it's currently in active development so you may encounter bugs and stability issues. Some features are also missing and the API will continue to evolve and change before the official 1.0 release. Unity currently recommends only using the new ECS package for experimentation or if you're just starting your project and plan to release towards the end of 2019 or later. Since the package should be quite stable by then.

[edit] Hybrid Approach

This new ECS architecture will eventually replace most existing “classic” systems in Unity (transforms, game objects, renderers, etc.). This will however happen “under the hood”, meaning that traditional Unity workflows will remain mostly unchanged. (e.g. constructing prefabs and adding components to them) However, at the moment there are only a few Unity features implemented in ECS and it will take several years to transition most systems over. This means you currently have to use a somewhat awkward “hybrid approach” if you wish to use most existing Unity features like Physics or Animators with ECS. This is done by using a mix of “classic” and ECS components together.

[edit] Installation

To use the new ECS features you need to install the Entities package via the Package Manager (introduced in Unity 2018.1) which is accessible from the toolbar menu “Window”. Using this package with the latest version of Unity is recommended since older versions may not be compatible or support all the latest package features.

[edit] Third-Party Alternatives

For developers looking for production ready ECS framworks or just want to explore other alternatives there are a few options out there. Most notable ones being Entitas by Simon Schmid and Svelto.ECS by Sebastiano Mandalà. Both of which have been battle tested in professional game productions and are actively maintained.

[edit] Documentation

[edit] Samples

  • ECS 101 - An introduction to Unity's new Entity Component System.
  • Roll-A-Ball ECS - Recreation of official Unity Roll-a-ball tutorial in pure ECS.
  • Survival Shooter ECS - A port of Unity's Survival Shooter tutorial project to the Entity Component System.
  • Space Shooter ECS - This project is meant to be a "Rosetta Stone" for understanding how to get started with Unity ECS.
  • Minecraft ECS - Workshop project showing how to make a voxel based game environment using hybrid ECS.
  • Classic to Hybrid - Shows how to progressively integrate ECS into existing Unity projects.
  • Samples - Official Unity ECS samples repository on GitHub.
  • Nordeus RTS Demo - Source to Unite Austin presentation showing a massive RTS battle simulation.
  • C# Job System Cookbook - Various examples showing how to use the job system at scale.
  • Another Thread ECS - Project showcasing entities and the C# Job System.
  • Voxelman - Fun example that shows how to use the new Entity Component System with Unity in an extreme way.
  • ECS Physics - A custom C# physics engine made using pure ECS.
  • Firefly - Example showing the creation of special effects using Unity ECS.
  • Navmesh and MapBox - A demo implementation of Unity Entity Component System with NavMesh.
  • Unity MMO - Client and server built using Unity ECS, xlua and skynet.
  • OSM Traffic Sim - A project to simulate city traffic.
  • Instanced Sprite Renderer - Simple example of how to create a performant instanced sprite renderer.
  • uSpringBone - High performance SpringBone using ECS and JobSystem in Unity.
  • ECS Tween - A very simple Unity tweening engine using pure ECS that works with GameObjects!
  • BEPU Physics for Unity ECS - Translation in progress of BEPU Physics library v1 to Unity's ECS and Job System.
  • ECS 2048 - 2048 like game using Unity's ECS.
  • ECS ZombieSimulator - Pretty self explanatory ;)
  • Boids Simulation - Another boids simulation that is different from the one featured in the official samples.
  • Bovine Labs Entities - Collection of useful extensions and more by Timothy Raines (tertle).
Personal tools
Namespaces

Variants
Actions
Navigation
Extras
Toolbox