skip to content
Ben Lau statistics . machine learning . programming . optimization . research

Entity Component System (ECS)

1 min read Updated:
  • ECS is about separating data and functionality. Resolving collisions and emmitting particles are functionality, not data, so they’d be in a system and wouldn’t be ‘owned’ by anyone.
  • In ECS you process everything in bulk. And usually in ECS, you work with Ids and not with references or heirarchical data. Everything is flat. Everything’s in lists.
  • Entity component systems are great for when you need to quickly iterate over all instances (usually on one of the attributes, such as position). Since most servers are reactive there is no need to optimise for iteration, instead focusing on quickly finding the few entities being operated upon.
  • ECS is the in-memory equivalent of column based databases (e.g. Cassandra vs Postgres).
  • Overwatch uses ECS for part of their game engine
  • Minecraft Bedrock Edition uses ECS for their game engine
  • Noita uses ECS for their game engine
  • Potential usecases
    • Vampire survivor: Many similar entities

Why you don’t use it