You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Non-movable components, that when inserted goes into the sparse set storage. The sparse component itself does not need to be moved to the destination archetype during insertion.
Benefits
Doesn't need to move the sparse component itself so slightly faster removals and insertions
Fast iteration of single sparse components since it should just iterate over the densely packed pool/column
Drawbacks
Explicit storage specification
Queries of sparse components are always slower than archetype queries except for two scenarios:
if the query is just interested in a single sparse component (just iterate the dense array of the sparse set)
if fragmentation is very high (like 1-2 entities per archetype, and lots of archetypes)
The text was updated successfully, but these errors were encountered:
After a lot of deliberation, I think that keeping a sparse container such as HashMap<Entity, T> besides the ECS has been the best opt-in "sparse components". The pros of this is that it has the fastest possible O(1) add/remove because it doesn't require copying movable component values in the old archetype and doesn't require the introduction to new constructs or concepts. The biggest downside here is that it doesn't integrate into the ECS so you can't query with them. This doesn't feel too bad though since you wouldn't want to be iterating sparse components in the first place because that would be a naive linear iteration.
Non-movable components, that when inserted goes into the sparse set storage. The sparse component itself does not need to be moved to the destination archetype during insertion.
Benefits
Drawbacks
The text was updated successfully, but these errors were encountered: