This blog is about Entity Component Systems. If you’d like to learn more about ECS, see this FAQ: https://github.com/SanderMertens/ecs-faq

I usually shy away from the “P word” in conversations about ECS. Whenever it is uttered all it seems to do is divide people into two camps, which is rarely a good thing. Yet some people persist that ECS is a paradigm, whereas others are adamant it is not. So is ECS a paradigm? Does it even matter?

If you’d ask me I’d argue that no, it is not a paradigm, and yes, it matters.

The reason why it matters is…


v2.3 puts hierarchies on steroids!

I blog-skipped v2.2, so there’s a lot to catch up on :-)

First of all, Flecs is an Entity Component System (ECS). If you don’t know what an ECS is, check out the FAQ.

Much has happened since the last update, and not all of it in code! The Flecs community has grown rapidly and now has more than 300 people on the Discord with many more outside of it (welcome everyone 👋). Flecs has also been adopted by a bunch of new ambitious and exciting projects in gaming, government and AI!

Flecs is also increasingly finding a home with…


One of the key design goals of Flecs is to enable reusability. When we talk about reusability, it is often the reusability of code. While that is a big part of it, reusability of data is just as important, especially in games. Data comes in many forms, like models, materials, textures or data for game mechanics.

Most, if not all games have elements of repetition. Whether it is shapes in a Tetris games, units in an RTS game, decorative assets like plants, mailboxes or refrigerators or just about any particle system, repetition is everywhere. …


It has only been one month since version 2.0 came out, and yet Flecs 2.1 has lots of improvements that makes building games with C and C++ easier than ever! Let’s go over some of the new developments, starting with:

Flecs Hub

This is not strictly part of the Flecs core, but still worth noting as a lot of progress has been made on several flecs modules, like the new sokol-based renderer, object transforms, window creation and a Lua binding. …


Disclaimer: I am the author of Flecs, a C/C++ Entity Component System. If you’d like to know more about ECS, see this FAQ.

If you are using an ECS (Entity Component System) for the development of a game, chances are that at some point you had to ask yourself whether you wanted to store the state machine in ECS. I have, and it turned out to be a lot harder than expected, for more than one reason. …


Link to the Flecs Discord. Link to the repository.

After having been in development for almost a year, Flecs 2.0, an Entity Component System for C and C++ is finally out! This release is almost a complete revamp of the internal data structures, and comes with many new features that make it easier than ever to build games with an Entity Component System.

Here are the some of the highlights of v2:

Easier Build Process

Building C and C++ code can sometimes be a chore, especially if a library doesn’t use the same build system as your own project. For this reason Flecs…


Disclaimer: I am the author of Flecs, an Entity Component System for C99. Discord: https://discord.gg/ZSSyqty

If you are writing your own ECS framework (or are about to), there is a good chance you are designing your entities as unique integer values. One of the simplest ways of implementing an ECS is to create an array for each component, and to use the entity identifier as index in each of these arrays (often combined with a bitset to test if the entity has the component). …


Disclaimer: I am the author of Flecs, an Entity Component System for C99. Discord: https://discord.gg/ZSSyqty

When I started writing my first ECS a year ago, I was excited. It seemed to do something unique by offering more flexibility and performance to a developer at the same time. Also, having high-level design primitives that translate well to cache- and vectorization friendly code sounded great.

This has all proven to be true, at least for me. And yet.

First I have to preface this blog with something. There are two ways you can look at ECS. One is that it is a…


Flecs Discord: https://discord.gg/MRSAZqb

This is the second in a series of posts about the guts of Flecs, an Entity Component System for C and C++. Each post will cover a different part of the design and turn it inside out, so that at the end of each post you will have enough information to implement it yourself.

The blog is intended both for Flecs users as well as people interested in ECS and game design. …


Flecs Discord: https://discord.gg/MRSAZqb

This is the first in a series of posts about the guts of Flecs, an Entity Component System for C and C++. Each post will cover a different part of the design and turn it inside out, so that at the end of each post you will have enough information to implement it yourself.

The blog is intended both for Flecs users as well as people interested in ECS and game design. …

Sander Mertens

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store