Overview
Developing mobile games with the same mindset as PC or console games often leads to serious performance issues. Mobile devices have lower CPU/GPU performance and limited memory compared to PCs. Additionally, they face unique constraints rarely considered in PC development: thermal throttling and battery consumption.
Under sustained high load, devices forcibly lower CPU/GPU clock speeds to prevent overheating (thermal throttling), causing dramatic performance drops. Wasteful processing also rapidly drains batteries, reducing player satisfaction.
Optimization conscious of mobile-specific constraints from early development stages is essential for delivering a comfortable mobile gaming experience. This article covers fundamental optimization points for mobile game development.
1. Reducing Rendering Load (GPU)
GPU load is one of the biggest factors affecting battery consumption. Making rendering as lightweight as possible is key.
Reducing Draw Calls
Draw calls are commands where the CPU tells the GPU to "draw this mesh, with this material, at this position." These commands themselves cost CPU resources—too many draw calls create a CPU bottleneck while the GPU sits idle.
- Batching: A technique that combines multiple meshes using the same material into a single draw call. Enable
Static BatchingandDynamic BatchinginProject Settings > Player > Other Settings. Set static objects toStatic; dynamic objects with few vertices batch automatically. - Texture Atlas: Combines multiple textures into one large texture. This allows different objects to share the same material, making batching more effective.
- SRP Batcher: When using URP (Universal Render Pipeline) or HDRP, enable
SRP Batcherto batch objects using the same shader even with different material properties, dramatically reducing draw calls.
Managing Polygon Count and Overdraw
- Polygon Count: Keep polygons displayed at once on mobile to tens of thousands. Use LOD (Level of Detail) to switch to simpler models for objects far from the camera.
- Overdraw: Repeatedly painting the same pixel within a frame. Especially common when semi-transparent effects (particles) overlap, causing heavy GPU load. Switch Scene view draw mode to
Overdraw, identify areas showing bright red, and reduce unnecessary effects or use textures with more opaque areas.
2. Reducing CPU Load
The CPU handles game logic, physics, animation, and GPU draw commands.
Physics Optimization
- Physics in
FixedUpdatecan be a major CPU burden. IncreasingFixed TimestepinProject Settings > Time(e.g.,0.02→0.033) reduces physics update frequency and load, but may cause visible choppiness. - Remove unnecessary
RigidbodyandCollidercomponents. HavingRigidbodyon static background objects is wasteful. - Edit the
Layer Collision MatrixinProject Settings > Physics(orPhysics 2D) to disable collision detection between layers that don't need to collide.
C# Code Optimization
- Reduce GC Allocations: Avoid string concatenation in
Update,newclass instantiation, and LINQ usage to minimize garbage collection. Object pooling is an essential technique. (See the "Garbage Collection Optimization" article for details) - Cache
GetComponent: CallingGetComponentinUpdateis very expensive. Call once inStartorAwakeand cache results in variables.
3. Memory Management
High memory usage can cause the OS to forcibly terminate your app.
- Texture Optimization: Textures consume most memory. In the texture importer, set appropriate
Max SizeandFormatper platform. ASTC and ETC2 are efficient compression formats supported by most modern devices. - Audio Optimization: For long audio clips like BGM, set
Load TypetoStreamingto play without memory pressure. UseDecompress On Loadfor sound effects, andCompressed In Memoryfor frequently-used short sounds. - Use Addressables: Instead of the
Resourcesfolder, implement the Addressable Asset System to dynamically load/unload assets only when needed.
4. Mobile-Specific Considerations
- Touch Input:
Input.GetMouseButtonDown(0)also responds to touch, but useInput.GetTouch()for multi-touch and gestures. Consider the newInput Systempackage for more advanced control. - Safe Area Handling: Avoid notches (on iPhone X and later) and punch holes (Android) when placing UI. Use the
Screen.safeAreaproperty to adjust root Canvas boundaries.
Summary
Mobile optimization isn't a single solution—it's the accumulation of incremental improvements.
- Rendering: Reduce draw calls (batching, SRP Batcher), limit polygon counts (LOD), avoid overdraw.
- CPU: Lighten physics load, thoroughly reduce GC allocations.
- Memory: Optimize texture and audio compression/loading settings, use Addressables for dynamic memory management.
The key to successful mobile game development is using the Profiler early and continuously applying these optimizations while measuring performance on actual devices.