Planning Ahead: Choosing Optimal Game Resolutions For Portability Across Android Devices
Supporting Diverse Android Devices
With over 24,000 distinct Android device models actively used today, building games that reliably perform well across the majority of devices poses optimization challenges. Carefully considering the display capabilities and hardware constraints of target Android platforms is critical for achieving both graphical fidelity and smooth performance.
Assessing Resolution Capabilities Across Devices
The wide variety of Android devices in use have significant differences in native display resolutions. Entry-level devices may have 480p or 720p screens, while high-end models can support up to 4K resolutions. Additionally, screen sizes, aspect ratios, and pixel densities vary widely between devices. Testing gameplay on phone, tablet, and foldable form factors helps verify assets will render properly across diverse displays.
Considering Screen Sizes and Densities
While higher resolutions allow more detailed graphics, also consider typical viewing distances for different devices. For example, mobile phones are generally viewed much closer than televisions, so higher PPI densities may be warranted, even at lower native pixel counts. Also, optimize 2D UI elements and text readability for varying pixel densities. Always profile asset quality on real target devices rather than just emulators.
Accounting for Hardware Performance Limitations
Alongside display differences, Android devices have vastly different SOCs, CPUs, GPUs, memory, and storage. Benchmarking tests on target devices gives critical data for setting performance budgets and quality presets. Test with network connectivity enabled as well, since actual gameplay often involves asset streaming from remote servers.
Setting Resolution Targets
Choosing Native vs Upscaled Rendering
Rendering at native display resolution provides the crispest graphics, but achieving 60fps at max settings may be unrealistic for underpowered devices. However, good upscaling options are available. For example, high-quality bicubic upscalers with anti-aliasing can give excellent visual results from a lower-res render target. Profile image quality closely when testing upscaling.
Determining Ideal Rendering Resolutions
Finding the optimal render resolution involves balancing graphical fidelity against performance. Assess whether your game’s core visual style and gameplay smoothness are better served by maximizing resolution or frame rates for specific devices. For less capable hardware, determine minimum functional resolutions by reducing render targets until performance criteria are met.
Supporting High, Medium and Low Preset Quality Levels
To support devices across a wide performance spectrum, define hardware tiers and graphics presets optimized for each. For example, categorize devices as high, medium and low, with customized render targets and graphical effects for each tier. Allow automated or user selection between quality presets. Also consider dynamically scaling fidelity based on real-time performance data.
Resolution Independent Design
Leveraging Flexible UI Systems
Carefully crafted UI systems can gracefully handle varying render targets and screen sizes. Building interface elements out of flexible box containers with flow layouts and proportional sizing enables beautiful results across devices. Similarly, text components can elegantly adapt with multi-column text flows coupled with fluid type sizing.
Building Adaptive Asset Streaming
Stream assets optimized for the client display configuration whenever possible. Detect properties like DPI and resolution on app launch to request appropriate image and media quality levels from servers. For wide variance between devices, high, medium and low quality asset bundles can provide hardware-tiered optimizations.
Enabling Dynamic Level of Detail
Further optimize streaming and performance by incorporating level of detail (LOD) systems. Dynamically load higher or lower LOD models and textures based on object proximity, velocity, camera focal plane and other factors. Combine robust LOD systems with resolution detection for extremely adaptive fidelity targeting each device’s capabilities.
Performance Optimization Strategies
Minimizing Draw Calls and Overdraw
Excessive draw calls and overdraw quickly overwhelm low-end mobile GPUs. Improve batching through careful material management, static and dynamic combination techniques, and reusing common buffers. Profile draw call counts and GPU timing to isolate bottlenecks. Optimize occlusion culling, frustum culling and LOD systems to minimize unnecessary pixel overdraw.
Using Efficient Texture Formats
Texture compression formats like ETC2 and ASTC offer high image quality at reduced bandwidth and memory costs compared to uncompressed formats. However, hardware decode support varies significantly across GPUs. Profile across target devices to ensure accessible formats are selected. Also test compression ratios to prevent artifacts or excessive decode latency.
Profiling Across Target Devices
Focused performance testing on actual phones and tablets allows quantifying graphical workload limits for each hardware tier. Profile with debugging tools to pinpoint resolution thresholds for sustaining 60fps while identifying asset or effect excess. Optimization effort can then concentrate on lower-tier devices using collected data.
Example Pseudo-Code for Adaptive Resolution
Detecting Device Capabilities
// Get device display and GPU info Display display = device.getDisplay(); Gpu gpu = device.getGpu(); int width = display.getWidth(); int height = display.getHeight(); int dpi = display.getDpi(); // Define hardware tiers string tier; if (gpu.BENCHMARK_SCORE < 300) { tier = "LOW"; } else if (gpu.BENCHMARK_SCORE < 600) { tier = "MEDIUM"; } else { tier = "HIGH"; }
Setting Rendering Resolution
RenderManager renderer; // Set resolution based on tier switch (tier) { case "LOW": renderer.setResolution(1280, 720); break; case "MEDIUM": renderer.setResolution(1600, 900); break; case "HIGH": renderer.setResolution(width, height); break; }
Loading Appropriate Assets
AssetManager assets; // Get assets optimized for resolution and tier if (renderer.getResolution() >= 2560) { assets.setQuality("HIGH"); } else if (renderer.getResolution() >= 1280) { assets.setQuality("MEDIUM"); } else { assets.setQuality("LOW"); } // Start streaming assets assets.streamForLevel(level);