What's an Entity System?

(or "Component-Oriented", or "Component-Entity System", or "Entity/Component System" / "ECS")

Entity Systems (ES) are a software technique using Composition rather than Inheritance to build high-performance code-architectures, using a structure similar to relational-databases and/or functional-programming.

Primarily used in Game Development since the early 2000's as a replacement for large, Inheritance-based, OOP architectures, they're now starting to be used in general Software Engineering.

Description

Most ES's today are based on three core concepts (see also: ES Terminology for more detail)

  1. Entity: A unique ID that tags each game-object as a separate item.
  2. Component: All the data for one aspect of the object.
  3. System: All the code for the one aspect of the gameobjects.

Each System runs continuously, performing global actions on every Entity that possesses a Component of the same aspect as that System. The interaction of Components with Systems provides the kernel of a modern Entity System.

NB: Newer articles use the term "Processor" instead of "System", to reduce confusion with the other "systems" (and with the title: "Entity System")

Starting points

The navbar on the left has links to get you started, and a large selection of Source Code examples.

We also have a list of basic ES approaches