Entity Component Systems

An Entity Component System (ECS) is a way of structuring your code in an alternative to classic object oriented programming. It differs in two key regards:

  1. In OOP, you combine like data and functionality into a class. In an ECS, you have clear separation between data and functionality.
  2. In OOP, you use inheritance to avoid re-writing code in child classes. In an ECS, you define granular systems which are shared (not inherited) by multiple entities.

ECS can be a little difficult to wrap your head around at first, but they can be really powerful for games (which is why you’ll see a version of it employed by the popular Unity3D engine). To learn more about them, check out some of the tutorials below. Currently they are written using the Artemis implementation of an ECS system, but the principles carry over into other systems and languages as well.

Additional resources that I’ve found helpful: