https://www.richardlord.net/blog/ecs/why-use-an-entity-framework.html
https://www.david-colson.com/2020/02/09/making-a-simple-ecs.html
- Very thorough, shows both a sparse and a compact version
- Explains Unity’s DOTS, a variant of ECS using archetypes
https://hacksoflife.blogspot.com/2021/02/making-soa-tollerable.html?m=1
- ECS
- struct of arrays
- SIMD
https://kyren.github.io/2018/09/14/rustconf-talk.html
- Long intro to ECS (Rust colored)
- Generational entity indices
Design for ECS in V
https://claude.ai/share/23d77773-bd59-4fff-9868-1fa6b935c4bb
- hot / high performance vs cold path split using embedded struct
- fixed-size arrays
- generational allocation of slots
ECS design
-
components known at compile time
- Placement { Position, Rotation }
- Movement {Velocity, Angular Velocity }
- Mesh
- Texture(s)
- ClosestCamera
-
Array of entities
- Each entity has a bitmask describing which components are associated with it
-
Systems
- Each system processes all entities with a specific set of Components
Examples:
- Physics requires Placement and Movement
- Render requires Placement, Mesh and Texture
- LOD requires ClosestCamera and Mesh
- Each system processes all entities with a specific set of Components
Examples:
See also
- Data Oriented Design :https://vimeo.com/649009599
- Zig struct of arrays : https://andreashohmann.com/zig-struct-of-arrays/