Our great sponsors
-
> 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
[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-c...
[3] https://github.com/skypjack/entt/wiki/Crash-Course:-entity-c...
-
Personal anecdote: Habitat was developed as a sort of application deployment / configuration management tool in Rust, and the architecture there is roughly equivalent to an ECS. I found it a joy to work with and work on. Not sure if it's fundamentally a better software pattern, but it at least meshes with my brain better than how most OO-style software is laid out.
-
SonarQube
Static code analysis for 29 languages.. Your projects are multi-language. So is SonarQube analysis. Find Bugs, Vulnerabilities, Security Hotspots, and Code Smells so you can release quality code every time. Get started analyzing your projects today for free.
-
What I found in practice is that many people start using the ECS for speed, and then draw themselves into a corner of the design space. Now they have to weight every step on "how would it work in ECS?", and dedicate effort to fight the ECS paradigm.
For example, a mesh may contain multiple materials. Is each material chunk a separate entity? Or maybe each bone in a skeleton is a separate entity with its own "parent" and "transform" plus other component.
One of the different approaches is component graph systems [1]. It lacks the ability to mix and match components, but provides a more natural (and simpler) model to program for.
[1] https://github.com/kvark/froggy/wiki/Component-Graph-System
-
IIRC, all those engines provide an ECS that could be compared to entt.
Also, there is Hazel[0] which is based on entt and is the subject of an amazing youtube series[1].
IMHO, tinier means less features, at that point what could be considered comparable?
[0] - https://github.com/TheCherno/Hazel