Creating a new archetype at runtime without predefined component

For a RTS. I want to group entities together. During gameplay, the player is able to select groups and group them together such that they form a formation together.

Since entities of a given archetype are grouped together, my idea was to add a new unique tag component to the entities in the group such that I could query for this unique group tag to iterate all the entities in this group.

Can this be done? Otherwise, how can I group my entities at runtime?

This is where ISharedComponentData steps to the scene - grouping and filtering by group.

2 Likes

Thanks