Skip to content

Reframe old "scene" terminology as "world serialization"#23630

Open
cart wants to merge 3 commits intobevyengine:mainfrom
cart:scene_rename
Open

Reframe old "scene" terminology as "world serialization"#23630
cart wants to merge 3 commits intobevyengine:mainfrom
cart:scene_rename

Conversation

@cart
Copy link
Copy Markdown
Member

@cart cart commented Apr 3, 2026

Part 2 of #23619

In Bevy 0.19 we are landing a subset of Bevy's Next Generation Scene system (often known as BSN), which now lives in the bevy_scene / bevy::scene crate. However the old bevy_scene system still needs to stick around for a bit longer, as it provides some features that Bevy's Next Generation Scene system doesn't (yet!):

  1. It is not yet possible to write a World to BSN, so the old system is still necessary for "round trip World serialization".
  2. The GLTF scene loader has not yet been ported to BSN, so the old system is still necessary to spawn GLTF scenes in Bevy.

For this reason, we have renamed the old bevy_scene crate to bevy_world_serialization. If you were referencing bevy_scene::* or bevy::scene::* types, rename those paths to bevy_world_serialization::* and bevy::world_serialization::* respectively.

Additionally, to avoid confusion / conflicts with the new scene system, all "scene" terminology / types have been reframed as "world serialization":

  • Scene -> WorldAsset (as this was always just a World wrapper)
  • SceneRoot -> WorldAssetRoot
  • DynamicScene -> DynamicWorld
    • DynamicScene::from_scene -> DynamicWorld::from_world_asset
  • DynamicSceneBuilder -> DynamicWorldBuilder
  • DynamicSceneRoot -> DynamicWorldRoot
  • SceneInstanceReady -> WorldInstanceReady
  • SceneLoader -> WorldAssetLoader
  • ScenePlugin -> WorldSerializationPlugin
  • SceneRootTemplate -> WorldAssetRootTemplate
  • SceneSpawner -> WorldInstanceSpawner
  • SceneFilter -> WorldFilter
  • SceneLoaderError -> WorldAssetLoaderError
  • SceneSpawnError -> WorldInstanceSpawnError

Note that I went with bevy_world_serialization over bevy_ecs_serialization, as that is what all of the internal features described themselves as. I think it is both more specific and does a better job of making itself decoupled from bevy_ecs proper.

@cart cart added this to the 0.19 milestone Apr 3, 2026
@cart cart added the A-Scenes Composing and serializing ECS objects label Apr 3, 2026
@alice-i-cecile alice-i-cecile added X-Blessed Has a large architectural impact or tradeoffs, but the design has been endorsed by decision makers C-Usability A targeted quality-of-life change that makes Bevy easier to use D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Apr 3, 2026
@alice-i-cecile
Copy link
Copy Markdown
Member

I like these names a lot: I think the framing is a lot clearer, and it should help users both differentiate it from bevy_scene and figure out useful ways to use these types.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 3, 2026

You added a new feature but didn't update the readme. Please run cargo run -p build-templated-pages -- update features to update it, and commit the file change.

Copy link
Copy Markdown
Contributor

@urben1680 urben1680 left a comment

Choose a reason for hiding this comment

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

I never worked with scenes and did not attempt to learn them and the logic in the code with this review. I basically just made my browser mark the word "scene" so I notice when there are mentions outside of changed lines. Because of that I obviously only noticed nearby code needing adjustments.

Two things generally:

  1. Are the changes too many to do a deprecation cycle where old names are available for 0.19?
  2. There are soo many things still named with "scene" in the gltf part that I think this is intentional because a bns port is planned this cycle?

Comment on lines +14 to +16
///
/// Note: This was recently renamed from `WorldAssetRoot`, in the interest of giving "scene" terminology to
/// Bevy's next generation scene system, available in `bevy_scene`.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can't wait to read this in 5 years. 😄 How are things usually tracked that should be removed later on? a //todo comment, an issue?

let registry = world.resource::<AppTypeRegistry>().clone();
self.write_to_world_with(world, entity_map, &registry.read())
}

// TODO: move to AssetSaver when it is implemented
/// Serialize this dynamic scene into the official Bevy scene format (`.scn` / `.scn.ron`).
Copy link
Copy Markdown
Contributor

@urben1680 urben1680 Apr 3, 2026

Choose a reason for hiding this comment

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

it was all a lie, so much about this being the "official bevy scene format"!

@@ -37,15 +37,15 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
// Spawn the scene as a child of this entity at the given transform
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This and many other comments in examples (including their filenames) still speak of "scenes", is this intentional?

@@ -203,9 +203,9 @@ pub struct AnimationSystems;
#[derive(Debug, Hash, PartialEq, Eq, Clone, SystemSet)]
pub enum SceneSpawnerSystems {
Copy link
Copy Markdown
Contributor

@urben1680 urben1680 Apr 3, 2026

Choose a reason for hiding this comment

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

The enum name might have to be renamed too.

/// through reflection. If the `world` is the "real" world (e.g., not a world in a
/// [`Scene`](crate::Scene)), the `world` will contain the registry, which can be acquired using
/// [`WorldAsset`](crate::WorldAsset)), the `world` will contain the registry, which can be acquired using
/// `world.resource::<AppTypeRegistry>().read()`. For extracting from "scene worlds", you
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

"scene worlds" should be "worlds from serialization"? "serialized worlds"?

// update them to the entities in the world.
// If this component references entities in the source world,
// update them to the entities in the destination world.
SceneEntityMapper::world_scope(entity_map, world, |world, mapper| {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should SceneEntityMapper also be renamed?

Comment on lines 60 to 72
@@ -71,7 +71,7 @@ impl InstanceId {
/// - [`despawn_queued_scenes`](Self::despawn_queued_scenes)
/// - [`despawn_queued_instances`](Self::despawn_queued_instances)
Copy link
Copy Markdown
Contributor

@urben1680 urben1680 Apr 3, 2026

Choose a reason for hiding this comment

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

Quite some things still called scenes here.
EDIT: Note I marked L60-72, the two lines shown here coincidentally are okay.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I found a handful of other unchanged "scene" vocabulary in this file, you might want to ctrl+f them.

));
}

fn spawn_scene(
Copy link
Copy Markdown
Contributor

@urben1680 urben1680 Apr 3, 2026

Choose a reason for hiding this comment

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

This and some other things in this test are named with "scene".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Scenes Composing and serializing ECS objects C-Usability A targeted quality-of-life change that makes Bevy easier to use D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes S-Needs-Review Needs reviewer attention (from anyone!) to move forward X-Blessed Has a large architectural impact or tradeoffs, but the design has been endorsed by decision makers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants