Search Unity

Feedback 2D sorting layers and order in layer values are cumbersome to set up in large scenes - better tools?

Discussion in '2D' started by Xarbrough, Jul 28, 2019.

  1. Xarbrough

    Xarbrough

    Joined:
    Dec 11, 2014
    Posts:
    1,188
    Ever since my studio started making 2D games in 2014 we ran into the same cumbersome workflow: in large scenes, it is a slow process to sort all sprites into their correct layer and set the correct order in layer.

    When starting out making a 2D game a level might look like this:
    upload_2019-7-28_13-29-12.png
    Unity's example also often showcase scenes with limited complexity. In these cases it's ok to select each SpriteRenderer in the scenes(s) and set their layer and order. As shown in the screenshot, our team has also developed a custom tool to display all sprites like layers in image editing software. Each layer has its own section and all renderers are shown sorted by their order in layer to get a quick overview of the entire scene. Individual rows can then be dragged up or down, which changes their sorting order, to sort the scene efficiently.

    However, over time scenes become bigger and our current real-world first draft scene looks like this:

    upload_2019-7-28_13-27-7.png

    Now it becomes cumbersome to set the sorting for all sprites even with custom tooling. One of the pain points is the fact, that sprites which have the same order in layer may look correct from a certain camera angle, but when the camera moves, their order swaps depending on the distance to the camera (especially when using a perspective camera like we do). These issues are only discovered while playing or if level designers are diligent about checking the level from all SceneView angles.

    Questions for the community:
    1. How do you handle sorting of many sprites in Unity with builtin tools?
    2. What workflows or custom tools do you use to make the process easier?
    3. What could Unity implement to provide better tools?
    As a general feedback to Unity, I feel that the current tools are not efficient for sorting many sprites. Layer and sorting order needs to be set on each individual sprite, but the overall process of sorting is something that requires level designers to see and compare many sprites at once and sort them relative to one another, not each one on their own. Additionally, once a scene is set up (with possibly hundreds of objects sorted correctly), it can become difficulty to insert a single item, because if the designer has not prepared to leave enough sorting order space in between each sprite, it may become necessary to shift hundreds of sprites to insert a single one in between.

    My own ideas so far:
    1. Use of SortingGroups for prefab roots make it easier to prepare the sorting within the prefab before dropping it into the scene. The entire group is one piece, which simplifies sorting, but sometimes causes problems when we discover that the group needs to be broken apart again.
    2. Custom tools which display renderer layers and sorting order as rows seem to be better to get an overview or sort things relative to one another.
    3. Strict project design guidelines up-front can help organize the process (which elements belong into foreground, default, midground, background, characters always belong to sorting order x, etc.), however in reality, this is difficulty to know at development start. It's much more common to quickly prototype a level without paying attention to sorting and needing to fix issues when a sprites are already placed.
    Thank you for reading and for any ideas about how to improve the process! :)
     
    Xiangting_Su likes this.
  2. Xarbrough

    Xarbrough

    Joined:
    Dec 11, 2014
    Posts:
    1,188
    I don't usually bump threads, but in this case I feel the need to add to my woes: My team has been working on our 2D game for 6 months now and our biggest point of struggle is sorting order and layers.

    Personally, I can deal with the cumbersome work by working out strong rules about which objects need to go in which layers and which order in layer ranges are reserved. However, in practice and in a team its impossible to keep these guidelines updated to the current state of the project and also keep all level designers involved and on the same page regarding such guidelines. All in all, we constantly end up with hard to solve conflicts, where one tiny order in layer change causes cascading effects to a lot of other objects in the scene. And then its the same discussion everytime: "If we fix this one layering mistake, we need to update half of the scene and maybe more to move everything accordingly and we don't have time until the next milestone."

    So, I'm still wondering how other teams handle this or if its not such a big problem for others. Please also let me know if I'm the only one struggling with this. :D
     
  3. Xiangting_Su

    Xiangting_Su

    Unity Technologies

    Joined:
    Sep 22, 2020
    Posts:
    253
    Thank you @Xarbrough for your feedback on our current Sprite sorting tools. I'm glad I found this thread on our Productboard because you made great points there.

    I'm bumping this up because I'm also curious to hear how other teams are solving this.

     
    MousePods and Xarbrough like this.
  4. rarac

    rarac

    Joined:
    Feb 14, 2021
    Posts:
    570
    order in layer is unusable to sort many sprites, what should be used is transparency sort axis which auto sorts everything
     
    rustum and Xiangting_Su like this.