Sander Mertens
Jun 17, 2023

--

The reason is queryability. If you want to iterate all entities in a specific state with a regular component, you'd have to iterate all entities that participate in the state machine.

With the data structure mentioned here (I should update the blog with the latest improvements) you don't have to do that, as you can follow a linked list to find all entities with the state.

--

--

Sander Mertens
Sander Mertens

Written by Sander Mertens

Author of Flecs, an Entity Component System for C and C++

No responses yet