Update!! It’s been released: Advanced Additive Scenes - Multi-Scene Editing! | Utilities Tools | Unity Asset Store. There is also a DEMO version available. Original post below.
Hey guys,
I’ve been slaving away on a really useful plug-in which I’m tentatively calling “Advanced Additive Scenes”. I plan to release it shortly, after it goes through some more extensive testing. In order to explain what this plug-in does, I’ll have to explain Additive Scenes which Unity supports natively.
Scenes as Layers
You can think of a Scene as a layer in Photoshop. In Photoshop, you can combine multiple layers to compose an image. Likewise in Unity, you can combine multiple scenes to compose an image. Usually in your game, you will have many screens; at the very least a pause screen. You will want these screens to load without destroying your game state (they should layer over-top of your scene). Let’s take a look at this in Fling Theory:
In the picture above, you can see how the two scenes (the level and the pause menu) combine to compose the final image. You can achieve this by simply calling Application.LoadLevelAdditive() as opposed to Application.LoadLevel(). What are the advantages of Additive Scenes over Prefabs? Glad you asked, since you’re using a Scene instead of a Prefab, you are able to nest prefabs without your scene without running into the dreaded Nested Prefab issue.
Additive Scene Tools
Now that we’ve established this is a good thing, what are the limitations? Well for one, you cannot preview the combination of Level + Pause Menu without playing the game, and executing the LoadLevelAdditive() call. This is a slight work-flow issue because you would prefer to be able to use the WYSIWYG editor like usual. Enter: Advanced Additive Scenes. Using the plug-in, you are able to preview Additive Scenes in the editor:
This screenshot shows a SubScene configured to load the PauseMenu. By doing this, you are able to line-up your pause menu elements, see how the rendering order works, and tweak your shading/transparency. When you unlock the SubScene object, you are able to make changes to PauseMenu, and the best part is: All of the changes get saved back into the PauseMenu scene!
Beyond Menus
This alone is an amazing workflow improvement, but let’s take another look at Fling Theory and see how our levels are structured. Here is a typical level layout:
Notice how there are multiple rooms which comprise the level? Well, we can break up these rooms into SubScenes. Doing this makes sure the data for each room is saved into its own scene file. This allows multiple designers to work on the same level, as long as they are modifying separate rooms! This is a huge productivity boost for teams with multiple members. It helps alleviate issues that arise when multiple members work on the same scene. Let’s take a look at what this looks like:
Improved Collaboration
You can see that the level is broken up into multiple rooms, and each room has its own SubScene. This works extremely well for our two-man team since Doug and myself can both be working on the same level as long as we’re tweaking separate rooms. On more advanced projects, you would break-up the background from the puzzles and allow artists to tweak the look of the level which would never cause merge issues with the designer. Breaking up scenes by discipline (art, audio, design, programming) is a great way to get productivity boost; Unreal has been doing it for years.
I want to turn your attention over to the Inspector for a moment. You’ll notice there’s a few different options. With the Pause Menu, I set the Runtime Load Settings to “Don’t Load” which indicates my code will load the menu manually. On the other hand, when breaking up the level into rooms I chose “Bake Into Scene” which ensures the data lives in the scene in the final build. This option optimizes the loading time by ensuring all of the data is loaded at once, and Unity sees it as a single scene at runtime. This ensures there is no overhead associated with using this plug-in!
I plan to release this soon, after some more extensive testing. Let me know if you have questions/feedback/requests.