Creating an instant game with Google Play Instant and Unity

By Andrew Giugliano (Developer Advocate) and Benjamin Frenkel (Product Manager)

Andrew Giugliano
Jan 17, 2019 · 9 min read
Image for post
Image for post

Since Google Play Instant was first announced in March 2018, game developers have been able to create incredible experiences that instantly immerse players in a game. With a number of ways to discover and access instant games, from the TRY NOW button on Google Play to a simple link shared between two people, it’s easier to engage new players and showcase your games. Within this blog post we will show you how to build a production-ready instant game from scratch using Unity, as well as some benefits to having an instant game.

With Google Play Instant, you can bring your game to the next level by:

Image for post
Image for post

1. Increasing discoverability

Google Play Instant makes it easier for players to discover and test your game. With just a single click, they can launch your game from the Google Play Store, where a TRY NOW button will appear aside the Install button, or by tapping a web banner that links directly to your instant game from a mobile site.

Image for post
Image for post

And it doesn’t stop there. Users can also try your instant game from links you share across Google Search, social media, messaging, emails, and many other platforms.

Image for post
Image for post
Instant games can be launched from several different mediums
Image for post
Image for post

2. Driving installs

Since players don’t need to commit to “installing” your game before trying it out, it is easier for them to test your game out. With instant games, users don’t need to wait for the game to download, or decide whether the game experience will justify the storage space on their device. Instead, they can try out the best of your game, then you can give them a chance to install the full version without ever having to leave the experience.

Image for post
Image for post

3. Improving retention

By offering players a taste of your game, Google Play Instant helps players feel more confident that your game is worth installing. This could lead to less players uninstalling your app right after download. The users who download your game are more likely to enjoy it, too, which can help you increase the number of players who then download your game.

Game developers have already seen the difference instant games can make to their existing installed games:

And that’s just the start. Check out other developers who also found success with Google Play Instant.

How easy is it to integrate Google Play Instant with your Unity game?

You can build an instant game and publish it to the internal test track within a matter of hours. There, you can test and showcase your instant game internally if it exceeds the 13.5 MB limit for games built with Unity. You’ll also see the TRY NOW button on the Play Store. After publishing on the internal track, we have seen developers also focus on the following:

  • Defining what their instant game should look like.
  • Reducing their instant game size to under 13.5 MB (the limit for instant games built with Unity).
  • Running their instant game through tests and QA to ensure that it gracefully manages sandbox requirements and permissions that respect user safety. (We recommend testing on different versions of the Android OS — at least Nougat and Oreo)

How long it takes will depend on the implementation details and complexity of your game.

What comes next?

Create your own instant game in five steps.

Image for post
Image for post

Step 1: Setup your work environment

Before you start creating your instant game, walk through the checklist to make sure you have everything you need.

  • Unity 5.6 or later (we recommend at least release 2017.4)
  • Google Play Instant Plugin for Unity (asset store) (source)
  • An Android device (physical or virtual) running Android 5.0 (Lollipop) or higher with Developer Mode turned on and USB Debugging enabled
  • Access to your company’s APK source code to build debug and release versions.
  • Set up internal test track in Google Play Console
  • Sign up for the Unity Development Beta (mandatory for production)
Image for post
Image for post

Step 2: Building & testing your instant game

Next, you’ll convert your existing game to an instant game. Don’t worry about reducing size or building out the instant journey yet — this just gives you an example of what the process looks like.

  1. Select PlayInstant → Build Settings
Image for post
Image for post
1: Find the Play Instant Build Settings

2. In the build settings pop-up, set Android Build Type to Instant.

  • Unless you have already configured a Digital Asset Link, keep the Instant Apps URL field blank.
  • If needed, you can specify alternative scenes you want to use in the Override Scene field.
  • If you are using Asset Bundles, specify the appropriate manifest file in the AssetBundle Manifest field.
  • Click Save when finished.
Image for post
Image for post
2: Configure Play Instant Build Settings

3. Select PlayInstant → Player Settings. In the player settings pop-up:

  • Click the Update button next to items in the Required changes list to fix any settings before running the instant app.
  • We also recommend updating the settings within the Recommended changes, which primarily focuses on reducing size.
  • Close the pop-up when you’re done.
Image for post
Image for post
3: Configure Play Instant Player Settings

4. Now that the instant app is configured, select PlayInstant → Build and Run to launch it on your connected device.

Image for post
Image for post

Step 3: Upload to the internal test track

Now take the instant game you created in the last step and upload it to an internal test track, which will allow up to 100 selected internal users test your instant game from the Play Store. Remember, your instant game does not need to be under the 13.5 MB limit to upload to the internal test track.

  1. Select PlayInstant → Build for Play Console
  2. Navigate to the Google Play Console, make sure the appropriate app is selected, and navigate to the Android Instant Apps tab.
  3. Choose Instant app internal test, and follow the instructions on that page to upload the file you created in step 1. For more information, read the guide about releasing an instant app.
Image for post
Image for post
Managing Instant App Releases on the Google Play Console

Note: Make sure you have properly configured the list of internal app testers so that the app is accessible. You can modify these settings at App releases → Instant app internal test → Manage Testers.

Image for post
Image for post

Step 4: Reduce size to meet the 13.5 MB limit

Now that you’re familiar with the technical aspects of building an instant game, it’s now time to start conceptualizing how that might look and to reduce the size. Don’t worry if your game is large — developers with games over 350MB have still been able to launch instant games. Here are some techniques to help reduce the size below 13.5 MB:

Optimize Player Settings

As we saw earlier, PlayInstant → Player Settings offers a number of recommended changes to reduce game size. Make the following updates to reduce your game’s size:

  • Mono builds should use code stripping
  • Graphics API should be OpenGLES2 only
  • IL2CPP builds should enable engine stripping

Simplify Game Content

Don’t try to fit your whole game into the instant app. Your instant game should just give players a taste of the full experience, such as a tutorial or a few exciting levels. Remove unneeded content such as textures, models, images, or audio clips that isn’t core to gameplay.

Finally, compress assets to further reduce the size by reducing:

  • The resolution of your textures
  • The number of polygons in your 3D model
  • Audio quality

Read more about instant game UX best practices.

Use Asset Bundles

Asset Bundles allow you to load assets dynamically while the instant game is running. If the assets aren’t downloaded until runtime, they won’t count against the 13.5 MB limit. This is a common way for game developers to reduce the size of their instant games. The three main components you’ll need are:

  1. An Asset Bundle created from the scene(s) of your instant game
  2. A user-friendly loading screen that keeps the user informed while the Asset Bundle is being fetched in the background
  3. A web server or content delivery network (CDN) to host the Asset Bundle

Next, we’ll show you the fastest way to leverage the power of Asset Bundles by using the Quick Deploy tool included with the Google Play Instant Unity Plugin. This will take care of the first component by creating an Asset Bundle, and the second component by creating a loading screen that will fetch your Asset Bundle. For the third component, you can host your Asset Bundle anywhere that supports HTTPS and publicly serves files — this could be your own server, Google Cloud Storage, or another 3rd-party CDN.

Note: While you can use as many Asset Bundles as you like, each Asset Bundle must be less than 15 MB in size.

1. Select PlayInstant → Quick Deploy

2. Select the Bundle Creation tab, and choose which scenes you want to serve dynamically. Once finished, select Build AssetBundle at the bottom, and upload the resulting file to your web server or CDN.

Image for post
Image for post
2: Select scenes to include in AssetBundle

3. Select the Loading Screen tab and configure the URL associated with your Asset Bundle, as well as any background textures you want to use for the loading screen. (The default one is fine.) When you’re finished, select Create Loading Scene..

Image for post
Image for post
3: Configure AssetBundle URL and loading scene

Now you should have a loading screen that will load your Asset Bundle. You can find the custom script that Unity auto-generated within the new loading screen scene if you want to see how this is done or to customize it.

Image for post
Image for post

Step 5: Convert your user from instant to installed

Finally, you will need to build a way for your player to convert from your instant game to the full game. If you need to, you can transfer player data over during the conversion using the Cookie API included with the Google Play Instant Plugin for Unity.

Upgrade from an instant app to an installed app

Your instant game should offer a way for the player to install the full game, like a prompt or a button that doesn’t get in the way of the experience. Once the player is ready to install your full game, call the ShowInstallPrompt method provided by the Play Instant Plugin to hand off the install journey to Google Play:

using GooglePlayInstant;public void install() {    InstallLauncher.ShowInstallPrompt();}

Persist data when upgrading to installed (optional)

In some situations, you may need to carry some information over about your players’ instant experience when they convert to your installed app. For example:

  • When players buy in-game items, levels up, or customizes their character
  • If the instant game is similar to the tutorial in your installed app, the player can skip the tutorial after they install the full version
  • To reward players for converting from the instant game to the installed game

You can use the Cookie API packaged with the Google Play Instant plugin, which will allow you to easily write and read strings of data before and after install, respectively:

1. Call CookieApi.SetInstantAppCookie to store a string of data within your instant game.

using GooglePlayInstant;public void StoreData(string data) {    CookieApi.SetInstantAppCookie(data);}

2. Call CookieApi.GetInstantAppCookie within your Installed game to retrieve the string of data

using GooglePlayInstant;var data = CookieApi.GetInstantAppCookie(data);

These steps should help you navigate the process of creating a game with Google Play Instant. If you need more help, you can check out more resources and documentation on Instant Games, browse frequently asked questions, or read more about instant apps here.

Google Play Apps & Games

Tips, trends, and industry thoughts for app and game…

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store