-
Notifications
You must be signed in to change notification settings - Fork 277
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
Document Entity/Component Usage for Fortress and beyond #805
Comments
I'm a bit worried by this change. If a component stores a big chunk of data (say, an image), being able to directly access the component's storage in r/w (i.e. for setting the value) could be relevant for performance. Is there any other way to prevent allocating a temporary object like what could happen when using The use case I have in mind is when the data type of the component differs from the data type of the caller. It's kind of related to #494. |
Good point, there may be use cases when the caller wants to modify the data without necessarily creating a new object. Like how you could now do:
We haven't been doing that a lot internally, but it is a good pattern for performance. For context, the reason we'd like to force users to go through |
Thanks for providing this piece of information, now it makes even more sense. I like a lot the idea of automatically updating the state of the component when calling |
Given the discussion above, I suggest we don't deprecate that, and instead document that
This is captured in #325
With the new view implementation in #856, removing components is not very costly. So we could use that. I'm reluctant to updating the components that are currently zeroed out though, because that will force downstream users to update their code when migrating. |
Sounds good to me 👍 are we currently expecting for users to call
Agreed 👍 once we merge #856, we can tell users that removing/re-adding components is okay. |
Tasks from #787:
|
As mentioned in #628, documentation for how to use the
EntityComponentManager
(and consequentially, how to use Entities/Components) is lacking. While #628 proposes a lot of good things to document, it's likely that some of the documentation will change starting in Fortress once #711 is addressed.At the time of this writing, the following items should be addressed (as more items come to mind, we can either add to this comment or create additional comments in this issue):
Component::operator=
so that users don't use this insteadThe text was updated successfully, but these errors were encountered: