Could we let scene as an asset?

Continuing the discussion from Copy paste from scene to scene?:

scene management and entity reuse are always challenging problems

compare Unity Prefab, Unreal Blueprint, Stingray Entity.

Unity group gameobjects by hierarchy, user can build prefab from any node. If a new prefab contains another prefab as a sub tree, sub tree will break link with it’s original prefab.

Unreal group actors ( gameobjects ) by folders, actors are leaf nodes in outliner. unreal not only using decorator pattern, but using Inheritance. User can inheritance an actor and add some new component on it. Child actor cannot remove inherited components.

Stingray group entities and units by layers, can not link units in editor (can do it by lua script). Currently stingray cannot create entity. Unit need to build form a mesh, all unit behaviors need to driven by code or unit flow graph.

Unity can add component and script to any gameobjets you want. Unreal only allow to attach scripts on actor root, and Stingray too.

Unity don’t have a root script entry point in a scene, both Unreal ( GameModeScript ) and Stingray ( lua Appkit ) have.

Unity can make quick prototype, but will get lost in complex scene
Unreal can handle large projects, but hard to start up

may be Playcanvas can have all good side:

I find Playcanvas scene have a interesting object called root and have full entity function. Is this means a scene, could be looked as an actor in Unreal ? – except no root motion etc…

And, in a scene, the operate logic are nearly the same as Unity. – even better because root node and (may be) depth first hierarchy update

Why not let the scene as an asset ? When Instance a scene A in scene B, Keep the scene A as a whole !

let scene management panel go, just publish primary ( intro ) scene.

Maybe Playcanvas not born to support the scene as an asset. But large level need the similar feature too, for example some game level need Unreal World Composition to handle or rely on Unity’s latest feature UnloadScene().


After peeking some playcanvas engine source code, looks like i am thinking too much … Space Buggy Project use main script done game scenes management job very well. The downside is just not very straight in editor

Hi @fxcarl.
Thanks a lot for this write up.

We were thinking about this challenge for some time already, how to approach it, and how to solve it.
You went through other engines already, and in each of them their implementation has a reasoning under it. For example in Unity there is multi-scene workflow, which initially was the only way to have different camera to render different world (scene). So people used one scene for main game, and another for rendering UI for example. Then they had to implement more features around working with multi-scenes, where it was initially not the best experience, and now seems like got better though.

We do have multi-scenes workflow, but that was very early decisions in PlayCanvas. I personally never used multi-scene approach in any apps I’ve made. There are negatives with using them, and for cases multi-scenes are currently used are better solved with other approach (imho). Assets are shared between scenes and it is important to remember that “preload” is project-wide setting on asset, not scene-specific. Meaning that you cannot load other scene with preloaded only relevant assets of that scene. You can disable preloading, and use tags and implement own loading bar to handle different scene loading with only relevant assets - but that is a bit of overhead for a developer.

On the subject of hierarchy re-usability, lets call it “Prefabs”. Yes we are aware of lack of such thing. It is not an easy thing to solve well, and it should be challenged a lot to get good solution, that is easy to understand, easy to use and is flexible for developers at the same time.
Currently people simply create one node in hierarchy with some “prefab” entities, and then in runtime clone them. Which essentially is same thing. Of course missing many features, such as setting up clones in editor, be able to bulk-edit entities by inheriting prefabs state, be able to override any stuff within instances of prefabs, etc.
And more important - be able to transfer prefabs. This is one big challenge: ability to download/upload them, or move prefabs with all related assets between different projects. All assets have unique ID, means all references needs to be updated, and it should be very transparent to the developer.

So we are thinking about this, and it is on our roadmap, although it is not something we are looking to implement in very soon.

Yeah I don’t miss prefabs so much - disabled entities have been fine - apart from the total inability to move anything from one project to another… (Like we’ve discussed elsewhere!) That is a really big limitation. Anything that worked like the Library would be great. I am just thinking of the hours of work it’s going to take copying stuff from one project to another right now…

I’m wondering if there is a way to do this in the exported project?

Single hierarchy workflow … hum, I agree it’s a great idea. I like it :smiley: but need some time to get use to it.

I am trying to transplant some racing game assets to playcanvas, I can’t imagine how crazy if a track designer enabled two race circuits same time by a editor operate mistake … may be still not the time for some heavier web app

looking forward the Editor’s feature around how to reusing hierarchy and new API’s around how to dynamic load / unload hierarchy :joy: