Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QUESTION: Is it possible to work with entities with more than 6 components? #74

Closed
langurmonkey opened this issue May 2, 2022 · 2 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@langurmonkey
Copy link

Right now, the Dominion.findEntitiesWith() method accepts up to 6 component types. The returned Results object maps the types for each component by position and allows for their retrieval. Is there a mechanism in place to enable finding and working with entities with more than 6 components? Is this something that will come at a later stage?

@enricostara
Copy link
Contributor

Hi Langur,
the short answer is yes.

The long answer is yes, but you will still unpack max 6 components, as I plan to add the new method on the Results and it will accept more components type without any limit.
In this way, you will be able to refine your entity search with any number of component types but you will still get unpacked max 6 components.

Why?

  • Getting even more components means lower performance (cache line size is limited)
  • Having a single system that needs to unpack so many components is a clear sign that it is taking on too many responsibilities.

The updated Results API maybe:

(new) -> andWith
excludeWith -> andWithout
withState -> andWithState

@langurmonkey
Copy link
Author

Awesome, cheers!

@enricostara enricostara added enhancement New feature or request documentation Improvements or additions to documentation question Further information is requested and removed documentation Improvements or additions to documentation labels Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants