How to best deal with modular architecture and rigid entity descriptors? #87
-
We are planning for an extensible architecture where it should be possible to add features quite dynamically and we are struggling with the concept that the shape of an entity has to be known upfront. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Using var groups = entitiesDB.FindGroups<SomeComponent>();
foreach(var ((componentsNB, count), group) in entitiesDB.QueryEntities<SomeComponent>(groups))
{
// your logic
} It's also worth noting that entity operations are able to be enqueued using the base descriptor, as the framework will find the actual set of components used by the entity you enqueue. While it may not be advisable, there is also the |
Beta Was this translation helpful? Give feedback.
Using
ExtendibleEntityDescriptor
is likely the best way to handle this rather than having all components on all entities, as it allows you to group common sets of components easily. Though I would still separate unique descriptors into separate groups (so their components align), your engines would be able to still operate on common sets of components by using the following syntax which would allow you to keep common behaviour generic and avoid the composite group permutations you decribed.It's also worth noting that entit…