Systems and scheduling
Bind a query to a named callback and place it in a phase. One call to
ecs_progress() runs the schedule.
ecs::system("Move").phase(EcsOnUpdate) Entity Component System
Archetype storage, persistent queries, scheduled systems, relations, reflection, and tooling in one embeddable library.
SIECS manages component data and the systems that process it. Relations, events, resources, and metadata remain part of the same world.
Bind a query to a named callback and place it in a phase. One call to
ecs_progress() runs the schedule.
ecs::system("Move").phase(EcsOnUpdate)
Build hierarchies with ChildOf, share component defaults with
IsA, and attach custom relation targets.
child.child_of(parent) Keep singleton state in typed resources. Observers react to component changes and application events.
ecs::set_resource(Time{ .dt = 0.016f }) Reflect component fields for JSON serialization and inspect live entities and schemas through the optional REST explorer.
GET /entities Persistent queries retain their matching archetype tables. Iterators expose the requested component columns one batch at a time.
C describes terms and reads batch fields directly. C++ infers access from callback parameter types. Both interfaces use the same runtime.
ecs_query_id_t moving = ecs_query({
.terms = {
ecs_inout(Position),
ecs_in(Velocity),
},
});
ecs_iter_t it = ecs_query_iter(moving);
while (ecs_iter_next(&it)) {
Position *positions = ecs_field(&it, 0);
const Velocity *velocities = ecs_field(&it, 1);
for (uint32_t i = 0; i < it.count; i++) {
positions[i].x += velocities[i].x;
positions[i].y += velocities[i].y;
}
} ecs::query()
.each([](
Position &position,
const Velocity &velocity
) {
position.x += velocity.x;
position.y += velocity.y;
});
The standalone distribution is siecs.h and
siecs.c: one public header and one C source file.
cc -std=c23 -I. main.c siecs.c -pthread -o my_app Compile a small program first, then move into storage, API, and game-loop design.
Add the two files, create an entity, and run the first system.