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

Add Clone, PartialEq, Ser/De traits to Parent/Children #11987

Conversation

cBournhonesque
Copy link
Contributor

Objective

  • Add missing traits to hierarchy components Parent and Children, which could be useful (it would be useful for me)

@alice-i-cecile alice-i-cecile added C-Usability A targeted quality-of-life change that makes Bevy easier to use D-Complex Quite challenging from either a design or technical perspective. Ask for help! A-Hierarchy Parent-child entity hierarchies labels Feb 20, 2024
@alice-i-cecile
Copy link
Member

All of these other than PartialEq and Serialize could be abused to break the hierarchy. Not saying we shouldn't do this, but just pointing it out.

Copy link
Member

@james7132 james7132 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the reasons listed above, I'm not too keen on deriving these. Serialize/Deserialize is definitely a maybe if this is being driven by an usability need like network serialization, but I've always been a bit skeptical those kinds of use cases for Entity as well. However, Clone is definitely not OK given the possibility of breaking the hierarchy.

@cBournhonesque
Copy link
Contributor Author

For the reasons listed above, I'm not too keen on deriving these. Serialize/Deserialize is definitely a maybe if this is being driven by an usability need like network serialization, but I've always been a bit skeptical those kinds of use cases for Entity as well. However, Clone is definitely not OK given the possibility of breaking the hierarchy.

Yes exactly, the main use-case is network serialization; I guess I'll resort to making an internal wrapper component for network serialization then, similarly to what replicon does (https://github.com/projectharmonia/bevy_replicon/blob/master/src/parent_sync.rs#L80).

My hope was to avoid this by replicating Parent and Children directly, but maybe that's not even desirable (as replicating both Parent and Children would duplicate the information transmitted over the wire)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Hierarchy Parent-child entity hierarchies C-Usability A targeted quality-of-life change that makes Bevy easier to use D-Complex Quite challenging from either a design or technical perspective. Ask for help!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants