|
|
|
|
|
by geneotech
1094 days ago
|
|
Hey there, a little clarification - I don't claim that I came up with ECS itself, only a particular implementation of it that is very memory efficient, and Unity's patent concerns a specific implementation as well - sorry if that was a bit misleading. As for the title, I just couldn't resist making the pun, maybe you're right though that the packer should be talked about separately. |
|
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!