[MUSIC PLAYING]
NICK TROST: I'm Nick Trost.
Welcome back to The Game Show, where
we're talking about what's new for game developers in Android
13, as well as the latest developments in Android
graphics.
Last year the Game Dashboard was introduced on Pixel 6
and Pixel 6 Pro devices.
With Android 13, Game Dashboard has
become part of Play Services, expanding its availability
to a wider audience.
Game Dashboard provides an overlay for quick user access
to actions like taking screenshots, streaming
gameplay, or adjusting performance preferences.
With the Game Dashboard, the user
can choose to prioritize performance,
prioritize battery life, or set a neutral default.
You can use the Game Mode API to retrieve this user preference.
Your game could do things like change your target frame rate,
adjust graphics settings, or take other actions to respond.
To use Game Mode, Android needs to note
your application is a game.
You do this by adding an app category
attribute inside the application element of your Android
Manifest, and setting the app category value to game.
You also need to add metadata entries,
declaring you support the battery and performance modes.
You can create an XML file in the appropriate resource
directory and reference it in the manifest.
Inside the XML file, you declare your support
by setting the supportBatteryGameMode
and supportPerformanceGameMode values to true.
To retrieve the current Game Mode,
you obtain an instance of the gameManager system service,
and then call its getGameMode function.
You should do this on startup and any time
your app regains focus to ensure that you have the user's
current Game Mode setting.
In Android 13, the Game State feature
has been added to the Game Manager.
Game State lets you provide Android with context about what
your game is currently doing.
You do this by creating a game state object
and passing it to the Game Manager,
using the setGameState function.
Game State has a Boolean parameter
that signals whether your game is in a loading state.
The Mode Parameter is used to distinguish your game
as in a menu, in interruptible or uninterrupted game play,
or displaying non-game play related content,
such as an ad or a web page.
You can include optional game specific metadata
with the Game State in the form of label and quality integer
values.
Setting a Game State gives Android contextual clues
that can help it apply interventions
to boost performance at key moments,
to do things like reduce startup loading times.
Next let's about adaptive performance.
Android 13 brings internal improvements
and increased device support for the adaptive performance APIs.
These APIs can help you avoid runtime issues
if a device begins to overheat.
They also let you give Android contextual information
about your most important CPU workloads.
There's never been a better time to integrate these capabilities
into your game.
Two important APIs are the PowerManager
and the PerformanceHintManager.
The PowerManager's thermal API lets
your game retrieve the current thermal status of the device.
Devices will perform performance throttling
to manage high temperatures.
This throttling can impact the runtime performance
of your game.
You can add a thermal status listener
to receive notifications about changes
to the thermal state of the device.
The PowerManager can also give an estimate
of how much thermal headroom is available
before the device begins severe throttling.
Monitoring the thermal state and estimated headroom
can help you make runtime adjustments to your game
to avoid thermal throttling.
You might take actions like reducing your target frame rate
or simplifying effects.
The PowerManager is accessible as a Kotlin or Java
API in API level 29 or higher.
It can also be accessed directly by C/C++ code through the NDK
on API level 30 or higher.
The PerformanceHintManager, available in API 31 and higher,
lets your game create hinting sessions for game threads
that are performance intensive.
The threads in a hinting session are
expected to have a periodic workload with a target duration
for each frame, for example, a rendering
subsystem with a target work duration of 6
milliseconds in the context of a 60 Hertz game frame.
After creating a hint session, you
report the actual work duration following each completed
workload.
You can also update your session's target duration
in response to changing conditions.
To see a sample project that implements
these adaptive performance APIs, visit the Android Game Samples
Repository on GitHub.
Finally, we're going to talk about Vulkan.
Android provides the industry standard
Vulkan API for high performance graphics
and compute functionality.
Vulkan is a powerful, flexible API
with lots of optional extensions, features,
and formats.
Vulkan profiles are a way to help manage that complexity.
A Vulkan profile defines a required set
of Vulkan extensions, hardware features, minimum capability
limits, and data formats that a Vulkan device must support
to meet that Vulkan profile.
For developers targeting Vulkan on Android,
we've created the Android Baseline profile.
You can think of the Android Baseline
profile as a minimum specification
to require when initializing a Vulkan device.
Compatible with Vulkan 1.0, the Android Baseline profile
includes a small list of required extensions
and requirements for features like the ASTC LDR texture
format.
For more information on the Android baseline profile,
check out its page on developer.android.com.
Android 13 introduces platform support for version
1.3, the newest version of the Vulkan API.
Device support for version 1.3 will grow over time.
In a future version of Android, Vulkan capable devices
will be required to support 1.3.
Vulkan 1.3 promotes many previously optional extensions
in the required features of the core API.
bufferDeviceAddress is example.
With bufferDeviceAddress, a shader
can load an address from a buffer
and treat it as a pointer in a storage buffer memory.
Vulkan render pass configuration and management can be
a significant amount of work.
Vulkan 1.3 requires imagelessFrameBuffer
can simplify render pass setup.
For rendering scenarios that don't involve multiple sub
passes, the dynamicRendering feature
can allow you to skip render passes entirely.
inlineUniformBlock and uniformBufferStandardLayout
bring finer grained control and access
to your uniform variables.
In response to developer feedback,
Vulkan 1.3 brings a new synchronization
functionality and usability improvements
with hostQueryReset, timelineSemaphore,
and synchronization2 that could help achieve optimal throughput
with complex workflows.
So that's what's new for Android game development.
The Game Dashboard now in Play Services,
with the Game Mode and Game State APIs;
improved adaptive performance, with the Power Manager
and Performance Hint manager APIs;
the Android baseline profile for Vulkan
and Vulkan 1.3 support in Android 13.
For more information on everything I've covered,
check out developer.android.com, our blog posts,
and the Android game samples repository on GitHub.
Until next time, happy game developing.
[MUSIC PLAYING]