A short introduction to Entity-Component-System in C++ with EnTT

David Delassus
15 min readJan 8, 2023

This is the third devlog in my series about my game Warmonger Dynasty (a 4X turn-based strategy game). If you want to read the previous entries, take a look at my reading list.

Today, we are gonna talk about Entity-Component-Systems in C++ (ECS for friends), and especially about one great header-only library simply called EnTT.

What is an ECS?

The concept was born in a Computer Science field called “Data Oriented Design”. To understand it better, it’s best to look at alternatives first.

In every game, we can clearly identify different parts which will have their own logic, for example:

  • the character
  • the enemies
  • items and/or bonuses

In Unity, we call those “Game Objects”. In Unreal Engine, we call those “Actors”. In Godot, we call those “Scenes”.

They usually gather data like health, strength, position, velocity, … and logic like…

--

--