To publish the game for Google Play Instant it is necessary that the size of the game should be less than 20 megabytes. (The maximum size for the instant version has been changed from 15 MB to 20 MB.)
"Sample log and volume of different parts without compression in the final output"
1- Reduce Game Size
First, read this:
Unity3D – Reducing the APK file size of your build for mobile device
Furthermore, there are a few tips that are not mentioned in the above documents.
-
You can force audio formats to be mono (Click on the audio file and enable the “Force To Mono” option in the inspector).
-
Remove any unused files in the Resources folder.
-
Sprites, Textures, and files like this shouldn’t be in the Resources folder or compression doesn’t affect them.
-
Crunch compression works only on sprites that have x4 width and height. Either resize them or use Sprite Atlas.
-
Game objects with a lot of children and in multiple depths can have a significant role in game size. For example, if you have a lot of enemies have each one has a rig and lots of game objects and components, consider making a script to instantiate them in runtime.
-
Reduce animation framerates in simple animations (more than 30 is overkill in most cases).
-
Compress meshes (Click on mesh and set “Mesh Compression” to the point that it doesn’t ruin its looks)
-
If the game has lots of levels, reducing them can be an option.
Considering the scale of the project, assuming the optimization of assets and removing unnecessary items, it may not be possible to reach this volume. This is where there is no choice but to use Asset Bundle.
Using asset bundles, you can reduce the size of the game and solve common issues.
2- Google Play Services
For saving and loading data in Google Play services you need to:
-
First, add the play services platform,
-
Then, enable saved games in the Google Play console (Once enabled, you can’t disable it),
-
After that, sign in to Google Play services,
-
and finally, save and load the game data as an array of binaries.
Here is the official documentation:
Add Google Play services plugin:
Get started with the Google Play Games plugin for Unity
And then add save and load capability:
Saved games in Unity games
You can also add achievements and resources when you’ve added the Google Play services plugin, but they are not mandatory.
Here is a cool step-by-step tutorial:
How to - Cloud Saving on Google Play Service [Tutorial][C#] - Unity tutorial 2019
3- Instant Play Games Technical Requirements Checklist
Instant play games technical requirements checklist | Android Developers