Google recently made the Android Game SDK available to developers. It includes a number of libraries, as well as several API hooks, that should help game developers provide the best possible experience when it comes to gaming on mobile devices. Here’s what you need to know about the SDK.
Today's mobile phones have a wide array of displays. Most have a refresh rate of 60Hz, but some 90Hz panels are already in the market (Google Pixel 4, for example), and 120Hz and even 240Hz are on the way from the likes of Asus and Oppo. Games need to be able to adjust to these frame rate requirements on the fly, but the process isn't always smooth. That's why one of the first issues tackled by the Android Game SDK is frame pacing.
The problem occurred when the display itself jumps to a new frame while the game is sending an update to the outgoing frame. A workaround for this already exists wherein some displays will buffer older frames and repeat them if it detects frames that are out of sync. The result isn't perfect, however, and can be noticed by end-users on the screen.
Developers now have a new tool in the SDK's Frame Pacing library. It's able to tap into the Choreographer API to assist in syncing frames within the time requirements of the display refresh rate. It manages this via the Vulkan and OpenGL APIs, which it uses to ensure frames arrive exactly when they are needed.
Google built some flexibility into the system. What if a device supports both 60Hz and 90Hz frame rates (which is common right now), but the game is only 90Hz? The new Android Game SDK lets the developer assign a frame rate of 45Hz to ensure smooth gameplay. This is all handled without alerting the user to any potential playability problems.
Game developers will find that the Frame Pacing Library is already contained in Unity 2019.2. Accessing the library is as simple as ticking off the "optimized Frame Pacing" option. From there, the frame rates are easily integrated into the API base you've chosen.
You can download the Android Game SDK here.