Entity Component System & Jobs

Unity 2018.1 introduced the experimental Entity Component System (ECS), together with the new C# Job System these technologies represent Unity's first steps towards a paradigm shift away from object oriented design. One of the problems that ECS is trying to solve is that game programming languages for the most part are object oriented by design. As a consequence the design and layout of data used by  many games is limited to some extent by the need to facilitate the data structures and access mechanisms offered by the language being used. It is possible in many cases to avoid the structures imposed by the language but by doing so you drop to a very minimal version of the language and forfeit many of the more useful advanced features. ECS (usually with the help of a custom API) attempts to solve this problem by replacing the traditional object oriented design process with a more modern (and game friendly) data oriented design. Allowing entities to be specified, grouped and processed in a more efficient and performant manner, taking full advantage of modern multi-core hardware.

  • ENTITY a group of typed components i.e. [Bullet Entity]

  • COMPONENT a container for data, it does not include any logic i.e. [Render] [Position]

  • SYSTEM contains logic to process entities with a specific set of components i.e. [Render System]

  • JOBS package data from a system to facilitate multicore processing i.e. [Render Job]

Screen Shot 2018-06-08 at 14.58.24.png

My thoughts on ECS are mixed, for the most part I like the idea, if its implemented well then its going to make a great solution for developing games or even on a smaller scale for a heavy routine that needs a little extra horse power. My worry is that the obvious practical uses (and almost all the current demos) focus entirely on large systems of spawned objects, flocking BOIDS, asteroids floating in space etc. Sure it looks impressive, classic Unity gives 10,000 space rocks @ 30 FPS, ECS/Job Unity gives 35,000 @ 30 FPS, but there is a reason for this, as these types of problems are ideally suited to ECS & Jobs. If Unity can implement a system where the obvious choice for a fairly new to Unity indy developer working on a Flappy Bird clone or designing an infinite runner is to use ECS & Jobs then they will have truly cracked this problem. If on the other hand ECS (as it is now) remains as a rather badly documented, cryptic set of API wrappers that you wrestle around your C# code then its not going to gain traction and will remain in the fairly barren no mans land between Indy developers who just want to get on and make a game and hardcore game developers who have the time and patience to make ECS/Jobs work efficiently.