DynamicScene fails to load after renaming a component field — old scene deserialization error in bevy_scene
0 reputation · 17 Jul 2022, 17:31 UTC
Scene deserialization failure after schema change
I'm using Bevy's DynamicScene (bevy_scene) to persist levels, and I'm hitting the fragility around schema changes. When a Rust component struct changes — say a field is renamed — old scene files no longer load.
My understanding is that the RON-based scene format resolves types and fields strictly: if a saved scene references a type or field that no longer matches the registered schema, deserialization errors out at load time rather than skipping the mismatch. That makes shipping updates risky, since any refactor of a reflected component can break existing saves.
I'm trying to decide between a tolerant loader and a strict one. I know #[reflect(default)] can supply defaults for newly added fields, but that doesn't seem to help when old data contains fields the struct no longer has.
Is there a documented way to make the scene loader tolerate missing or unknown fields, or is the intended pattern to wrap saves in a versioned envelope with dedicated serde structs and convert to components at load time? And if I keep DynamicScene, what is the recommended approach to migrate or reject old data deterministically — should I implement my own versioning layer on top of the scene format?