Entity component system

ECS follows the principle of composition over inheritance, meaning that every entity is defined not by a type hierarchy, but by the components that are associated with it.

ECS combines orthogonal, well-established ideas in general computer science and programming language theory.

That is, any complete component object system can be expressed with the templates and empathy model within The Orlando Treaty[2] vision of object-oriented programming.

This eliminates the ambiguity problems of deep and wide inheritance hierarchies often found in Object Oriented Programming techniques that are difficult to understand, maintain, and extend.

Common ECS approaches are highly compatible with, and are often combined with, data-oriented design techniques.

All games created before Object Oriented Programming used parallel arrays to store and perform operations on related data.

In 2002, Scott Bilas of Gas Powered Games (Dungeon Siege) gave a seminal talk on ECS.

In early January 2007, Mick West who worked on the Tony Hawk series, shared his experiences on the process of ECS adoption at Neversoft.

[5] Also in 2007, the team working on Operation Flashpoint: Dragon Rising experimented with ECS designs, including those inspired by Bilas/Dungeon Siege, and Adam Martin later wrote a detailed account of ECS design,[6] including definitions of core terminology and concepts.

In 2015, Apple Inc. introduced GameplayKit, an API framework for iOS, macOS and tvOS game development that includes an implementation of ECS.

[8] In October 2018[9] the company Unity released its megacity demo that utilized a tech stack built on an ECS.

Unity's ECS runs on a powerful optimised architecture known as DOTS which "empowers creators to scale processing in a highly performant manner".

However this can be a place for bugs to hide, since propagating values from one system to another through components may be hard to debug.

One good example is the blog posts by Richard Lord where he discusses the merits and why ECS designed game data storage systems are so useful.

A simple Entity–Component–System layout.