AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
It might not seem like a lot but imagine 10 audio clips like that, which together would take about 0.5 MB, that is quite a lot while working with Instant AppsĪs you see the basic high resolution image takes over 2MB of space in your build, but we can compress that too, by changing max size to 256×256, compression to “Normal Quality”, enabling Crunch Compression and setting up Quality to 50%, we reduced the size to only 127KB. After changing Quality to about 10% and Override Sample Rate to about 22,050 Hz, we managed to reduce the size by over 40 Kb! Here is an example of a compressed audio file which import size is 44,5 kb. Talking about the compression in Unity, we are going to show you some examples of how to reduce the size of your audio files and texturesĪudio Clips Google Play Instant Compressing Assets The part that is the most informative for us is SourceAssets, here we will be able to see which assets are the heaviest, so we can get rid of them or compress them. When you open this inspector window you will see information about your last build (the option won’t be visible if you haven’t build the game yet), looking like this: Google Play Instant Source Assets They have also provided a link for a useful editor script which allows us to analyze what goes into our build and how much space it takes.Īfter adding the script into your project a new option under the Window menu is available, called “Open last build report”. Unity made a great lecture about Optimizing Binary Deployment Size available here: How did we achieve it? All of the operations we have done are things that are built in Unity, without using external sources. It is still possible to use them in your Instant App, if necessary, but with proper optimization that we’re going to show you! Build Size Comparisonīasic size of an empty unity project is 22.5 MB, but when using unity 2018.2 and proper optimization (stripping everything that is not being used) it is 6.5 MB. It is important that many other plugins can take a lot of space in our APK, such as: DOTween, TextMesh Pro tools, etc. Asset Bundles are archived files containing platform specific Assets, those can be later loaded at the runtime. On top of that, we could download an additional asset bundle (max. Taking that into consideration, we are left with 3.5mb for the game. The compression allowed us the reduce size of our previous build by almost 1 MB (it makes a huge difference!!!), when the minimal APK size generated in 2018.2 is 6.5 MB. The new Unity 2018.3 which is currently in beta has even better compression. The version of Unity has an impact on the size of the build because of compression differences. We are using Unity 2018.2.17f1, but you could use any version higher than 5.6. However, we are going to share some useful tricks we had to use in order to get there. As mentioned in the previous part of the blog the app has to be under 10MB! For Games that were not built with this limitation in mind, it can be quite a challenge to reduce the size that much. This Google Play Plug-in is a useful tool made for Unity allowing players to try your game in an instant. What is Google Play Instant Plugin for Unity? We will get more into it in this article and focus on the optimization and tricks to make your build smaller. We did mention how to design an Instant App, and what steps to take while developing it. In the last part of our post available here: Google Play Instant Games – Basics and Business, we explained what an Instant App is and how useful it is both to user and developer.
0 Comments
Read More
Leave a Reply. |