Scene Management
Overview
The Scene system provides JSON-based serialization for saving/loading entire scenes, and snapshot/restore for play mode support in the editor.
Working with Scenes in the Editor
File Menu
Play Mode
When you press Play, the editor takes a snapshot of the current scene state. All changes made during play mode (physics, scripts, etc.) are temporary. When you press Stop, the scene is restored to its pre-play state.
Scene File Format
Scenes are stored as .scene JSON files:
Serialized Components
- Transform (position, rotation, scale)
- PointLight (color, intensity)
- Camera (fov, near/far, projection type, isMain)
- ModelRenderer (model asset path)
Integration Notes
- Default serializers are registered automatically by the Engine constructor
- The Scene system filters out internal Flecs entities (systems, observers, modules)
- Scene file uses nlohmann/json for serialization
- Play mode uses in-memory JSON strings for fast snapshot/restore