This feature is in an Experimental state so you can try it out, provide feedback, and see what we are planning. You cannot publish a project that uses Scene Graph at this time. Please keep in mind that we do not guarantee backward compatibility for assets created at the experimental stage, the APIs for these features are subject to change, and we may remove entire Experimental features or specific functionality at our discretion. Check out the list of known issues before you start working with the feature.
Scene Graph is a unified structure that connects all the objects in the world. Think of it as a toolbox that contains all the tools you require for set dressing, gameplay systems, audio, VFX, and much more to create experiences for the metaverse.
With Scene Graph, you can quickly transition from greyboxing and world building to a complete playable level in a few simple steps.
Building with Scene Graph means you can perform operations on related objects in your project. You can also use Scene Graph to duplicate and iterate on structures as you create them. You can even turn the objects you create into reusable prefabs, and use them across different projects.
Scene Graph is a Verse native system that takes advantage of Verse’s characteristics. This provides a way for you to add more customization to your projects with interactive, custom-built objects, and gameplay experiences.
Scene Graph improves project stability because Verse does all the heavy lifting in the background, ensuring entities work as intended. Verse also has deep access to all parts of the scene entities and components, which means you can add greater variety to your scene.
Objects in the Metaverse
The metaverse is an online social entertainment experience in real time, where people play and connect in a 3D world. Epic Games is designing the Scene Graph system for UEFN to empower you to create these metaverse experiences.
In the Scene Graph system, you can instance and reuse objects without Unreal Engine’s Actor classification. At the core of Scene Graph is a set of building blocks that use data and logic to build your game, as well as render and simulate objects in any gaming environment.
Actors and entities are not interchangeable, they are different systems that work together in the scene.
With Scene Graph, you can establish a 3D real-time simulation framework where all design decisions and results are instantly visible in the viewport. These can be edited in the Details panel or the Prefab Editor.
You can import assets that you create or buy from a vendor, like Fab, and use them with Scene Graph to make custom built objects and prefabs.
Anything you build in Scene Graph can be reused many times over, and with less memory. The Scene Graph building system is designed to enable complex content sharing and shared simulations while enforcing boundaries between content.
Entities and Components
Entities and components are the backbone of Scene Graph. They work by controlling the definition and behavior of objects.
Entities are containers for components or other entities. An empty entity will have no visible effects or functionality. Components are what provide data and behavior to an entity. The combination of components added to an entity define what that entity is doing in the scene.
An entity can contain any number of different components. However, only one component of a specific component type can be added to an entity at a time. For example, only one type of light_component can be used on an entity. To use multiple components of a common type you can create new entities to hold each instance of the component.
Some component types are generated by assets created in UEFN. An asset-generated component is a component class that is automatically created based on preexisting content in your project, such as a mesh, sound, or particle system asset. These assets may also expose properties that you can modify on the generated component.
Components have editable properties. These properties can be physical, like a static mesh and particle system, or logical like a gameplay tag or custom Verse code, which defines the movement of a platform. By default, all entities have a Transform Component to specify where the entity exists in the world.
Constructing an entity with Verse does not create a Transform Component automatically.
With Scene Graph, you can quickly put together set pieces and game mechanics by harnessing the physical data from meshes, sound cues, and much more.
An entity becomes the physical representation of a static mesh when you add a Mesh Component to the entity and a mesh is selected in the component’s Mesh slot. This means that you can quickly mock up buildings or individual set pieces and use them right away in your scene.
For example, in the video below, an entity is turned into a cluster of bamboo trees and a sound component is added to the entity by dragging a sound cue into the Sound Component slot.
You can turn this cluster of bamboo into a prefab on its own or combine it with additional entities to create a forest prefab.
One entity (the simulation entity) sits at the root of your project to represent the simulation. The scene is created when entities are nested under the simulation entity. By adding entities to the map, you are automatically making child entities of the simulation entity.
The top entity of a prefab is the root entity of the prefab with other prefabs and entities nested below. Parent prefabs comprise the look and behavior of their children to interact with other objects in the scene.
-
Prefab Root Entity → WoodenHouse_Tiny_Prefab
-
Child Prefab → WoodenHouse_RoofSmall_Prefab_C_1
-
Child Entity → Building_WIndowCircle_Bright2
-
Child Entity → Building_WIndowCircle_Bright4
-
Child Entity → Building_WIndowCircle_Dark2
-
Child Entity → Building_WIndowCircle_Dark4
-
Child Entity → WoodenHouse_Floor
-
Child Entity → WoodenHouse_RoofCap2
-
Child Entity → WoodenHouse_RoofCap3
-
Child Entity → WoodenHouse_RoofWindow2
-
-
Child Prefab → WoodenHouse_SmallFloor_Prefab_C_1
-
Child Entity → WoodenHouse_Floor
-
Child Entity → WoodenHouse_Wall10
-
Child Entity → WoodenHouse_WallDoor_C4
-
-
Child Prefab → WoodenHouse_Windows_Prefab_C_3
-
Child Entity → Building_WindowPlane_Bright3
-
Child Entity → Building_WindowPlane_Bright4
-
Child Entity → Building_WindowPlane_Dark3
-
Child Entity → Building_WindowPlane_Dark4
-
Child Entity → WoodenHouse_Windoows_10
-
-
Each child prefab features components that determine what the prefab looks like and how it aligns with other prefabs in the scene. You can use Verse to target specific prefabs and entities to exchange the child prefab for another prefab, or even change the color used for the Building_WindowPlane_Bright and Building_WindowPlane_Dark entities.
There are numerous component types that determine how a part or whole entity acts. To learn more about the different component types available in Scene Graph, refer to Components.
For more information about using entities and components, refer to Working with Entities and Components.
Prefabs
Scene Graph creates prefabs by packaging entities together in an ancestor and descendent relationship. An ancestor is any entity level above other entities, such as parent, grandparent, great-grandparent, and so on. A descendent is an entity level below that of child, grandchild, and so on.
All selected entities, entity hierarchies, and their components are instantly added into this entity tree in the prefab. Once you have a prefab, you can customize all instances of that prefab in the Prefab Editor.
To create an instance of your prefab, drag the prefab out of the Content Browser and into the viewport. You can also nest prefabs inside a prefab hierarchy. You can use the hierarchy to apply the changes made across all instances and prefabs in the hierarchy.
As you update and improve the prefab, you save time because you don’t need to find all instances of that object to update each one individually.
Additionally, you can make a multitude of similar-looking objects by selecting sub-pieces in the hierarchy and overriding different component values. You can also rotate objects and add new component values to different prefab instances as you edit in the Prefab Editor.
The editor marks all changes in the Details panel with an override toggle icon on individual component attributes. It also marks different component icons on the component card dropdown menu button.
To go back to the original prefab design, click on the individual component override toggles. The object automatically returns to the state of the parent Prefab. You can also click the component card dropdown menu button and select Clear Override.
To learn more about modifying prefabs, refer to Prefabs and Prefab Instances.
In the video below, Scene Graph is used to create two small house prefabs.
The house is duplicated. Different elements of the house are changed by selecting different meshes to replace parts of the original, which creates a new prefab. You can continue to copy and replace parts to quickly mock up a small village. This even works with components, so you can add different behavior to each of the houses in the village.
Editing prefabs doesn’t affect the stability and memory of the original object or its copies. This means that you can finish your level layout, abstract design, and art to create custom objects for your island. With the Scene Graph building system, you can reuse the prefabs you create across projects to create your own game universe in Fortnite.
Verse in Scene Graph
Verse is the programming language that Scene Graph uses to spawn and remove entities from the world and create custom components and behaviors.
With Verse, you can create a swinging outdoor lantern for the house in the previous example. Verse provides a way for you to define the properties for swinging, rotation, and duration to determine how the lantern moves.
Prefabs that you create in your project are exposed as a class to Verse in the Assets.digest.verse file of your project. Entities and components defined in your prefab are accessible in Verse through the GetEntities()
and GetComponents()
calls on a prefab.
To get started using Verse in Scene Graph, check out Creating Your Own Component in Verse.
Enabling Scene Graph in Your Project
To use Scene Graph in your project:
-
In the Toolbar, choose Project > Project Settings to open the Project Settings window.
-
In the Project Settings window under Experimental Access, enable Scene Graph System.
- To verify that you can view Scene Graph features, in the Toolbar select Place Actors and see Entities in the Place Actors dropdown.
Get Started
Open the Prefab Template to learn more about Scene Graph. The template introduces you to the basic concepts of working with Scene Graph features, and builds upon these foundational workflows to illustrate the power of creating your project using prefabs and Verse.
Known Issues
The following are known issues when working with Scene Graph in your project. If you have any feedback or find issues that are not captured in the list below, report them in the forums.
-
As an Experimental feature, you may encounter unexpected crashes and instability.
-
You cannot use Grid, Rotation, or Scale snapping in the Prefab Editor.
-
You cannot multiselect in the Prefab Editor.
-
You cannot copy-paste or alt-drag duplication in the Prefab Editor.
-
You cannot copy and paste components.
-
You cannot clear all overrides from a Prefab instance at once. You must do it on each override.
-
Entities do not use the one file per actor system, instead entities are saved in the UMAP asset. If you use URC with your project, you will consistently lock the main level and disable the ability to collaborate on your project.
-
There is no way to save overridden Prefab instances to the Prefab asset.
-
Duplicated entities are not named correctly in the Prefab Editor.
-
Expand All and Collapse All do not work on components.
-
There is currently no way to remove overrides from a Prefab.
-
Right clicking the override icon should do the same as a left click.
-
Cannot detach a child entity by dragging it onto its parent.
-
Scrubbing the Static Mesh Component Rotation along the Y axis causes unexpected movement.
-
There is unexpected player behavior when colliding with scene graph objects.
-
Once an entity has been manually renamed, the entity name cannot be changed.
-
Negative Scaling can cause abnormal interactions in child entities when rotated.
-
Dragging Transform values in the Prefab Editor is slower and less performant than changing the values from the widget.
-
The Create Verse Component window does not display Templates in Editor Options.
-
Entities in the Prefab Editor are not always selectable.
-
Deleting a prefab creates a "ghost" prefab in Live Edit sessions.
-
Prefab assets do not have thumbnails.
-
Component logic runs in both edit and play mode.
-
Components are initialized much earlier than creative devices, which means that trying to fetch a creative device from
component.OnBeginSimulation
orcomponent.OnSimulate
will not work. To work around this you can loop and sleep until the components are found or can spawn your prefabs from a creative device's OnBegin call. -
The ability to hide selected entities in the level editor (hotkey H) and Prefab Editor is not working.
-
Changes made in the Prefab Editor will not propagate to placed instances of the prefab unless you save your changes.
-
Saving the project while Verse code is not compiling can result in corrupted prefab data.
-
Running Verse Asset digest generation for the first time can be slow.
-
When you copy and paste or duplicate a prefab in the Level Editor, descendent prefabs and descendent entities that belong to the base prefab asset will be incorrectly marked as fully overridden.
-
Mesh, sound, and particle effect components are only generated in Verse for assets you import into your project or create in your project, plus a small selection of built-in mesh shapes. You can’t use Fortnite or FAB assets with Scene Graph by default. As a workaround, you can export Fortnite assets and re-import them into your project.
-
When you import a new mesh or sound into your project, or you create a new particle system asset, you must build Verse code for your project to generate a component class for that asset before you can use it with the Scene Graph system.
-
As you add and change parameters in the Material or Niagara editors, you will need to build Verse code for those changes to be exposed to the level editor.
-
If you move, rename, or delete meshes, sounds, or particle system assets in the editor, it is possible to lose references to the generated component instances in the level editor as the classes that are generated currently cannot utilize redirectors.