- Home /
Tips on optimizations for Android game startup speed?
To avoid wasting anyone's time I'll list out what I've done so far:
Crunched all assets
Compressed all textures using pngquant
Everything that was small enough to fit into a sprite sheet has been put into one using SpritePacker
Audio files have "preload audio data" unchecked
Created a scene that loads before the main game scene (may have made things worse)
VSync set to "No Sync"
Quality Levels set to "Fastest"
No Stripping level has been set because it breaks certain functionality
Custom splash screen while scene loads all dependencies in the background
I've gotten good frame rates on a HiSense Sero 7 LT(terrible android device) and I've reduced the apk size by more than 50% but with everything that I do I can't seem to get the game's startup time down.
About the device, it's a piece of crap but most games I've tested on the play store load in under 20 seconds some even under 10 seconds on this device so I know it is possible just not sure how to make it happen with Unity.
I have only a single scene and I use a transition handler to "slide away" the five pseudo scenes I have. The splash screen that I have only accounts for 25-33% of the load time while the bulk of the load time is coming from the Unity splash/loading screen. The main culprit is the Unity splash/load screen. I guess that is where I want to try and optimize first. I'm thinking about using AssetBundles to do an async load of the sprite sheets and only allow write blocking code for loading things that need to be immediately available on the menu screen. This might slim me down by ~8 seconds. I'm also wondering if the size of the hierarchy may be affecting the Unity load time.
From my understanding, the Unity splash/load screen is where all the Awake() methods run so I might just have to sift through each awake method to test it's timing.
I've searched the forums, Unity Answers and Google but I can't seem to find much. A few questions and no answers. I'm hoping someone can give me a good direction so that I can at least get this thing under 20 seconds. Anyone know what I can do to get this startup time down?
How about starting your app up with a main menu scene that requires far less resources, and loading the rest of your resources over time? A nice loading screen to keep users occupied? I would also consider that the device that you're using is the root of the slow loading issues. While I totally agree that you should target lower-end devices, dumbing your graphics down to bare $$anonymous$$imum only hurts you in the long run - considering the majority of users have devices that will have no problem running your app. I admit, it is much more difficult to scale your game quality based on device for Android - but doing things like measuring FPS to deter$$anonymous$$e the quality settings can go a long way.
I currently use the profiler to measure performance(FPS, CPU time, $$anonymous$$emory allocation) but the profiler doesn't profile the loading of the app. I have updated the post with information about my splash screen. I currently have a gameobject that displays once the scene is loaded that handles loading all the dependencies before allowing the player to proceed to the game. I have no issue with that screen as the time spent on that screen only account for 25-33% of 40+ seconds total load time.
Yep, doing the "startup scene that's basically a title screen which loads the main scene" has fixed this problem for us.
Alternatively, the main delay isn't necessarily loading the whole app/build, but the starting scene. Check what's in your scene and how many things it needs to instantiate, call Awake() on, what their Awake() functions do, etc - this will all happen in that final (frozen, unresponsive) "frame" while the splash screen is still showing.
Your answer
Follow this Question
Related Questions
Performance issues when loading first scene 1 Answer
long loading time android 0 Answers
Profile startup resources? 0 Answers
optimizing load scene 0 Answers
Storing in PlayerPref based on timer 1 Answer