How to make a "Godot Scene" ?

I’m trying to have some blueprint (or c++ class, whatever works) to spawn several actors together. Logic, meshes, materials, … all together.
From an high level point of view, I’d like to create multiple rooms with their furniture, doors, buttons, … and be able to spawn them at will following some game logic.
If it was Godot, it would be as simple as creating one scene and instantiating it using its path.
In the Unreal Engine I have no idea how to proceed.

Has someone an idea/hint about how to do it?

Thank you.

this would be done with blueprints of Actor.

because of the multi platform nature of Unreal, and the pre-Compiled nature of C++ it is strongly advised not using RunTime-Resolved-Hard-References, because if someone changes the name or location of one of those assets then the best case scenario is a crash, or an error message (because garbage/no-change is harder to track down)

in Unreal consider that each thing that is spawned into a level is 80% of the time going to be either an Actor or an ActorComponent (technically the Actor is also spawned as a USceneComponent derived from UActorComponent but that is mostly so that we can attach actors to other Actors by treating them as USceneComponents)

so you would create a Blueprint of the pieces that make up your “room”, and include all the pieces as granular as they “need to be” (Unreal has a practical extreme of ~1000 actors after which you could run into memory bottlenecks and potential paging as well as higher memory requirements for you finished application)

then I would suggest some kind of manager/repository class that would hold pointers/references to these blueprints so that you can spawn them, maybe in a Map so that they can be found by a key (probably some semi-unique name)

  • an alternative implementation would be a DataTable but this would require implementing a UDataTableRow struct in C++ to fully utilize, this would definitely require a unique name for each row index.

then you would call this Manager/Repository to SawnActor() to create your room, and put it into place. you could also have the Manager/Repository have the locations rooms can reside at, or the space to be filled if you want to go “Space Filling Algorithms” to populate your rooms

everything besides DataTable can be done in Blueprints for prototyping, and then moved to C++ to optimize/customize

1 Like

Technically, you can do what you want by instantiating a scene (map) inside another map.
However, in practice, what you want is probably an Actor blueprint, and then add the bits and pieces you need to that, either as components, or as attached child actors.
(In general, I find that I prefer the component workflow, but your mileage may vary)

1 Like

Might want to look into the docs on level instancing and packed level actors.

Here’s a vid showing off the basics of how to do it:

Basically, level instances work kinda like prefabs in other engines. I’ve never used godot,but the scene instancing sounds similar.

1 Like

Thank you, it’s very helpful.

Thank you. I’ll look into that.

Thank you. I’ve watched the video and it looks exactly like what I’m trying to do.