- Home /
How to optimize scene size for mobile?
I have a game with many levels. I plan on having around 100 levels total, but I currently have about 15 made. My current build size is ~60MB with the levels making up ~35MB. Each level is currently its own scene. Is there a better way to optimize the scenes such that they take up less space?
Well separate scenes, im pretty sure, suck up a bit of memory. You could maybe place several lvls in one scene and render out the objects that are not in view...like occlusion culling if you dont have Pro.
Are you using lightmaps in your scenes (levels)? Lightmaps create extra textures and take up more memory. If this is the case, then have a look at this answer:
http://answers.unity3d.com/questions/31703/when-is-lightmapping-bad-for-performance.html
GC1983 was on the right track. I created prefabs for each level's components then used a level manager and a single scene to instantiate the proper level at runtime.
That sounds pretty cool I'm not too worried about the size of my app at the moment the .apk is only like 50 $$anonymous$$B so far.
But the idea of instantiating the scenes at run time rather than loading entire scenes sounds intriguing especially for randomization. Does anyone know of any good guides how to randomize scenes like that easily?
I could probably figure it out myself but I'm sure someone already planned it all out perfectly.
The way I have it set up is an array of level prefabs where the level number is the index. The index could be easily randomized. The prefab at the index is instantiated in the awake function of the level manager.
$$anonymous$$eep in $$anonymous$$d that 50$$anonymous$$B is the limit for app downloads on cell data networks (for ios).
Answer by ryisnelly · Aug 04, 2013 at 02:18 PM
you could try using lower resolution textures and lower sound quality files, that may help, also try removing unnecessary components.
This is not an answer, but a suggestion. Removing components will only break away fractions. The amount of memory in it as a whole will never change unless they fully delete something. Your memory size of the project is all the graphics, scripts, and other assets involved in the folder.