[Unity] How to optimize game size 50% in less than 15 minutes?
This is story how I optimized game size Perfect Park – Brain Challenge decreasing size approximate 50%.
1.How much size of game mobile is good?
2.How to optimize game size
After you finish all features of game, that is when you need to optimize game size and performance before submitting to store. The following step to decrease game size perfectly and easily:
Step 1: Investigate what make your game heavier
Default, Unity detect used resources automatically when building the game. Almost is good but Unity sometimes cannot remove unused resources. So Unity have perfect tools to statistic volume of all used resources. That is Build Editor Log. You can find editor log at folder “C:\Users\[Your User]\AppData\Local\Unity\Editor\Editor.log” when finishing built the game.
So take care the following strategies:
- Remove un-used resources
- Compress big resources as graphic texture, audio as possible.
Step 2: Optimize graphic
- Compress texture: check overrided for Android or Apple Store, choose minimum target max size, choose formats. There is some formats you can choose to optimize size which lose quality of graphic such as RGB Compressed DTX1, RGB Compressed DTX5, RGB Crunched DTX1, …etc. I choose RGB Crunched DTX1 for some big assets and result is smaller than 8 times (decrease from 2.8MB to 300 KB), quality graphic still good on mobile.
- Using Sprite Packer to combine multiple assets to single texture (use Package Manager to download and install Sprite Packer) by set all assets to same Packing Tag as the following picture as Packing Tag: UI_1.
Step 3: Optimize sound
Audio Clip (sound files) which imported to Unity is working very similar to texture importing. Unity supports many different audio formats, but in the end it converts them all to preferred (by the engine) format such as PCM, ADPCM, Vorbis/MP3 and HEVAG. Note that not each platform can handle all of these compression formats, and some platforms have only one format available (e.g. WebGL can work only with AAC audio clips).
Original audio file size is computed to 35.9 MB and the imported size to 10.7 MB. Choose Quality to 60 – 80% for decreasing size but still good quality.
Here is explanation detail about Audio working on Unity.
Step 4: Optimize Mesh and other animation
You can compress Meshes and imported Animation Clips so that they take up less space in your game file. To enable Mesh compression, select the Mesh, then in the Inspector window set the Mesh Compression to Low, Medium or High. Mesh and Animation compression uses quantization, which means it takes less space, but the compression can introduce some inaccuracies. Experiment with what level of compression is acceptable for your models.
Step 5: Optimize publishing
- Unity supports two .NET API compatibility levels.: .NET 4.x and .NET Standard 2.0. The .NET Standard 2.0 restricts you to a smaller subset of the .NET API, which can help keep size down.
- Choose Google Bundles file can decrease 5 – 10% game size.
- Release Proguard mode can remove un-used files but should be carefully because sometime your game will be not working properly.
Here is result after optimize game size: decrease from 76MB to 40 MB (approximate 50%)
If you see this tutorial helpful, please explore at here: