[MUSIC PLAYING]
ANDREW GIUGLIANO: Thank you for joining our session today,
where we'll do a deep dive on how you can use Play Asset
Delivery within your game to deliver
optimized assets to your users.
My name is Andrew Giugliano, and I'm
a developer advocate working to help developers be
successful on Android in play.
We'll also be hearing from my teammate Shenshen
later in this talk.
Before we delve into the product,
let's take a step back and look at a problem
developers are facing today and how we are helping to solve it.
When packaging assets within your game,
you have a few options.
You can place them all within your main game download,
but then you'd run into size limitations pretty quickly,
and it's overall a bad experience for the user
as they wait for their long downloads to complete.
You may choose to use a CDN.
However, this comes with its own limitations.
Downloads can't happen until after the game is launched,
so the user might be caught with an untimely download
prompt when first opening your game.
Features such as auto updates need
to be managed on your side, and then you'll
need to pay for the service.
So to help solve these problems, Google
launched Play Asset Delivery, or PAD for short, back in 2020.
This feature allows developers to dynamically deliver assets
to their game on play.
Today, we're going to start off by doing
a brief overview of PAD and how it works.
Then we'll do a deep technical dive
on integrating PAD so that you have the know-how
to start using it today.
Well also covers some new advanced features
which will allow you to optimize the assets you
deliver with PAD.
Finally, we'll talk about how a few of our partners
have found success with PAD and its new features.
Great.
So let's do a quick overview of the product.
PAD is built upon the Android App Bundle, which
allows you to upload a single artifact containing all
your code and assets and having Play deliver the right download
to your users.
This means that you don't need to upload
any of your game assets separate from your main game.
It will all be part of the same bundle
and upload to the same place you use today to deliver your game.
You will do this by packaging your assets into distinct asset
packs, which you will then download
during or after install.
As a side note, we also want to call out
that, by using the App Bundle, you
unlock other great features, such as Play as you Download,
which allows you to get users in your game faster.
Now, at the heart of PAD is the flexibility
we give developers to deliver their asset packs to their game
as they see fit so that they can create the best
experience for their users.
There are three ways you can deliver your asset
packs with PAD.
First, there's install time delivery,
which will download your asset packs along
with your main game download.
If you've used OBBs in the past, which we deprecated last year,
this is our replacement for packaging assets
at install time.
Next, there's on-demand delivery,
which allows you to dynamically request asset
packs in your client code post-launch.
This is similar to how a CDN might work today.
You only need to download the assets when you need them.
Finally, there's fast follow delivery, a unique feature
to PAD.
It's a bit of a mix of the two.
Fast follow pack is almost like an on-demand pack,
but instead of it being requested in the client code,
the download will be triggered right
after the main install's finished.
This way, users can enter your game
as soon as the main install is complete,
even if the fast follow download is not yet finished.
But by triggering the download right after install,
it is less likely your user will be stuck waiting for a download
after opening your game for the first time.
It's also worth mentioning that you
don't need to select just one of these modes
for all the assets in your game.
Each asset pack can have its own delivery mode
independent of the other.
Since our launch two years ago, our developers
have been loving to use Play Asset Delivery.
Just last year alone, the number of Android games using
install time delivery in production
has increased over 1,000%, followed
by 300% increase for those using fast follow and an almost 200%
increase of those using on-demand.
And no matter how big or small the developer, PAD can help.
Just since we last spoke with you about PAD
at the Google Free Games Dev Summit last spring,
we've had a number of new titles adopting this feature.
Here's a showcase of a handful of these titles.
So now that we've covered the feature at a high level
and showed some of the momentum PAD
has coming into 2022, let's dig into how you can start
using this in your games today.
Now, as a quick note, in this walkthrough,
we show the steps to implement using the Java SDK.
However, we also offer native SDK, Unity plugin,
and support for Unreal developers
to make it easier to integrate PAD with games built
on top of those technologies.
While there are differences between the SDKs,
at a high level, the implementation is similar.
Let's dig in to how to implement PAD with your game.
First, you will need to create a folder for your assets
separate from the main game, which will
be named after your asset pack.
In this example, we use asset_pack_0.
Next, create an empty file called build.gradle.
We'll populate this in the next step.
Finally, create a directory called src, main, assets.
In the assets subdirectory, you will
place your directories of assets which you
will be retrieving later on.
For the build.grade you just created,
you'll give some information on the asset pack as shown here,
namely the asset pack name-- the delivery type.
Notice how we set the delivery type at the asset pack level.
As you'll see, you can include multiple asset packs
in your game, and each one can have a different delivery type.
To finalize the configurations within your game,
you'll need to specify the asset packs
you're using in the build.gradle file at the app module
level and the settings.gradle file
at the root of the project.
In this example, we have two asset packs called
asset_pack_0 and asset_pack_1.
Finally, you'll need to make sure your Gradle build tools
are at Version 4 or above.
If you plan on using on-demand or fast follow,
you'll also need to include the Play Core library.
Great.
Now that you've configured your project to be ready for PAD,
let's get into the changes needed to your client code.
Now, for install time, this is easy.
There's no additional API touchpoint needed.
You can just use the asset manager
to access the assets on game launch.
Since they are delivered as part of the main game installation,
you can be sure the assets will be there.
And for fast follow and on-demand,
you'll need to do a little bit more work
to retrieve your assets.
First, you'll check to see if the assets are already present.
Next, you'll get the size of the pack being requested
so that you can let your user know
how much you'll be downloading.
You'll then register a listener to monitor
the status of the downloads-- trigger the download.
Finally, assuming all goes well, you'll access your assets.
Let's take a closer look at what each of those steps consist of.
You'll call getPackLocation to see if the asset
pack is already there.
If it is, you can then start to access the assets,
and we'll show you how later on.
If the call returns null, then that
means the asset pack is not present yet,
and you'll need to retrieve it.
Before kicking out the download, you'll
need to retrieve the size of the asset pack
you're requesting so that you can show the size to your user.
You'll use getPackState to do this.
You'll then create a listener to monitor
the status of the download.
You'll see a subset of those statuses in the code here
and can access information such as download progress or failure
statuses in case something went wrong.
You'll also see a waiting for Wi-Fi case here.
This is used if your user is on a metered connection
and the download is larger than 150 megabytes.
In this case, you'll need to trigger the UI flow shown
to get explicit consent from the user
before proceeding with the download.
Of course, make sure that later on in your code,
once the download completes, you un-register your listener.
Finally, we'll start the download with fetch.
Assuming all is well, you'll see the code
for retrieving the path to the folder containing your assets.
In other words, this will give you
the location of the asset subdirectory
you created in step 1.
If the download wasn't successful,
which could happen if the user cancels your download
or loses the network, you should then
notify the user as appropriate.
And we don't cover it in this talk,
but we also have methods for canceling requests in flight
from the client code or removing an asset
pack that's no longer needed.
So we've just covered a lot of code.
Let's take a step back and go over
at a high level what we just implemented.
First, you checked to see if the assets are already present.
Then, you retrieved the size of the packs being
requested to let your user know how much you'll be downloading.
Finally, you registered a listener
to monitor the status of the downloads,
started the download, and retrieved
the location of your assets.
Now that your game should be set up for using PAD,
you can use the local testing tool as a part of Bundle tool
to test out your integration before uploading to Play.
This is a great way to quickly test and iterate
during the development phase.
As you can see, you supply the Android App Bundle artifact
in the first call to create an APK set
with local testing turned on and then supply
that APK set to the install command
to download your game to your device.
Finally, once you're confident with your PAD implementation,
you can upload your game to the Play Console,
similar to how you do so today, and start delivering the game
to your test users.
You'll see on the Play Console that there are even
some extra features for App Bundles,
such as the App Bundle Explorer, which
will show you which asset packs you're using in your game.
And that's it.
Your game is now set up to use PAD
to deliver your game's assets.
Now that you've done the work, you
can let Play take care of the rest.
Now let's cover some additional features you get with PAD.
For this section, I'll pass it off to Shenshen.
SHENSHEN CUI: Thanks, Andrew.
My name is Shenshen Cui, and I'm a developer advocate
on Google working to help developers to be
successful on Google Play.
Let me walk you through a few more features with PAD
and to introduce something new.
Even after the first download, you
can be rest assured that your users are
retrieving the updates.
We have built-in supports for updating assets.
Additionally, with delta patching,
we are reducing update size by only
delivering the bytes needed.
If you want more [INAUDIBLE] updates,
you can use our In-App Updates library to do so.
You have a 2-gigabyte cumulative size limit for all asset packs,
and 1-gigabyte size limit for install-time packs
specifically, and a 512-megabytes limit
to each fast follow or on-demand pack.
You can have up to 50 asset packs
included in your App Bundle.
Games will all experience different impacts.
But in this particular instance, Devsisters recently
migrated their top title, Cookie Run:
OvenBreak to Play Asset Delivery.
PAD helped the game to reduce the binary size
by 23%, which shows a positive impact on day 1 retention.
What is more-- since the game doesn't have to rely on CDN
and download after migration, they
can save around $200K per year on that front.
Now that you are set up to use PAD to deliver your assets,
let's look at some new features we
called Smart Delivery, which allows you to send optimize
the game to our users.
First, we allow you to send texture compression format
specific assets to your game so that you
can optimize for the devices that you are sending to.
Next, with device tier targeting,
you can deliver several versions of your assets
to different tiers of device as you defined.
Let's take a closer look.
Texture format targeting works by only
sending one version of the assets
according to the texture compression format.
And the Play will automatically identify and deliver
the best fit to our users.
To enable this, you just need to create your assets pack
as shown before, and separated folders
by different supported formats.
After this changes, Play will take up
the rest to make sure the right assets are
downloaded to a user's device.
And your game can use the same file path
to access the right assets, regardless of the format.
Let's talk more about device tier targeting.
You can create different quality levels of assets
and deliver an optimized version for different tier of devices
according to the hardware specs.
In the example here, I have three tiers
for devices with 5 gig and above, 1 to 5 gigabytes,
and below 1 gig.
The three set assets with different level of quality
can be delivered to the device accordingly.
Similar to texture format targeting,
you will need to split the folders by different tiers
and supply your different quality level of assets.
Then you will tell Play how you want to deliver
the different tiers of packs.
After that, Play will take up the rest.
You might be wondering-- we always
have the idea that the installation success
rate is highly correlated with the download size.
So many developers put huge effort
into making the initial install size as small as possible.
However, our recent study tells a bit different story.
If you are able to deliver the suitable assets
to the right device, the downloading size
actually won't limit of the number of users you acquire.
Moonton is using device tier targeting
to optimize assets delivery in one of the best-performing
mobile games, Mobile Legends: Bang-Bang.
Previously, like many other developers, the [INAUDIBLE] APK
size is small, below 150 megabytes,
and asked users to download extra gigabyte size
assets after starting the game.
Now, with App [INAUDIBLE] device tier targeting,
low-end device will still get low-res assets
for a couple of hundred megabytes,
while high-end device get more than 1 gig HD assets directly
from Play Store.
They actually get a similar or even better
install success rate across regions.
With the better-quality assets delivered to the devices,
players can enjoy a much better onboarding experience.
Thanks for joining us, and use the link
to find out more resources on what we covered.
Use PAD today to optimize your assets delivery.
[MUSIC PLAYING]