3 ms·
> Anyone solved this before? Sure. Take a look at EnTT[1], a popular C++ ECS library. It comes with two main tools to deal with this: Sorting[2] and groups[3].
by dkersten 5y ago
> Anyone solved this before?
Sure. Take a look at EnTT[1], a popular C++ ECS library. It comes with two main tools to deal with this: Sorting[2] and groups[3]. EnTT gives you a large spectrum of tools with different trade-offs so that you can tune your code based on usage patterns. Obviously different bits of code will have conflicting access patterns, so there's no one-size-fits-all solution, but EnTT lets you optimise the patterns that are most important to you (based on profiling, hopefully).
[1] https://github.com/skypjack/entt https://github.com/skypjack/entt
[2] Sort one component to be in the same order as another component, so that they can be efficiently accessed together: https://github.com/skypjack/entt/wiki/Crash-Course:-entity-component-system#sorting-is-it-possible https://github.com/skypjack/entt/wiki/Crash-Course:-entity-c...
[3] https://github.com/skypjack/entt/wiki/Crash-Course:-entity-component-system#groups https://github.com/skypjack/entt/wiki/Crash-Course:-entity-c...