- Home /
Help with performance
I work with Unity for some time, since 2.5, now I'm working on a project that used the Unity 3.5.7 and I'm having a performance problem between changing scenes
The project I'm working on is a large project, has about 20 scenes, the game is this: www.jogofreiodeouro.com.br
But now I'm doing porting it to android and ios, and analyzing the profiler, found that peak performance, every time I change the scene:
Regardless of the scenes that peak always appears, I searched the forums about it, the answers but only found similar questions and posts, however with no "solution"
I read some things that can "aggravate" it, but nothing that impacts on the reduction of the peak, as you can see the selected object in the photo, the peak calls sometimes greater than 300,000! Even changing between menus.
In the web version, it does not impact the game, but the devices, depending on the peak application closes.
Sometimes appears when I change the scene the message "Out of memory" and will not appear on the peak profiler.
I hope someone has something in mind that you can help me!
Answer by meat5000 · Aug 09, 2013 at 11:20 PM
http://answers.unity3d.com/questions/209969/long-freeze-when-loading-level-from-asset-bundle-i.html
http://docs.unity3d.com/Documentation/ScriptReference/Application-backgroundLoadingPriority.html
What I'm seeing in these links is that you can reduce priority for longer load times, smaller performance hit or increase priority for faster load times, greater performance hit.
My own thoughts on the matter would be to load as a two stage process. Firstly, manually unload/destroy objects in level to save on memory, in the run-up to the end of the level. This might require clever outlay/setup. Secondly, perform load of next level. Loading next level would destroy objects of first level and load new assets in 'one hit'. If you can reduce the amount of work performed by the load and have freed up memory in advance you might achieve faster loading times and also prevent out-of-memory.
Hope it helps.
EDIT: writing this has made me realise what is going on in all the games that prevent your return when you near the end of a level, like dropping you off a ledge you cant go up or a door that locks behind you; assets can be safely unloaded knowing they wont be required to be loaded again and background loading of large footprint assets can begin.
Your answer
Follow this Question
Related Questions
Many draw calls w\ low verts VS little draw calls w\ lots of verts 1 Answer
Using an instantiated pooled object for the first time causes frame drop 1 Answer
Unity 4.6 GUI vs NGUI Performances (mobile and pc) 1 Answer
Vertices limit for iOS? 0 Answers
Efficient way of having 1 draw call but allowing for debris physics [Mobile] 1 Answer