Nested Scenes instead of Nested Prefabs

While I think the nested prefabs are a great step forward from what Unity is currently offering they seem to still be one step behind, overly complicated, and not solve problems that still exist. A nested scene system, where the nested scenes have over-ridable fields makes a lot more sense.

I’ve been using Godot on the side for a few years now and have been able to do everything the nested prefab system does, but without the clutter. I work at a medium sized company right now where it’s quite difficult to work on large scenes without stepping on each other’s toes.

Solution (before nested prefabs 2018.2): Break the project into multiple scenes. (IE. Terrain, vegetation, props, gameplay, etc)
New Problem: Now, how do we set up an environment and do lightmap baking without making our project overly complicated?

Nested prefabs will be an okay solution to this, but only if each of these scene layers (which can be quite large) is now a prefab, which contains its nested prefabs.

In other words, we’ll be placing each of our entire scene layers into a prefab. So at that point, why not just have a nested scene system (like Godot Engine has) at this point? It is much simpler to comprehend and gets the exact same job done as nested prefabs, but without the project clutter (and mental clutter).

==== Conclusion ====

So, in Godot I have to learn one thing… scenes. In Unity I have to learn scenes, prefabs, and each of their modes in order to get the same job done as what I get learning one concept in Godot.

Sorry if this is a bucket of cold water onto nested prefabs, but they really feel like a step backward from what an Godot engine is offering. I know this won’t change that nested prefabs are coming, and I am truly grateful that they’ll be better than regular prefabs, but this might be some consideration for the future :slight_smile:

Thanks :slight_smile:

3 Likes

IIRC they are working on something called Scene Fragments. Not sure when we can get this feature.

1 Like

First I’ve heard of scene fragments. I’m using multi scene a fair bit now, and wondering what that would be.

Yep, me too. Google search didn’t yield any results :sweat_smile: Where comes this information from?

No idea, though I imagine someone somewhere at a Unity workplace is wondering just who is working on Scene Fragments… maybe

I think they are working on some magic button called Make Multiplayer. Not sure when we can get this feature either.

2 Likes

You can do that in Unity already. Simply write your own scene management solution.

It’s that simple. It’s possible split & load scenes based on chunks that way.
Actually, I’ve got a solution running in less than 2k lines of code, including custom editor.

Multi-scene setup offers basically what you’ve described. It’s all about the management.

That would be really nice if they did something like that :slight_smile:

1 Like

Witness the power of my google-fu!

3768040--314584--upload_2018-10-9_22-15-41.png

https://www.youtube.com/watch?v=vj1bUfSVBnY

(likely related boilerplate) https://blogs.unity3d.com/2018/10/08/optimizing-loading-performance-understanding-the-async-upload-pipeline/

5 Likes

So lets have 'em then Unity. Open world game here waiting.

You must have a black belt in google-fu sir and I respect it. Saying that this would be a very welcomed feature and I can’t wait to see where it goes.

Thought Scene Fragments were going to be in 2018.3 when I saw the live stream, guess we gotta wait a little while longer.

@NathanWarden_1 : You bring up some problems around Scenes that are of very high priority for us to tackle.

It’s correct that we were working on Scene Fragments and that the idea was to ship an early preview version in 2018.3.
However, it turned out Scene Fragments was not the right solution, for a number of reasons that I won’t get into here. Suffice to say it wasn’t future proof.

That said, we’ve by no means given up on solving these problem. If you want to help us, the best thing you can do at this point is to tell us about your use cases around Scenes. @hippocoder , I don’t mean to put you on the spot here, but if you really do have an open world game brewing, we’d be interested in learning how you ideally want to structure your Scenes for that.

4 Likes

So. I can describe what I need for my own projects as well as for my employer.

At my employer, they’ve got a lot of ex-Unreal Artists/Modelers who have experience with Unreal’s layered scene system and I have to agree, it’s good for separating responsibilities and scripts, allowing the various disciplines to focus on their own problem domain most of the time. I remember when I worked for a AAA studio we had various layers like “Deco”, “Base Geo”, “Art Geo”, “Terrain”, “Audio”, “NPC”, “AI” etc…

For my own projects, my Art Director and Level Designer would like a way to have a way to mark objects in scenes with some sort of conceptual tags and be able to isolate visibility to specific sets of objects to minimize misclicks on irrelevant content. These conceptual tags would be completely separate from the current gameobject tagging system, and would be orthogonal to any sort of scene layer system or the current additive scene system. It’d probably be more like the project asset tags than anything else, a meta-data only thing, and an object can have multiple tags.

As the best example I have right now:
Let’s say I have a castle, with guard towers and a guard wall, a moat, and a keep, with some spires.

An artist would tag the various parts with “guard tower”, “guard wall”, “moat”, “keep”, “spires”, “keep-hall”, “keep-garden”, so on and so forth. This would work across additive scene loading or streaming chunks or what-have you. An artist could load up all of the additive scene layers, select “guard tower” and “guard wall” and isolate to only assets matching those, with all other aspects of the workflow being the same.

Bonus points if such a tagged isolation system would work for prefabs and prefab isolation editing, so if part of a nested prefab is tagged and you isolate to that tag, only that nested part would be actively editable. Could be useful for more complicated prefabs.

Another point that was brought up that my Art Director really likes is something akin to what Blender 2.8 is doing with view layers and collections. I haven’t looked into this as thoroughly, however.

EDIT:
Just took a deeper look at the blender blog post and what they have is effectively the tag system I described. I feel that cribbing their notes is the way to go as Collections is less loose conceptually than “a tagging system”.

The main way to go with this in any case is that collections wouldn’t affect the hierarchy (indeed, a parent object could be on one collection and a child could be in another), they’re only for organization.

A different chunking system would probably be warranted for open world / large scenes, although my game’s use case is a 2.5D platformer that alternates from open-air city backgrounds to large interior levels, with a few narrower spaces thrown in to bridge spaces (or hide transitional loading if need be).

“Everything is a Scene” is the only thing I miss from Godot. I saw someone bring up the OP’s point at a Unite talk maybe a year ago or so and one of the head Unity guys came across as very dismissive of the idea (probably for valid reasons at least how it relates to unity).

1 Like

Aren’t prefabs scene assets, now?

1 Like

Well there is still the difference between Scenes and Prefabs in unity. In Godot there is no prefabs only scenes. So unity still has not taken it as far as the OP is suggesting.

Edit: I guess you could maybe have one root scene prefab and everything nested underneath in unity to pull off what Godot does. Still need more experience with the new prefabs though. I find them confusing so far.

Right but Godot is not unity, nor is it completely capable of everything unity can do.

The OP would be more on point by saying "I can do everything I can in unity in Godot using scenes for everything, for the scale and use cases that I use it for" - which ofcourse does not mean it will be the same for everyone.

There certainly is a place for prefabs seperate of scenes, and anyone who builds complex editor toolsets etc will sorely miss the exclusion of prefabs, just so that Godot users have less of a learning curve.

I like what Godot does, but this is not the same engine and I really dont think unity has a lot to gain from learning from Godot.

EDIT: there is also nothing stopping the OP from not using prefabs at all, and putting everything in scenes and using just those, so I certainly dont see why we would want to regress and remove the abstraction of prefab < > scene.

Also, scenes have lighting data and other data, which is nonsensical to store for a lot of stuff. Sometimes you just want a collection of stuff < > data, which is what the prefab system does very nicely. Now with nesting, anything can inherit from the original blue print, making organisation very easy also.

If the Resource loader allowed async loading of assets/Prefabs like it’s possible with scenes then i think storing the gameworld inside nested prefabs could actually be a good workflow.

1 Like

You can do this now:

https://docs.unity3d.com/ScriptReference/Resources.LoadAsync.html

This is what we do currently, and its a very good way for loading fragmented worlds without big frame drops

1 Like