Search Unity

Scene / level size is too much

Discussion in 'Editor & General Support' started by idurvesh, May 20, 2015.

  1. idurvesh

    idurvesh

    Joined:
    Jun 9, 2014
    Posts:
    495
    Hi,We are developing game for mobile.

    It is kind of racing game so we have set up race tracks (not circular its straight long tracks).

    The level size for each scene is getting above 8mb (check via Build Report Tool), obviously it is too much as we will have lot of levels and we do not want to go for DLC thing and want to restrict actual apk and iap size to below 50 mb.

    Could you guys elaborate on what may cause the scene to increase in size? All textures sizes in total after compression is only 2.51mb , so texture is not the problem.

    Thanks.
     
  2. Graham-Dunnett

    Graham-Dunnett

    Administrator

    Joined:
    Jun 2, 2009
    Posts:
    4,287
    What does the Editor.log say when you make a build? It should list all the assets and their built sizes.
     
  3. idurvesh

    idurvesh

    Joined:
    Jun 9, 2014
    Posts:
    495
    Great tip,rebuild the with 4 levels and checked Editor.log, its showing one of my surface model consuming 1.4 mb.The total levels size of 4 level is 47 mb.

    Final apk built size is 37 mb.

    Is it that, if I use 1.4 mb surface model multiple times, then unity calculating its memory separately ? suppose 4 times I used that surface model then 1.4 *4 = 5.6 mb?
     
  4. idurvesh

    idurvesh

    Joined:
    Jun 9, 2014
    Posts:
    495
    ah, I see where the problem lies, I have created prefabs of different types of environment which are of size 1 to 1.5 mb. so suppose if I instantiated one prefab and added 4 instances of it in scene,then it is consuming total of 6 mb..

    To test I added 4 instances of prefab and then deleted prefab now apk size is reduced by 6 mb.

    Is there any workaround for the same as I want those prefabs?
     
  5. BlackDDCat

    BlackDDCat

    Joined:
    Oct 24, 2017
    Posts:
    3
    Disable static batching
     
  6. Moonjump

    Moonjump

    Joined:
    Apr 15, 2010
    Posts:
    2,572
    Although I have much smaller levels for my puzzle game, I will have many more. I realised by the time I have 1000, they would have added an additional 50% to my build size. So I restarted my level setup with a basic object that includes code to create any level from a series of prefabs that are positioned as set. My prefabs and code only account for less than 100KB with my first 100 levels built. Each new level will add almost nothing.

    My suggestion is to do as much as possible in code. Don't build levels, build components that can be used to construct levels. It won't work for everyone, but it will work for many more than you think.