Using SS on High Complexity Scenes

Announcements, support questions, and discussion for Scene Streamer.
Post Reply
pegassy
Posts: 135
Joined: Sat Mar 17, 2018 8:07 pm

Using SS on High Complexity Scenes

Post by pegassy »

Hey Toni,

I was looking for a scene streaming solution, and I did purchase the world streamer. However, I realized that it was a little too way advanced for what I was looking for and then I discovered your free asset. There seems to be no comments on the forums since 2016, so I am not sure if this asset is still supported.

Basically, I have a 3 room structure, which I managed to work just like in the demo. However, during the transition the load time seems to be a little too long. It takes for about 5-10 seconds to load the 3rd room while coming out of the 1st one, and when I built the game, I can still see that there is a 1-2 second load. Is there a way to eliminate the load time? Or should I be looking for a different solution for that need.

Thanks.
User avatar
Tony Li
Posts: 20603
Joined: Thu Jul 18, 2013 1:27 pm

Re: Using SS on High Complexity Scenes

Post by Tony Li »

Hi,

Scene Streamer is still supported. It's a small, simple asset that uses standard features, so the last time it needed any updates was for API changes in Unity 5.3 and 5.6.

It uses Unity's standard SceneManager.LoadSceneAsync(sceneName, LoadSceneMode.Additive) which loads scenes in the background while the game is running -- kind of. The main thread stops while it loads each individual asset. So if you have an extremely big texture or model, it could stutter. The main thread also stops to run Awake(), Start(), and OnEnable() methods. If you have scripts (including third party assets) that take a long time in these methods, it will stall the game momentarily.

SECTR Stream and World Streamer might provide tools to help you identify these bottlenecks (I'm not up to date on their latest features), but there's nothing they can do about loading large individual assets or long-running Awake() etc methods other than alert you to their existence.

To identify the culprit, you can run a Deep Profile, preferably in a build. Dig into the report to try to identify whether the CPU is being eaten by up asset loading, Awake() etc methods, or garbage collection.
pegassy
Posts: 135
Joined: Sat Mar 17, 2018 8:07 pm

Re: Using SS on High Complexity Scenes

Post by pegassy »

Hey Toni,

I appreciate the explanation. It was really helpful to understand what was going on. I honesty did purchase world streamer earlier, but my goal was to use it for outdoor scenes, to load parts of terrain and components on it. It seemed to be an overkill to just load rooms in a side-scroller 2.5D game. And scene streamer was so easy to set up. Thank you for making it available for free.

I looked at the profiler and the spike takes place for a "fixedupdate.physicsfixedupdate" for the particular room that causes the long loading. I baked the meshes, but it did not seem to help. I will go back to try to figure out which specific model is causing this based on your hints.
User avatar
Tony Li
Posts: 20603
Joined: Thu Jul 18, 2013 1:27 pm

Re: Using SS on High Complexity Scenes

Post by Tony Li »

If you have a lot of colliders and rigidbodies in the scene, PhysX might be taking a long time to add them to its simulation. I don't think it would be any better in World Streamer or SECTR since they also use the same underlying scene loading method.

As a test, you can make a copy of the scene without colliders and rigidbodies. It won't work correctly during play, of course, but you can test if it loads faster. If it's faster, go back to the original copy of the scene and:

1. Try to move as many of these objects as possible to be direct children of the "Scene" object. Reducing scene hierarchy depth can improve the performance of PhysX objects.

2. Combine colliders. If you have a floor consisting of ten 1x1 cubes with separate colliders and rigidbodies, replace them with a single 10x1 collider and rigidbody. If an object uses a complex mesh collider, replace it with a simpler primitive collider where possible.

If this scene instantiates new colliders and rigidbodies, instantiate them as root GameObjects (i.e., not parented to other GameObjects) to reduce their hierarchy depth, and if possible spread out the instantiate over several frames using a coroutine.
pegassy
Posts: 135
Joined: Sat Mar 17, 2018 8:07 pm

Re: Using SS on High Complexity Scenes

Post by pegassy »

Those are super tips Toni. I can see where the issue may be arising from. I think scene streamer will be sufficient for my current project given that I can simplify that room. I did not know that the object's location in the hierarchy made any difference to its loading time. This is pretty amazing to learn.

As always, tons of thanks for the great tips and the awesome assets.
User avatar
Tony Li
Posts: 20603
Joined: Thu Jul 18, 2013 1:27 pm

Re: Using SS on High Complexity Scenes

Post by Tony Li »

Always glad to help!
Post Reply