NEOLearn

Scenes and reflection

Compose entities with bsn! scenes, save and load worlds as files, and inspect and change Rust values at runtime with reflection.

Updated October 20, 2026

On this page

A game rarely spawns entities one at a time. A level is walls, props and enemies; a button is a node with text inside. The engine gives you three related tools for working with groups of entities and their data:

ToolWhat it's forCrate
bsn! scenesDescribing an entity, its components and its children once in code, and spawning it wherever you need it, with field-level overrides.neo::scene
World assets and dynamic worldsEntities and resources as data: glTF scenes, .scn.ron files, and saving part of a running world to a file and loading it back.neo::world_serialization
ReflectionReading and changing Rust values by field name at runtime, and the type registry that makes serialization and dynamic worlds work.neo::reflect

All three are on in NEO's builds.

Pages in this section#

PageWhat it covers
Reflection#[derive(Reflect)], reading and setting fields by name, paths, dynamic types and patches.
The type registryAppTypeRegistry, automatic registration, type data such as ReflectComponent, and reflected traits.
SerializationTurning reflected values into RON or JSON and back, without serde derives.
Dynamic worlds and scene filesDynamicWorld, WorldAsset, .scn.ron files, spawning them and saving a world.
Scenes with bsn!The bsn! macro: composition, patching, children, named references, observers and asset paths.

Which one to use#

  • To build the same kind of object many times from code (an enemy, a UI panel), write a function that returns a bsn! scene.
  • To load a model or a level made in a tool, load its glTF scene or .scn.ron file as a world asset.
  • To save game state or an edited level, extract a DynamicWorld and serialize it.
  • To write tools that work with any component (inspectors, editors, scripting bridges), use reflection.

Next steps#