How to Reduce Mobile Game Binary Size
As mobile games grow in complexity, keeping the application binary size small is crucial for maximizing download conversions and improving user retention. Large download sizes often deter players, particularly those on limited data plans or with restricted device storage. This article outlines the essential strategies mobile game developers use to minimize binary size, focusing on asset optimization, code stripping, and advanced delivery methods to ensure a lightweight and efficient install.
Asset Compression and Optimization
Assets like textures, audio, and 3D models typically consume the largest percentage of a mobile game’s binary size. Optimizing these assets is the most effective way to shrink the build.
- Texture Compression: Textures should be compressed using modern GPU-friendly formats like ASTC (Adaptive Scalable Texture Compression) for both Android and iOS, or ETC2/PVRTC for older devices. Developers also reduce texture resolution where high detail is unnecessary and use texture atlases to combine multiple sprites into a single sheet, reducing overhead.
- Audio Compression: Audio files should be compressed to formats like Ogg Vorbis or AAC. Game developers often lower the sampling rate (e.g., from 44.1 kHz to 22.05 kHz) for ambient sounds and sound effects where the quality loss is negligible to the player.
- Mesh Simplification: For 3D games, reducing the polygon count of models and stripping unused vertex attributes (such as tangents or secondary UV maps) helps lower the data footprint of 3D meshes.
Dynamic Content Delivery (On-Demand Loading)
Instead of packaging the entire game into the initial App Store or Google Play download, developers deliver content dynamically after installation.
- Asset Bundles and Addressables: Engines like Unity offer Addressable Asset Systems, allowing developers to split the game into smaller chunks. The initial download only contains the core engine and the first few levels, while subsequent assets are downloaded in the background as the player progresses.
- Play Asset Delivery (PAD): Android developers utilize Google Play Asset Delivery to integrate asset packs directly into the publishing process, allowing flexible delivery models like “install-time,” “fast-follow,” and “on-demand” downloads.
Code Stripping and Compiler Optimization
Unused code from game engines, third-party plugins, and system libraries can bloat the binary. Developers use compiler tools to prune this dead weight.
- Managed Code Stripping: Game engines can analyze the project’s scripts and automatically remove unused classes, methods, and libraries during the build process.
- IL2CPP and Link-time Optimization (LTO): Converting C# intermediate language to C++ using IL2CPP (in Unity) allows the compiler to perform aggressive optimizations. Enabling LTO further optimizes the final machine code, reducing both the executable size and runtime memory usage.
- Removing Unused SDKs: Analytics, advertising, and multiplayer SDKs often include heavy libraries. Regularly auditing and removing deprecated or unused plugins keeps the codebase lean.
Engine-Specific Stripping
Modern game engines are built to support a wide array of genres, meaning they ship with features your game may not use.
- Disabling Unused Modules: Developers can manually disable engine subsystems that are not required. For example, if a game does not use 2D physics, the 2D physics engine module can be completely excluded from the final build.
- Font Pruning: Font files (TTF/OTF) can be massive if they contain character sets for multiple world languages. Developers reduce font sizes by creating custom, restricted character sets (like TextMesh Pro SDF Atlases) that only include the specific characters used in the game’s UI.