Improve scene serialized format
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 171
Description
## What problem does this solve or what need does it fill?
The scene serialization (`.scn.ron`) is very verbose.
## What solution would you like?
- Mark a few types as `#[serde(transparent)]`: _e.g._ `InheritedVisibility` which currently serializes as `(true)` but the parentheses are useless.
- Don't serialize known defaults: it's highly unlikely we'll ever change the default of `Transform`, and currently in RON that takes 13 lines.
- Don't serialize computed types: things like `GlobalTransform` are overwritten at runtime, there's no value in serializing them, it's not user data.
- Shorten type names: it's very likely there's more than 1 `Transform` per file for example, so if we really need the fully qualified type name, add a table in the file mapping short <-> full names, and use the short name everywhere else. This would save a lot of verbosity, and would make the file more readable (it's very unlikely someone will have a component with the same name as a Bevy one, and if they do we can still handle this with a different short name in the mapping table).
## What alternative(s) have you considered?
Live with it. Not sure there's much I can do as a third party without a Bevy fix.
## Additional context
Currently an empty scene with a single entity with a UI rectangle with almost all default values (so not even a useful one) serializes at 150 lines.
Contributor guide
Research direction
Start by tracing Bevy's scene serialization for the .scn.ron format; the issue does not name an entry point, file, or test. Compare the current 150-line default-heavy output with the requested handling for transparent wrappers, defaults, computed types, and shortened names. Done means a less verbose format that preserves required scene data and remains readable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- game-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100