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

Change Detection for (Entity, Trait) Pairs #17

Open
Ctrlmonster opened this issue Nov 4, 2024 · 0 comments
Open

Change Detection for (Entity, Trait) Pairs #17

Ctrlmonster opened this issue Nov 4, 2024 · 0 comments

Comments

@Ctrlmonster
Copy link
Collaborator

Continuing from #16:

Motivation for (Entity, Trait) Pairs is that the user can easily affect performance in a bad way should they add a change event to a trait that exists on many entities. E.g. let's say I have GUI component that reacts to changes in position on the player. Now I'm suddenly tracking changes on all entities with position even though I'm only interested in a single instance.

Also in my experience I'm seldom interested in changes on all instances of a trait. The Changed query modifier is the only case I can think of, but I haven't used it in practice either. Far more often I'm reacting to changes on a single entity (GUI being the most prominent).
That's a usecase a large percentage of applications has, that's why I think it's important we make sure it doesn't affect performance more than it needs to.

Challenges:
The imperative api's would need to be extended to support single entities to be passed. Tracking all traits should still be possible as that's important for the Changed modifier.

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

No branches or pull requests

1 participant