Lesson 19
Where to learn more
The official manuals, the examples worth reading first, real projects built on flecs, and where people ask questions.
These lessons cover the parts of flecs that are easiest to get wrong. The official documentation covers everything, and it’s good. Here’s where to go next, roughly in the order that helps most.
The manuals
- Designing with Flecs: the author’s own guidance on structuring entities, components, systems and modules. Read it after this course and much of it will feel familiar.
- Quickstart and Entities and components: the full API surface for the basics, including ids, names and entity ranges.
- Queries and the query language: every term, operator and traversal option.
- Systems: phases, custom pipelines, sync points, immediate systems and threading.
- Observers: events, custom events, and what each event delivers.
- Relationships, hierarchies and prefabs.
- Component traits: Sparse, DontFragment, CanToggle, Exclusive, cleanup policies and the rest, in one place.
- Flecs Script and the remote API.
- FAQ, and the general ECS FAQ if you’re explaining ECS to someone else.
All of these are linked from the documentation index, which also lists videos, engine integrations (Unreal, Godot, raylib, SDL) and articles.
Code to read
- The examples in the flecs repository, for C and C++. Each one is small and runs on its own. The
relationships,queries,observersandreflectionfolders pair well with the lessons here. - flecs-hub: modules that build a small engine out of flecs (transform, physics, input, rendering), and flecs-game, which ties them together. They show how real modules split components, systems and phases.
- City (live) and Tower defense: complete demos built from those modules.
- Extermination Shock and ECS Survivors: open-source games, so you can see how a full project organises itself.
Articles
The author’s articles explain why flecs is built the way it is, which makes the trade-offs in these lessons easier to reason about:
- Archetypes and vectorization and storage in pictures: the storage this course visualises.
- Doing a lot with a little: ECS identifiers: ids, versions and pairs.
- Building games in ECS with entity relationships and data-oriented hierarchies.
- Why storing state machines in ECS is a bad idea: the long version of “is it data or a state?”.
Tools
- The Explorer: connect it to your running game to inspect entities, tables, queries, systems and memory. Its script playground runs Flecs Script in the browser with nothing to install.
- The sandbox on this site: a live world for poking at storage and observers.
People
The flecs Discord is active, friendly, and where much of the practical knowledge on this site comes from: people sharing what they measured, what surprised them, and what worked in their games. Search it before asking, since most questions have come up before, and bring numbers if you’re asking about performance.