Comment

Comment by lionkor

Am I crazy or is your approach to ECS similar to a data oriented ECS?

In a fully, brutally data-oriented ECS, you would allocate all components of the same type in the same memory block, so you'd effectively end up with a std::vector<TransformComponent> and a std::vector<PhysicsComponent>, etc. Each entity then holds ids, such as a pair of `what` component and `index` into the respective vector. This ensures that, like your approach, the cache is used well, and that memory fragmentation is minimal.

I find your project(s) very, very inspiring as I love working on similar problems among others (github.com/lionkor), thank you for sharing!

parent lionkor 3 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton