Search Unity

Scene Visibility Tools - Info and Discussion Thread

Discussion in 'World Building' started by gabrielw_unity, Dec 5, 2018.

  1. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    893
    Also, are there any plans for streaming scenes to show up / hide automatically (in the hierarchy/vis list) when streaming, particularly when around / far away from the camera in-editor?

    This is killing me in developing streaming games in-editor.
     
  2. neil_devine

    neil_devine

    Unity Technologies

    Joined:
    Apr 8, 2018
    Posts:
    8
    @PiezPiedPy sorry for the late reply, I seem to have forum notification issues. You would have to do that yourself, with setting the HideFlags, and turning off the renderers. What are you trying to do ?
     
  3. gabrielw_unity

    gabrielw_unity

    Unity Technologies

    Joined:
    Feb 19, 2018
    Posts:
    698
    Hi! Just had a chat about this, seems like a good plan to add a preference for how SceneVis is saved (or not). Something like "Clear SceneVis data: (Never; Only when I close Unity; Whenever I close a scene)".

    Will look into when we can add this, thanks for bringing it up!
     
  4. gabrielw_unity

    gabrielw_unity

    Unity Technologies

    Joined:
    Feb 19, 2018
    Posts:
    698
    I don't think we would handle this ... though the SceneVis system might be involved ... I would ask in the Editor General section :)
     
  5. neil_devine

    neil_devine

    Unity Technologies

    Joined:
    Apr 8, 2018
    Posts:
    8
    Hey, in the mean time you could call SceneVisibilityManager.ShowAll at the appropriate times, or delete the SceneVisibilityState.asset at the root of your Library folder
     
  6. neil_devine

    neil_devine

    Unity Technologies

    Joined:
    Apr 8, 2018
    Posts:
    8
    Could you give some more details on your problem ?
     
  7. Adrien-TA

    Adrien-TA

    Joined:
    Jan 11, 2019
    Posts:
    5
    @gabrielw_unity Thanks for looking into that ! Those options seem to cover our needs, we will wait for them.
    @neil_devine I'm not confident in erasing Library stuff at runtime =D but the alternative of calling ShowAll on a callback like EditorSceneManager.sceneOpened sounds like a good idea, I will give it a try.
     
  8. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    893
    Sorry for the delay --

    So basically, when I am designing maps for a streaming world game (whether it is a 2d or 3d game), I generally have an area of the map that I am working in, but rather than working in one place at a time, I tend to work all over the map at once (using my plugin, Snapcam, to navigate me around the world instantaneously). Getting around the scene this quickly inherently means that I must show/hide/load/unload any distant scenes manually.


    The problem with this is that, whenever I instantly "snap" to a new position in the world so that I can edit the objects there, I have to manually load/unload various scenes / display any hidden objects for performance CONSTANTLY, with no way to ensure what I need to show/hide/load/unload will be taken care of as I arrive.
    Due to these performance issues that sometime crash the editor, I cannot simply use the editor to EDIT my streaming game -- To do this (at least for art), I am forced to use external tools like Blender or Houdini in very non-standard ways to modify my art due to Unity's editor-specific issues like floating point limitations or just general unwieldiness when I'm snapping around these large worlds.
    Ultimately, the area around the editor camera should automatically load new scenes and automatically hide and unload other far away areas (or turn them into imposters after a certain distance, so you can visualize the skyline).


    In general, I would probably want to specify a distance threshold from the camera where scene hierarchies (specified by a master scene) would either display imposters after I move a certain distance away, or be unloaded entirely. When I start back toward this position (within a given threshold) or when I suddenly move the camera there, I would want the scene to be reloaded so that it displays imposters/LODS as I approach it, and then becomes fully detailed after I reach a certain distance from its central origin (perhaps the first gameobject in the scene is the origin of that loaded scene?)

    Positioning in super large streaming worlds gets trickier as the units scale, but using in-editor tools to craft these large worlds gets even trickier (or impossible) with certain long-distance movements beyond a certain threshold. My worlds are getting bigger, and my goto tools are failing me.

    Perhaps handling floating origins in-editor (for visibility/loading purposes) might be an option? -- i.e. if my position is 100,000 km, then the Editor itself sees only a small bit of this at a time, locally around the world origin, which allows users like me who are authoring streaming worlds to use tools like ProBuilder as if they were close to the origin (despite them actually being crazy far away.) Unity would just compress the positioning in chunks of whatever size the user specifies so that these crazy-far-away scenes can be visualized/hidden/unloaded/reloaded and (most importantly) EDITED, whenever necessary.

    Ultimately, showing/hiding scenes/objects for me automatically as I zip around my world is what I want SceneVis to help me do, but the last time I checked, the Editor itself can't do even basic scene positioning when loading a scene (i.e. loading/unloading a scene into/from a specific position in the world). So SceneVis won't work for what I actually need it to do -- especially when it involves editing a scene that has a floating origin (like mentioned above). Unity as a whole assumes I'm just working on ONE single area/scene all the time. Unity assumes that area will never be far enough away from the origin for it to ever matter that using a tool like Probuilder (or other official Unity tools) to design my world at far away distances is actually impossible without the floating origin being recalculated periodically (when the position shifts to far away distances) and assumes I will just make my own tools (i.e. Reprogram Probuilder) for handling such use-cases. However, it is clear to me that these floating origin use-cases are becoming more and more common and I am struggling to keep up with the editor's own scene-management API throughout Unity's progression into a modern editor. MegaCity is a lot to digest, for example, but doesn't handle the floating origin visibility scenario.

    I know that visibility options and better hierarchy management is the purpose of SceneVis tools, but visibility is even more important with a streaming world -- especially one with a floating origin -- because one needs the tools to visualize it in-place and manage it even more carefully than a standard-fare portal-based / static world.



    My only options for this kind of visualization in Unity is to work on every single area of my game (i.e. using Probuilder) near the origin, never being able to fully visualize the connected world as it really is, OR always rely on third-party modeling programs like Houdini or Blender to see the meshes properly positioned and semi-connected (but with complicated visibility scene-loading setups in the modeler (that would be better-off programmed once in the game engine instead) with the inaccuracies of all the wrong materials/lighting due to it not being in-engine. Otherwise, we must duplicate work.
    So far, the only "solution" (to the in-game streaming at least) is the very "iffy" (and dated) (and poorly documented) World Streamer asset that can only do so much anyway when it, too, struggles with the editor's mandates on positioning/loading/visibility.
    In the end, all I really need is to show/hide/load/unload things at the proper moments, and display them in the correct places so I can visualize them (usually following some kind of square or hexagonal grid formation).
    This process seems so fundamental for a modern game engine, but I can't help but wonder why is process this is SO overlooked by third-party game engine development teams? -- Do I really need a separate game engine for the single mundane purpose of simply showing/hiding/unloading the things I need to show/hide/unload at a given moment just so I can EDIT the world?
    This is all distance-based visualization stuff that Unity should already do for me, especially as streaming games with streaming assets have been (and continue to be) the norm in the same games industry that aims for hyper-realistic realtime graphics. The heavier the graphics, the more burden it puts on the editor.

    This is killing me. :/

    I just want to be able to move around and work in the Editor freely and not have it die on me!

    Making games is tedious enough, but with the editor itself not being able to do its own job without my assistance... This gets unnerving to say the least... SceneVis should (inherently) be about helping to maintain both performance and flow (as should all parts of the Unity Editor!) But as far as I see it, when it comes to either performance OR flow, with editing streaming game worlds, Unity's editor doesn't have a clue about all the problems and headaches conjured up by the single issue of basic visibility in streaming world workflows, and developing tools willy-nilly to solve editor visibility without fully considering these issues is a recipe for disaster. I just want to use Unity's official tools to let me visualize / edit the materials/objects across my scenes (with usable performance!) wherever they may be, while being able to zip around my game world as I see fit.

    This really should not be too much to ask. Who knows which team is on it -- either way, you guys seriously still need to __work together__ to make a usable in-editor workflow for streaming game world visibility.



    TL;DR:

    If you don't have time to listen to my amazingly well-spelled-out frustrations, you probably should skip this anyway. lol This is mainly just for the Unity dev who asked me to clarify the problem, so I'm offering as much clarification / details as I feel is necessary to spell out the significant pains I am going through (while also offering potential solutions). This is, after all, a discussion thread. There's lots to discuss.

    :)

    And if you read this, thanks for taking the time! -- These kinds of workflows seriously need to be addressed. Games are only going to get larger. Unity will be so much better for it in the end.
     
  9. neil_devine

    neil_devine

    Unity Technologies

    Joined:
    Apr 8, 2018
    Posts:
    8
    Hi, thanks for the detailed response. I totally see your point with problems editing large streaming worlds, and how some tools do not perform as well when far from the origin. We have been improving these lately, but for the ones we may have missed, I encourage you to enter bug reports and post them in the WorldBuilding forum or send to me directly.

    SceneVis was not designed or intended for use for any kind of performance improvement or streaming visibility management. It was designed to help users hide away things getting in the way of editing other things.

    As for streaming management, admittedly it is very specific to each game, requirements can be vastly different. We provide the basic building blocks from which you can build your own tailored solution, but as you say there is a lot to discuss on this subject, I believe this merits its own thread in this forum.
     
  10. Esc_Maleficus

    Esc_Maleficus

    Joined:
    Jun 3, 2019
    Posts:
    1
    Quick question: I'm using "SceneVisibilityManager.HideAll" in a script to hide all objects in the Scene view.

    This works fine, except when I hit the Play button. If the game is running, and I click over onto the Scene tab - all of the hidden objects are now rendering, even though they are all marked hidden in the SceneVis.

    Clicking the Hide/Show eyeball in the object hierarchy has no effect as long as the game is running. If I shut the game down, then the settings are respected again and the objects will disappear as expected.

    Is this intentional?

    Is there a work around to get the behavior I'm looking for ( if I hide objects in the scene view, they stay hidden regardless of whether or not I'm playing the game ).

    Thank you!
     
  11. neil_devine

    neil_devine

    Unity Technologies

    Joined:
    Apr 8, 2018
    Posts:
    8
    There is a limitation whereby if your scene has never been saved (no id associated to it), switching to playmode will render all objects visible. This should not happen if you have saved your scene at least once.
     
  12. gabrielw_unity

    gabrielw_unity

    Unity Technologies

    Joined:
    Feb 19, 2018
    Posts:
    698
    Hey @awesomedata ! Would you be okay if I move this discussion to a separate thread? It's larger than just SceneVis, and I'd like to avoid this thread losing it's focus, and also avoid your thoughts being lost in the noise. I'll move it over with a new title, or you can copy paste if you prefer. Thanks!
     
  13. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    893
    That's fine! -- I really don't mind as long as it actually gets seen and discussed!

    Hopefully this didn't come across in a negative way.

    I love Unity and very much appreciate the effort that goes into coming up with and implementing great ideas like SceneVis to handle common issues with Unity. I simply wanted to point out some holes I'm seeing in the thinking behind things like this and offer ideas for ways of thinking about potential solutions. I know I tend to think about things a lot differently than most, but sometimes my insights can be valuable to the right listener. Hopefully that is the case here.
     
    gabrielw_unity likes this.
  14. gabrielw_unity

    gabrielw_unity

    Unity Technologies

    Joined:
    Feb 19, 2018
    Posts:
    698
    No worries - and done! :)