Learn how to use Adaptive Performance to tune your mobile game – balancing frame rates and graphics. Get the latest details about updates to Adaptive Performance’s device simulator, samples and scalers.
Developers should pay close attention to their game’s performance on players’ devices, especially when building more complex mobile games. After all, performance issues can affect gameplay and drain the device’s battery. An excessive amount of heat generated by mobile phones, more specifically, can also cause thermal throttling, which leads to dropped frame rates – an issue that is tough to recover from.
So why does thermal throttling affect your mobile games’ performance? Well, as your game attempts to do more work, such as rendering or processing game logic, CPUs and GPUs use more power. This increase in power means that more heat is produced, which slows down device performance in an attempt to reduce its temperature.
With Unity and Samsung’s Adaptive Performance, you can now monitor the device’s thermal and power state to ensure that you are ready to react appropriately. While playing for an extended period of time, for instance, you can reduce your level of detail or LOD bias dynamically to see that your game continues to run smoothly. Adaptive Performance allows developers to increase performance in a controlled way, which in turn, minimizes graphics fidelity.
Check out the video above to find out more about Adaptive Performance, and discover how to add it to your build.
How does Adaptive Performance work?
Adaptive Performance works for all Samsung Galaxy devices. In other words, only Samsung devices can benefit directly from Adaptive Performance implementation.
However, Samsung is the leading Android device manufacturer, with more than a third of the global market share according to AppBrain. This means that adding Adaptive Performance to your game is a sure way to improve performance on hundreds of millions of devices.
While you can use Adaptive Performance APIs to fine-tune your application, Adaptive Performance also offers automatic modes. In those modes, Adaptive Performance determines the game settings to tweak based on several key metrics, including:
- Desired frame rate based on previous frames
- Device temperature level
- Device proximity to thermal event
- Device bound by CPU or GPU
These four metrics dictate the state of the device so that Adaptive Performance tweaks the adjusted settings to reduce the bottleneck. This is done by providing an integer value, known as an Indexer, to describe the state of the device. The Indexer is a system that keeps track of your device’s thermal and performance state and provides a quantified quality index.
Scalers represent individual features in your game, which can include but are not limited to, graphics and physics settings. Scalers adjust themselves based on the Indexer’s value. You can view which Scalers are available in Device Simulator’s Adaptive Performance extensions.
Simulating Bottlenecks in Device Simulator
Simulating bottlenecks can be difficult, but thanks to Adaptive Performance’s integration with Device Simulator, you can test various scenarios directly in the editor instead of waiting for the device to heat up before benchmarking.
With the Thermal settings in Device Simulator, you can set the device to Throttle, or to send out a warning when throttling is imminent. You can also adjust levels and trends to positive, which indicates that the device is generating heat.
The Performance settings, meanwhile, allow you to set any current bottlenecks to CPU, GPU or Target Frame rate. Similarly, you can set CPU and GPU levels to simulate the frequency of their performance.
Both Thermal and Performance settings affect how Adaptive Performance alters your game’s performance via Indexers and Scalers. With Device Simulator, you can enable different Scalers to see how Adaptive Performance accommodates your device when it is throttling.
For example, you can allow Adaptive Performance to tweak the Shadow settings when the GPU is set as your bottleneck and the warning level is set to Throttling with an increase in both thermal trends and levels. You can also override the Scaler with the slider to test individual settings.
Creating custom scalers
Adaptive Performance empowers the creation of custom scalers to enhance and expand on the ways that game settings are controlled. This includes settings that are not automatically provided.
To implement a custom scaler, you must implement the AdaptivePerformanceScaler class.
Setting the QualitySettings.masterTextureLimit, for instance, prompts you to describe the texture quality and size per level.
Based on the current level of the scale, you can override the OnLevel virtual function and implement a scaling logic. The CurrentLevel that Adaptive Performance reports back can inform you to set the QualitySettings.masterTextureLimit to a higher value, which will then use a lower scaled texture mipmap of all the textures. When dealing with texture sizes, you can see that your custom scaler impacts visuals and specifically targets the GPU.
Describing a max level and boundary also ensures that your game’s visuals are not entirely lost, as higher leveled mipmapped textures make up half the dimensions of a lower leveled mipmap texture.
Adaptive Performance provides out-of-the-box features that allow your game to react appropriately to the current state of the device. To learn more about Adaptive Performance, you can view the samples we’ve provided in the Package Manager by selecting Package Manager > Adaptive Performance > Samples. Each sample interacts with a specific scaler, so you can see how each scaler impacts your game. We also highly recommend viewing the End User Documentation to learn more about Adaptive Performance configurations and how you can interact directly with the API. The documentation, along with other relevant links, can be found below.
Learn more about Adaptive Performance in our forums and by watching the tutorial video. You can also find out how to implement Adaptive Performance with our documentation.
9 replies on “Build stunning mobile games that run smoothly with Adaptive Performance”
Is this able to simulate android for Oculus Quest 2 development?
At this moment there is no Oculus Provider available.
Can I use those scalers working on Windows as the target platform?
At this moment there is no Desktop Provider available.
So which providers are available? Only mobile? Android only?
Are there plans to expand that? This solution would be useful on any platform of course.
If there is only one provider – for Samsung Galaxy – this should be called «Samsung Galaxy Adaptive Performance»
otherwise the current naming is MISLEADING
It’s available for Android on Samsung phones at this moment.
There is the Adaptive Performance main package which ships with the Simulator Extension so it can be run in the editor using the device simulator. Additionally there is the Adaptive Performance Samsung Android provider (package) which enables support on Samsung Android devices.
Other providers for other platforms are useful. Currently other providers are limited by APIs (not every platform has all APIs needed) and resource availability to create them.
Additionally, the provider API is well documented, open source and built to enable easy extension to other platforms/systems to incorporate your own providers at any time so you are not limited by what is currently available via the Unity Package Manager.
See also the provider documentation here: https://docs.unity3d.com/Packages/com.unity.adaptiveperformance@2.1/manual/provider.html
Thanks for reply!
But all Adaptive Performance blogposts – spanning several years now – are about Samsung Android only
I think it’s being kept afloat only because of Samsung since other providers API limitations – the API probably doesn’t exist – and lack of resources – in other words there’s probably nobody who wants to implement Unity provider public API on other platforms
Would be nice for this to change !
Thank you for the feedback ztw, really appreciate it!
We actively work with several partners in the industry to make it easier for developers to get the APIs necessary in this area as we think it is highly needed and beneficial to have a systems like Adaptive Performance even outside of Unity. Samsung and us share those believes for many years now which made it possible to have such a good cooperation and develop Adaptive Performance to showcase how useful device status information can be. As things are, anything this low level as the field of Adaptive Performance is, requires several years of cooperation and implementation until it is ready for end user applications or even reaches consumer devices. I recommend to stay tuned and follow our work as there is more to come for sure, as we work on very exciting things!
Also please join us in discussions and up to date info in our development thread in the forums: https://forum.unity.com/threads/adaptive-performance-package.652306/