Resources Related to Entity Component Systems

General discussions of the paradigm

Migrating an existing codebase to ECS

Dealing with Relationships between Entities

Introducing workers

Critiques of an over-zealous application of the ECS pattern

Development of additional tools such as editors

  • Creating an entity inspector that makes it possible to edit components while the simulation is running

General introductions

Using an events system to pass information between components

Constructs to update multiple components at once

  • Answer to a question on forums.xkcd.com Argues in favor of having a ComponentManager that updates multiple components at once to facilitate such things as collision detection or batching calls to one's rendering engine. Also takes into account parallelism.

Integration with existing game-engines

Representing and Storing Entities

  • Entities are represented as plain IDs in the Artemis framework.

Specific frameworks

  • Artemis for Java

  • A-Frame

  • Lumberyard An engine developed by Amazon that can be integrated with AWS and Twitch also relies on ECS. Comes with an editor.

How to handle player input

Architectural questions

  • How to achieve that systems don't need to look at every component whenever the system is run? Does it make sense to apply the observer pattern here?

  • How to deal with time?

  • Should there be a clear distinction between physics-driven and non-physics-driven entities?

Networking

  • Question on gamedev.net

  • Article 'Networking Entities' on developer.valvesoftware.com Differentiates between server-side only entities, client-side only entities as well as entities (the majority) that live on both the client and the server. Discusses the engine's entity networking system as a distinct module which is responsible for such things as detecting changes, serializing them and deserializing them. Furthermore, a distinction is made between member variables of entities that are server-side only and those that must be transmitted to the client. The latter are referred to as 'networked variables' and an events system is used to indicate that certain properties have been updated and need to be transmitted to the client again.

Having an intermediate Intent System

  • Answer on StackOverflow that explains the purpose of an Intent System The IntentSystem would be responsible for interfacing with the physical input devices and translate such things as button presses into intentions like running, jumping or reloading one's weapon. Also discusses an extension which the author terms 'Intent Context'. Also suggests that different sets of times could be used, say one for the simulation itself and another one that keeps running even when simulation is paused.

Setting up something like an EntityManager (container for entities)

Case studies

  • How to Build an Entity Component System Game in Javascript The author develops a simple game in Javascript based on an ECS.

  • Better Tower Defense Describes the challenges involved in the development of a new Tower Defense game built on top of an ECS. The author attempts to refine ECS to better deal with the fact that the order in which systems update components matters. The author views Systems in an ECS as state transformation functions. After such a transformation has been applied, the difference between the new and the previous game state is computed. This setup makes it possible for systems to subscribe to specific changes and receive notifications.

  • Description of the ECS inside the Bitsquid Engine Introduces ComponentManagers. For every component there exists a separate ComponentManager that decides how components are represented. There is therefore no abstract component class. Also uses entity ids whose upper bits are called the 'generation' part and whose lower 22 bits are called the 'index' part.

  • Building a Data-Oriented Entity System (Part 2: Components) Describes how the components for entities are laid out in memory in a cache-friendly manner. Uses a PointMassComponent that describes an entity's mass, velocity, acceleration and position in a single component.

  • Scott Bilas on the ECS in Dungeon Siege

Implementations in different languages

How to make an implementation more cache-friendly

Questions regarding how to choose one's components

  • Does it make sense to have separate components for things such as an entity's displacement and velocity or should those properties by bundled up in a single component?

Components other people use

  • ColliderComponent A component that knows an entity's bounding box.

  • StateComponent Why have something like a StateComponent? Doesn't every component store some aspects of an entity's state?

  • ControllerComponent

What kinds of systems to use

Books

  • SFML Game Development by Example by Raimondas Pupius