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

Don't Serialize Meta-data componts in dynamic scene #6523

Open
PhaestusFox opened this issue Nov 9, 2022 · 0 comments
Open

Don't Serialize Meta-data componts in dynamic scene #6523

PhaestusFox opened this issue Nov 9, 2022 · 0 comments
Labels
A-Reflection Runtime information about types A-Scenes Serialized ECS data stored on the disk C-Performance A change motivated by improving speed, memory usage or compile times 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!

Comments

@PhaestusFox
Copy link

What problem does this solve or what need does it fill?

at the moment bevy dynamic scene are already bloated with having to Serialize the type name and value separately and as strings. so to cut down on some bloat and make the files more readable and editable it should not serialize purely computed structs such as GlobalTransform and ComputedVisibility the developers should not be manually setting the value for insertion anyway.

What solution would you like?

  1. remove reflect component from all meta-data type structs. e.g. GlobalTransform, ComputedVisibility
  2. move the insertion of the required meta-data struct onto the reflect components implementation. e.g. reflect inserting Transform should also insert GlobalTransform.
  3. expand reflect component macro to accept optional Depecnecy component tuple that will be inserted with default values when the reflect insert is used
#[derive(Default, Component, Reflect, Serialize, Deserialize)]
#[reflect(Component(GlobalTransform), Serialize, Deserialize)]
struct Transform{...};

What alternative(s) have you considered?

this would depend on if there is ever a situation you would want a transform but not a global transform.

  • expand derive Component macro to accept optional Depecnecy component tuple that will be inserted with default values whenever inserting the component like a bundle but always default
#[derive(Default, Component(GlobalTransform), Reflect, Serialize, Deserialize)]
#[reflect(Component, Serialize, Deserialize)]
struct Transform{...};
@PhaestusFox PhaestusFox added C-Feature A new feature, making something new possible S-Needs-Triage This issue needs to be labelled labels Nov 9, 2022
@alice-i-cecile alice-i-cecile added C-Performance A change motivated by improving speed, memory usage or compile times 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-Reflection Runtime information about types A-Scenes Serialized ECS data stored on the disk and removed C-Feature A new feature, making something new possible S-Needs-Triage This issue needs to be labelled labels Nov 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Reflection Runtime information about types A-Scenes Serialized ECS data stored on the disk C-Performance A change motivated by improving speed, memory usage or compile times 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

No branches or pull requests

2 participants