Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    Dismiss Notice

Advanced Additive Scenes: Multi-Scene Editing. Now With Free Demo!

Discussion in 'Assets and Asset Store' started by Jodon, May 20, 2014.

  1. Homer-Johnston

    Homer-Johnston

    Joined:
    Nov 26, 2012
    Posts:
    46
    I know it's only been a couple of weeks, but any progress on a U5 compatible version? :) Thanks for your work!
     
  2. Jodon

    Jodon

    Joined:
    Sep 12, 2010
    Posts:
    419
    Hey Homer,

    Unfortunately I've run into bug after bug with Unity 5.x, so they fixed the last roadblock and created another. As it stands, the plug-in is compatible with Unity 5 RC1, but only if you do not "File->Open" and "File->Save" the Additive Scene files (e.g. if you're purely using the plug-in to do your saving, you're fine). They introduced a new serialization format recently which breaks their own loading APIs when they save a scene. My plug-in avoids that format.
     
  3. I have this bug when removing a component from a prefab that is used in a subscene. I tested in an old version and it's still there in v1.7.
    Repro:
    1. New Scene A
    2. GameObject->3D Object->Cube
    3. Create a prefab from this Cube
    4. Create a subscene A containing only an instance of this cube
    5. Save all (Scene A, subscene A, prefab).
    6. Go to another dummy scene B
    7. Remove mesh renderer (or any component on the prefab) from the Cube prefab
    8. Load Scene A

    Bug: The subscene A will not be loaded properly and you have the following error in the console
    MissingReferenceException: The object of type 'MeshRenderer' has been destroyed but you are still trying to access it.
    Your script should either check if it is null or you should not destroy the object.
    CodingJar.AdditiveScenes.SubSceneEx.SetHideFlags (IEnumerable`1 objs, HideFlags flags) (at Assets/Plugins/Editor/AdditiveScenes/Editor/SubSceneEx.cs:754)
    CodingJar.AdditiveScenes.SubSceneEx.EditorLoad (CodingJar.AdditiveScenes.SubScene subScene, Boolean bBaking) (at Assets/Plugins/Editor/AdditiveScenes/Editor/SubSceneEx.cs:437)
    CodingJar.AdditiveScenes.SubSceneLoadCallback.ConditionalLoadSubScene (CodingJar.AdditiveScenes.SubScene subScene) (at Assets/Plugins/Editor/AdditiveScenes/Editor/SubSceneLoadCallback.cs:133)
    UnityEditor.EditorApplication.Internal_CallDelayFunctions ()

    If you click go the subscene A and try "Load Subscene", it will not work properly.
    The only workaround that I've found is to manually load subscene A independently, save it, then reload Scene A.

    This is annoying when you change a prefab that is used in several subscenes.
     
  4. Jodon

    Jodon

    Joined:
    Sep 12, 2010
    Posts:
    419
    v1.7a is submitted, it will be out shortly. In the meantime if this bug is a hindrance to any other users:

    in EditorLoad, right before if ( !bBaking ):

    Code (csharp):
    1.  
    2. // Need to do this pass after, since the prefab stuff can muck with newly created missing values
    3. for(int i = 0 ; i < allObjects.Length ; ++i)
    4. {
    5.    if ( !allObjects[i] )
    6.       allObjects[i] = null;
    7. }
    8.  
     
  5. RDeluxe

    RDeluxe

    Joined:
    Sep 29, 2013
    Posts:
    94
    Hi !
    Just wondering if there was any test version of this tool ? I've just spent several days changing our game system to base it on several scenes, and this can come really handy, especially while working (always a pain to launch the game from its first scene to avoid errors).
     
  6. Jodon

    Jodon

    Joined:
    Sep 12, 2010
    Posts:
    419
    Not yet, you can send me a PM and I'll send you one.
     
  7. RDeluxe

    RDeluxe

    Joined:
    Sep 29, 2013
    Posts:
    94
    Sent you one, thanks :)
     
  8. Jodon

    Jodon

    Joined:
    Sep 12, 2010
    Posts:
    419
    For anyone following this thread, I have a new version which I'm testing right now that has the following features:

    Unity 5.x compatible
    Ability to UNLOAD a SubScene (baked OR automatically loaded additively)
    Objects that are loaded additively automatically now get properly parented to the SubScene object (they no longer load all the root level of the scene).

    If you want to beta test any of this (to ensure it works 100% with your project before I launch it), please send me a PM and I'll give you a build. My current project is still Unity 4.x so I can't test it as thoroughly as the other releases.
     
  9. AdamKane

    AdamKane

    Joined:
    Dec 3, 2012
    Posts:
    130
    Hi Jodon,

    Thanks for the v1.7d test build. I'm seeing an issue where subscenes that are set to automatically load aren't automatically loading (Unity 5.0.0f4):

     
    Last edited: Mar 5, 2015
  10. I've noticed the same issues as AdamKane

    Here's a simple version of my test setup with AAS-v1.7d and Unity 5.0.0f4:

    - MainScene
    -- Subscene A
    -- Subscene B
    ---- Subscene C (included in Subscene B)

    Editor mode:

    • When loading MainScene in the Editor and playing, everything works fine.
    • When loading MainScene from another scene in the Editor, none of the subscenes are loaded. I think running the game in the Editor and loading a scene with subscenes was already a problem on Unity 4.x
    • With MainScene open in the Editor, after building a build, MainScene is reloaded but none of the subscenes are loaded.
    • This message is obsolete in Unity 5 as we don't get the errors anymore: "Ignore Previous 6 CheckConsistency errors (Check Advanced Additive Scene Docs for details)."


    Build mode:

    • When running a build, when loading MainScene, Subscene A & B are loaded but not Subscene C. It seems loading a subscene that includes other subscenes is buggy. This was NOT there on Unity 4.x. This happens regardless if MainScene was the first scene loaded or if loaded by another scene.
     
  11. AdamKane

    AdamKane

    Joined:
    Dec 3, 2012
    Posts:
    130
    Jodon/BagleBaker,

    For Unity 5.0.0f4, AAS 1.7f fixes the non-loading subscenes issue!

    The only remaining issue I can see is that the lighting changes in unexpected ways when loading up a scene that has subscenes. In this clip, the ground plane is dark in playmode when using LoadLevel to get to the Main scene, but in the editor, the same scene has a light ground plane:

     
  12. tbriley

    tbriley

    Joined:
    Sep 10, 2013
    Posts:
    112
    Hi Jodon,

    Loving this so far - it's how I always imagined working in Unity! One issue I've come across though is when scrubbing animations in a sub-scene they do not seem to update in the Game View. The Scene View and original scene seem to work ok. Any ideas, perhaps a setting somewhere I've missed?

    Cheers!
     
  13. Jodon

    Jodon

    Joined:
    Sep 12, 2010
    Posts:
    419
    Unfortunately this is a known issue with DontSave flag set on objects. I try a lot to detect this case, but it doesn't always work. You can solve it by manually touching the values in the Inspector before animating. I can look at fixing this for the next version.
     
  14. tbriley

    tbriley

    Joined:
    Sep 10, 2013
    Posts:
    112
    Sounds good :) One other issue I've just bumped into now is that sometimes creating a new sub-scene reverses the order of your elements, which for UI is :(



     
  15. propeller

    propeller

    Joined:
    Jul 2, 2012
    Posts:
    202
    Hi, your plugin sounds really awesome and should be exactly what i need.
    One question though before i buy it: is it 100% compatible with Unity 5?
    cheers!
     
  16. Codemonger

    Codemonger

    Joined:
    Dec 12, 2013
    Posts:
    30
    Working with the latest release and I am encountering strange behavior. I have an Audio Manager sub scene, that handles music and audio etc using Master Audio ... I have now lost all game object from the audio sub scene after loading it asynchronously. I have to reload my audio scene from a backup and also reinstate the changes in the meantime.

    Master Audio requires the master audio controller to be in the root scene in order to work. Is the the way additive scenes accounting for root objects possibly causing this problem ? I used to encounter this issue a lot with skyshop and additive scenes. I get no error messages so I am going to turn on debug logging in the preferences in case it happens again, and I'm sure it will.

    This asset is too handy and useful for me not to use it , but I'm afraid of loosing my work .
     
    Jodon likes this.
  17. Jodon

    Jodon

    Joined:
    Sep 12, 2010
    Posts:
    419
    Propeller, you will need to wait for at least 1.7b to be approved on the asset store before using it with Unity 5.x. Unfortunately the Asset Store is very backed up right now, so approval on the assets are coming very slowly.

    Codemonger, are you using Unity 5.x? This sounds like it could be related to 5.x in which case you need to wait for the next release (a version later than 1.7b).

    Cross-Scene Referencing will only be working correctly in 1.7h or later. It is recommended you don't reference things across-scenes in the meantime (can be enforced in the Edit / Preferences tab).
     
  18. Carpe-Denius

    Carpe-Denius

    Joined:
    May 17, 2013
    Posts:
    805
    Unload() is checking children for SceneData, but LoadAdditive(true) will put the SceneData in the top level of the hierarchy.
     
  19. Jodon

    Jodon

    Joined:
    Sep 12, 2010
    Posts:
    419
    Carpe, in 1.7b or later there should be an option to allow the loaded scene (including additively loaded scenes) underneath the SubScene object which will help that functionality work. I will look at fixing it up in the other cases.
     
  20. Carpe-Denius

    Carpe-Denius

    Joined:
    May 17, 2013
    Posts:
    805
    The option disappears if you click on "don't load" and load it with SubScene.LoadAdditive(), so I have to parent it by myself. But the SceneData doesn't have a distinctive name, so I can't move it. Furthermore, the SceneData will have all root objects, not only the ones from the subscene. If I open the SubScene in editor, the SceneData will have only the right objects, so it happens at runtime.
     
  21. Jodon

    Jodon

    Joined:
    Sep 12, 2010
    Posts:
    419
    This is fixed in the latest (v1.7h). PM me if you want an early copy.

    This is fixed in the latest (v1.7h). PM me if you want an early copy.

    Ninja-edit: This is fixed in v1.7h as well :).
     
    Last edited: Mar 19, 2015
    OnePxl and hopeful like this.
  22. Codemonger

    Codemonger

    Joined:
    Dec 12, 2013
    Posts:
    30
    I'm using Unity 5.0 - I dumped everything into one main scene right now. No trouble to start moving everything to separate scenes when I reload additive scenes. Don't realize the amount of clutter until I took it away lol

    I'll PM you to see if I can get an early copy to test .. Thanks!
     
  23. That would be great! It would help for all the cutscene plugins that features a timeline scrubber for previewing.
     
  24. martaaay

    martaaay

    Joined:
    Apr 13, 2009
    Posts:
    136
    If I split my scene by rooms and lightmap each room in the subscene, will they combine properly in the master scene?
     
  25. Jodon

    Jodon

    Joined:
    Sep 12, 2010
    Posts:
    419
    It will in Unity 5.x as long as you bake your levels separately. You cannot bake from the combined scene unfortunately.
     
  26. VHornet

    VHornet

    Joined:
    Jul 10, 2012
    Posts:
    45
    I've purchased this plugin recently. I have 2 subscenes A and B in my main scene. Scene A is set as "Load Level Additive", and Scene B is set as "Bake Into Scene". Scene A is loaded correctly but scene B isn't loaded at all.
    Is this a new bug in this latest version 1.7h.

    The full picture is like this:
    Scene1 -> Application.LoadLevel or Application.LoadLevelAdditive or Application.LoadLevelAdditiveAsync or Application.LoadLevelAsync -> Scene 2

    Scene2
    --SceneA (Load Level Additive)
    --SceneB (Bake Into Scene)


    If I run directly Scene 2 then both Scene A and B are loaded correctly
     
    Last edited: Apr 17, 2015
  27. Jodon

    Jodon

    Joined:
    Sep 12, 2010
    Posts:
    419
    That should be working, what version of Unity are you running?

     
  28. VHornet

    VHornet

    Joined:
    Jul 10, 2012
    Posts:
    45
    I'm using Unity 4.6.4 on mac os 10.10.2
     
  29. VHornet

    VHornet

    Joined:
    Jul 10, 2012
    Posts:
    45
    It's seem that Occlusion culling data in subscene can not be loaded too
     
  30. Jodon

    Jodon

    Joined:
    Sep 12, 2010
    Posts:
    419
    Working on these now, I keep seemingly re-introducing that loading bug, I even have a test case for it... sigh. Send me an e-mail (my address is at the bottom of the Documentation.txt file). I'll send you an early beta build with the fixes which I'm working on.
     
  31. VHornet

    VHornet

    Joined:
    Jul 10, 2012
    Posts:
    45
    Also I have a suggestion like this: in my scene I have 2 gameobjects that reference to 2 scenes:

    MyScene
    --GameObject1 (disabled) -> SceneA
    --GameObject2 (enabled) -> SceneB

    Currently I disabled GameObject1 because I didn't want to interact with SceneA yet, but every time I open MyScene, both SceneA and SceneB get loaded. Although I did click button Unload SceneA and saved MyScene
    What I think it would be more reasonable is if GameObject1 is disabled then it's not necessary to load SceneA, only SceneB get loaded
     
  32. Jodon

    Jodon

    Joined:
    Sep 12, 2010
    Posts:
    419
    Eric, you should be able to do that with it set to LoadAdditive, but not BakeIntoScene. The reason you can't do it with baking is because you can have a cross-scene reference and it loads in before your game is even packaged (while you're building your game). If the object is disabled, by Unity's conventions, all GameObjects underneath should also be disabled while loading in.

    Cheers.
     
  33. VHornet

    VHornet

    Joined:
    Jul 10, 2012
    Posts:
    45



    May be I didn't explain it clear enough. I know it's working correctly at run time, what I mean is at editor time, when the application is not played yet, I'm in the scene and want to preview only the scene that is enabled (the green rectangle as in picture), the content of the scene that is disabled (the red one) shouldn't be loaded in. And yes both scenes are set to "LoadAdditive" because "Bakeintoscene" doesn't work in this version.

    In the picture, both scenes are loaded althought I disabled the "City" gameobject already, I also did click unload city scene and save this scene then reopen this scene, still the content of "City" scene is loaded.
     
  34. Jodon

    Jodon

    Joined:
    Sep 12, 2010
    Posts:
    419
    Hey Eric,

    I believe you want to use the "Editor Load Settings" set to "Manual" which will prevent the scenes from loading in automatically when the scene is first loaded. That way you can control which scene you're previewing. It will still bake in properly when ready to run the game. I've sent you a preview build with the issues solved hopefully.
     
  35. VHornet

    VHornet

    Joined:
    Jul 10, 2012
    Posts:
    45
    Oh, yes, exactly what I mean, sorry for missing that :D
     
  36. tbriley

    tbriley

    Joined:
    Sep 10, 2013
    Posts:
    112
    Is there any way to turn off cross-scene references entirely? It may be something we use eventually at the moment really just need the multi-scene editing capability. I've un-ticked everything in the settings but "Allow SubScene Auto-Load" and "Only Save If Dirty", but still get a "Break-Refs" popup and then error on anything with Uni 2D Sprite attached in the scene. Using Unity 5.0.1p1, OSX 10.10.3, and version 1.7i of your tool - Cheers :)
     
  37. Jodon

    Jodon

    Joined:
    Sep 12, 2010
    Posts:
    419
    There's no turning off the warning. When cross-scene referencing is 'enabled', it will try to save the references and only warn when it fails. When it's disabled, it won't try to save the references and will always warn you. The warning is meant to stop you from mysteriously losing data.

    The only way to solve it is to track down why there is a cross-scene reference in the first place. In the console window, it should spit out what the cross-scene reference actually is. If you're having trouble deciphering it, please paste it here and I'll give it a shot. Uni 2D Sprite -- is that the Unity stuff, or is that a plug-in? Hopefully if it's a plug-in they gave you source to help fix it if it's messy on my end.

    Cheers.

     
  38. tbriley

    tbriley

    Joined:
    Sep 10, 2013
    Posts:
    112
    It's a plugin. Full error:

    Code (CSharp):
    1. Cross Scene Reference: 'Null' Object: '' Property: 'm_rOriginalOwner' -> 'CourseRoot' Object: 'Sprite_FunnyMouseTail'
    2. UnityEngine.Debug:LogError(Object)
    3. CodingJar.AdditiveScenes.CrossSceneReferenceProcessor:LogCrossSceneReference(CrossSceneReference)
    4. CodingJar.AdditiveScenes.CrossSceneReferenceProcessor:CanSaveOrPromptToBreakRefs()
    5. CodingJar.AdditiveScenes.AdditiveSceneSaveProcessor:SaveSubScenesIntoTheirFiles()
    6. CodingJar.AdditiveScenes.AdditiveSceneSaveProcessor:OnWillSaveAssets(String[])
    7. UnityEditor.AssetModificationProcessorInternal:OnWillSaveAssets(String[], String[]&, String[]&, Int32)
    8.  
     
  39. Jodon

    Jodon

    Joined:
    Sep 12, 2010
    Posts:
    419
    It's weird that the first SubScene is 'Null' -- indicates that maybe a SubScene was removed? Usually it would say "Main Scene" if it's coming from the Main Scene. Anyway some property named "m_rOriginalOwner" is referencing Sprite_FunnyMouseTail in CourseRoot SubScene. Perhaps scan through the code to check for m_rOriginalOwner. My guess is that property should not be Serialized if it's only used by the Editor and not at runtime. You can try that -- make that change in your code and submit it to the plug-in author.

     
  40. We've had this issue before when we tried the uSequencer plugin. I've asked a question about it on that plugin's forum thread HERE. In the end, we didn't continue with uSequencer so didn't try to find a solution but the way it works might be conflicting with Advanced Additive Scene.
     
  41. Kdroben

    Kdroben

    Joined:
    Nov 12, 2012
    Posts:
    6
    Hi Jodon,
    We currently use advanced additive scenes on our project, but we have an issue with Unity5. The method to load subscene in editor is not the same on Unity 4 than Unity 5 (SubSceneEx.EditorLoad). I suppose LoadSerializedFileAndForget don't work on Unity5, but Linq Except function is O(n+m) complex. We have many objects on our scene store on 10 subscenes, and it take more than 5mn to load the scene in the editor, if we had one subscene with only few gameobjects it takes 1mn more.
    Are you aware of this? And is there a workaround.
    I was wondering if it couldn't be improved by comparing only root GameObjects. The exclude function will be called with shorter lists?

    regards,
     
  42. Jodon

    Jodon

    Joined:
    Sep 12, 2010
    Posts:
    419
    Hey Kdroben,

    I haven't had a case where it was significantly slower, but my main project has not yet shifted over to Unity 5.x, so most of my tests are with small scenes or AngryBots. I was hoping only concentrating on GameObjects would have solved it. It's probably possible to re-arrange the Where/Except calls to gain better performance and add a Where call to the existingObjs. Unfortunately I do not know of a great way to get all of the Scene Objects because all of the other methods fail to return disabled objects.

    I don't have time to look at it today, but if you play with it let me know!

     
  43. Rod-Galvao

    Rod-Galvao

    Joined:
    Dec 12, 2008
    Posts:
    198
    Is there a documentation?
    Where can I find more about references across scenes?
     
  44. TagScott

    TagScott

    Joined:
    Oct 17, 2014
    Posts:
    21
    Hey guys,

    I was wondering whether anyone else is seeing an issue I am. Here are my repro steps:
    • Add a scene with "Runtime Load Settings" set to "Baked"
    • Unload the scene so it is not shown in the editor (it's a fullscreen UI scene I am making and don't want it to obscure the game scene)
    • Play the parent scene
    • Within the play session reload the parent scene (e.g. via a restart level button Application.loadLevel(Application.loadedLevel))
    • The sub-scene is not loaded the second time
    I don't see this issue if the sub-scene is loaded in the editor.

    Unity version: 5.0.0f4
    AAS version: 1.7h
     
  45. Jodon

    Jodon

    Joined:
    Sep 12, 2010
    Posts:
    419
    Rod, there's some sparse documentation in Documentation.txt. The next version I'm working on is making improvements, as I've noticed there's some issues with Unity 5.x and using Prefabs that contain cross-scene referencing.

    Tag, I believe that's part of what I fixed in 1.7i (just update and it should hopefully fix those issues).
     
  46. TagScott

    TagScott

    Joined:
    Oct 17, 2014
    Posts:
    21
    Sorry my mistake, I'm already on 1.7i and the issue is happening for me
     
  47. Jodon

    Jodon

    Joined:
    Sep 12, 2010
    Posts:
    419
    Send me an email to the address in the Documentation file and I'll send you a patch with the latest version when it's ready tomorrow.
     
  48. Rod-Galvao

    Rod-Galvao

    Joined:
    Dec 12, 2008
    Posts:
    198
    I'm getting weird errors when I try to use multiple scenes with cross references. For instance, when I load the main scene, It says:

    UnityException: You are not allowed to call this function when declaring a variable.
    Move it to the line after without a variable declaration.
    If you are using C# don't use this function in the constructor or field initializers, Instead move initialization to the Awake or Start function.
    UnityEngine.GameObject..ctor ()
    Xyz.Xyz..ctor ()
    UnityEditor.EditorApplication:OpenSceneAdditive(String)
    CodingJar.AdditiveScenes.SubSceneEx:EditorLoad(SubScene, Boolean)
    CodingJar.AdditiveScenes.SubSceneLoadCallback:ConditionalLoadSubScene(SubScene)
    UnityEditor.EditorApplication:Internal_CallDelayFunctions()

    When I run the code the cross references are lost and it freezes Unity (5). But I'm not sure if its because of your extension, though.
     
  49. Jodon

    Jodon

    Joined:
    Sep 12, 2010
    Posts:
    419
    Hey Rod,

    Does your Xyz class have a constructor? Is there anything in the constructor that calls Unity functionality? That's typically the error (you're not allowed to have constructors in Unity for Object-derived classes).
     
  50. Rod-Galvao

    Rod-Galvao

    Joined:
    Dec 12, 2008
    Posts:
    198
    Nope. It doesn't have a constructor. It extends MonoBehaviour and has an Awake(). I think that's the default constructor being called.