Reducing filesize of build

Hello

I just realized Google Play will only allow 100 MB apks and since I have no idea yet how to use expansions yet, I try to get my project as small as possible.

Which options do I have to make the filesize of a terrain smaller? Basically, most terrains dont even use any height and I already set the height resolution to 33 (the minimum).
How can I compress fbx/model files? The “mesh compression” as mentioned by the doc I cannot find.
How can I compress animations?
Also, is there any way to see the COMPRESSED size of the build elements? I mean what does it help if it lists me an image as 2MB when compressed it is only 370kb?

Hi,

You could use asset bundles to load those big files into app on first run…
or try the splitting Unity - Manual: APK expansion files

Can you show your build size log?

its in the editor log, it shows things like:

Textures      12.7 mb     1.$%
Meshes        767.2 kb     1.$%
Animations    0.0 kb     -1.$%
Sounds        0.0 kb     -1.$%
Shaders       2.5 mb     1.$%
Other Assets  26.1 kb     1.$%
Levels        6.5 kb     1.$%
Scripts       621.2 kb     1.$%
Included DLLs 3.9 mb     1.$%
File headers  13.1 kb     1.$%
Complete size 0.0 kb     -1.$%

Used Assets and files from the Resources folder, sorted by uncompressed size:
8.0 mb     1.$% Assets/sIBL Archive/LA_Downtown_Helipad_GoldenHour.hdr
2.1 mb     1.$% Assets/PostProcessing/Resources/Shaders/Uber.shader
1.3 mb     1.$% Assets/VikingVillage/Textures/Props/prop_skull_01_sg.tif
Textures      117.8 mb     64.3%
Meshes        11.3 mb     6.2%
Animations    36.4 mb     19.9%
Sounds        1.6 mb     0.9%
Shaders       580.8 kb     0.3%
Other Assets  5.9 mb     3.2%
Levels        3.5 mb     1.9%
Scripts       1.4 mb     0.8%
Included DLLs 4.1 mb     2.2%
File headers  613.5 kb     0.3%
Complete size 183.1 mb     100.0%

Used Assets and files from the Resources folder, sorted by uncompressed size:
 10.7 mb    5.8% Assets/prefabs/models/UnityWizard/WizardA.dds
 10.1 mb    5.5% Assets/prefabs/GoblinArmy/Goblin_Baron.FBX
 8.2 mb    4.5% Assets/prefabs/GoblinArmy/Goblin_Bandit.FBX
 7.1 mb    3.9% Assets/prefabs/GoblinArmy/Goblin_Shaman.FBX
 6.6 mb    3.6% Assets/prefabs/GoblinArmy/Goblin_Slave.FBX
 3.5 mb    1.9% Assets/prefabs/models/UnityWizard/TheWizard.fbx
 2.6 mb    1.4% Assets/prefabs/models/FemaleElementalist/FemElementalist.fbx
 2.4 mb    1.3% Assets/scenes/Terrains/ter_smallRoad.asset
 2.4 mb    1.3% Assets/scenes/Terrains/ter_rockyBasic.asset

I managed to reduce the overall size to below 90 MB now, since I realized the sounds can be heavily compressed with Vorbis quality 1/100. But still, there is a lot to optimize.

Where can I find info on the asset bundles that you mentioned? Or is that the splitting (thanks for the link!)?

in short

I think I will try to avoid bundles as long as possible. Takes too much time go get into it now.

Any ideas on compressing models, animations and terrains?

Having mono sounds almost halves their file size, but is generally not noticeable on mobile, almost certainly not as much as reducing the quality. You could do both and reduce the file size even more.

1 Like

19,4MB @ 1/100 Vorbis —Force Mono—> 9,2MB
nice :slight_smile:

can also build ARM only, instead of FAT, if that helps much on build size much.
(and then upload them separately if want to…but read somewhere here that x86 androids are like 2% or less?)

I have two questions about terrains.

I figured since I cannot use 30 terrains because each will be at least 1-2 MB, making all terrains into 1 can drastically reduce the resulting filesize.

Now the only question is: when my 1 super-terrain hosts all 30 segments and each scene will only show 1 segment (divided by nothing specially, just the position of the terrain will change per scene) will the other 29 invisible segments of the terrain impact the performance? Since it is the same object and heights generate triangles. Or will the unrendered triangles/terrain not decrease the performance?
EDIT: OK, it does very negatively impact the performance. Is there a way to not do that? Maybe with some asset from the store or a nice script?

Another question is, why does the filesize of a terrain grow when I just add textures? It does not grow with terrain size or when I paint onto it. That feels a bit strange to me. How can the terrain grow from 1 to 8 MB just by adding textures?

How many textures did you add?

Not sure you already did this or not, try to compress your texture in the import settings and disable mip map if you not using it