ecs-0(1) ecs-0(1)


The why and how of making an entity-component-system for personal use.


  1. Part 0*
  2. Part 1

    Understanding bevy's ECS implementation.


I really liked working with bevy and the bevy ECS in rust; I was peering through the code of the bevy_ecs and I realized it's actually very easy to understand. I've been meaning to write my own ECS to develop skills that I want, so I've decided to do a loose port to Zig, focusing almost entirely on the entity storage and lookup sides for the moment.

But what is an ECS? To quote the bevy project:

ECS is a software pattern that involves breaking your program up into Entities, Components, and Systems. Entities are unique things that are assigned groups of Components, which are then processed using Systems.


More than anything, I am curious to see how relying more on comptime than traits will result in a different system. From my current, uninformed perspective, I would think certain things will be easier, such as finding out the access requirements of systems, and certain things could be harder, such as adding constraints on what can and can't be a Component.

I am also curious as to how also how exposing control over memory allocation would push things in a different direction; while bevy_ecs does implement some custom data structures, memory allocators aren't really taken into account. Trying out different memory allocators is something that I would like to explore.


Our journey through understanding and implementing an ECS:

  1. Part 1: Bevy's Entities and Components

    A walkthrough of how Bevy ECS works, focused on how entities are stored and retrieved.

And more to come!