3 ms·
> And we decided that each system processes relevant entity data by iterating through entities first. Now we have another problem - growing the number of entiti
by gameman144 5y ago
> And we decided that each system processes relevant entity data by iterating through entities first. Now we have another problem - growing the number of entities slows down every system, even the ones that are not related...
Call me out if I'm wrong, but I don't know of any high-performance ECS framework that actually does this. Most frameworks maintain sorted collections of components with no gaps. For instance, if I want all entries with X,Y,Z, then I iterate those three arrays starting at their X,Y, Z section, and the order of components in that section of the arrays matches exactly (meaning we can just iterate through them all).
This library seems like a really neat concept, but I think the ECS concepts that it's critiquing aren't actually used in many production-quality frameworks. Call me out if I'm just missing context here.
Also, I'd love more details on how CGS is able to always iterate on flat vectors with no gaps. The only way I've seen to accomplish this is to do a decent amount of work curating components into multiple orderings, so if CGS is avoiding that, I am equal parts skeptical and very very excited (since that would be super useful!)
- hrh 5y agoWhat libraries/frameworks are state of the art?
- jayd16 5y agoUnity's implementation is well documented and handles this.
- xaedes 5y agoThere is EnTT, an ECS as C++ library: EnTT is a header-only, tiny and easy to use library for game programming and much more written in modern C++. Among others, it's used in Minecraft by Mojang, ... https://github.com/skypjack/entt https://github.com/skypjack/entt
- gameman144 5y agoEnTT is the one I was thinking of -- I'd highly recommend looking into its implementation, as it's both very well-documented and readable, and blazing fast. The fact that even this caliber of implementation has to handle multi-component cases by doing super careful curation of components is what makes me skeptical that CGS would be able to solve this situation more efficiently/easily. I would be very happy to be proven wrong here, though.
- jayd16 5y agoAgree. This presents a bit of a strawman of ECS. No reason components can't reference others or Systems can keep look up tables in ECS.