2 ms·
IMHO most games should use both. Think of the game as a 2D table, with Entities on one axis and their Components/Systems aligned on the other axis. Some operati
by pphysch 4y ago
IMHO most games should use both. Think of the game as a 2D table, with Entities on one axis and their Components/Systems aligned on the other axis. Some operations go (densely) along the Component axis, like updating your physics simulation every frame. But many operations go (sparsely) along the orthogonal Entity axis, resolving events and other game rules involving many tiny sets of entities. These are orthogonal operations with different optimizations and I don't think there is one architecture to rule them all. However, I think an ECS like Flecs or EnTT is a good core to build off of.
- indigoabstract 4y agoAgreed. Especially the ability to split an object into multiple components/traits and have an operation run automatically for every component type appeals to me. It just seems elegant and 'good design', similar to 'composition over inheritance'. I think the strength of the scene graph is in the explicit parent-child relationship, where it applies, but I probably need a deeper understanding than I now have to mesh them in the right way.