Skip to content
New issue

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

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

Already on GitHub? # to your account

Maximum number of components allowed? #58

Open
Aedalus opened this issue Mar 20, 2022 · 1 comment
Open

Maximum number of components allowed? #58

Aedalus opened this issue Mar 20, 2022 · 1 comment
Labels

Comments

@Aedalus
Copy link

Aedalus commented Mar 20, 2022

Really liking the library so far, but had one question. Looking at the implementation, it seems like every component gets an auto-incrementing ID, which is used to shift bits to create a component bit mask. Am I right in thinking that if a bigint max value is roughly 2^53, geotic allows for a maximum of 53 component types that can be registered? This still seems like a good amount for most projects, but wanted to see if there was a suggested workaround for adding more.

Thanks!

@ddmills
Copy link
Owner

ddmills commented Mar 20, 2022

Hi @Aedalus, I believe using BigInt has different bitwise limitations than int. I remember thinking about this during implementation, and I believe I tested it in chrome (this was some time ago).

Regardless, it might be smart to use a different library dedicated to bitwise operations, see #51

All bitwise operations are encapsulated in one file, which should make it easy to replace

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants