Search Unity

More insights about the android build size and optimizations

Discussion in 'Android' started by Suduckgames, Sep 5, 2019.

  1. Suduckgames

    Suduckgames

    Joined:
    Nov 28, 2016
    Posts:
    218
    Hi there, I am trying to reduce the android build as much as possible, after using the android app bundle and the Build Report from the editor log to reduce the "biggest" assets, I still want to make as much as possible.

    I am able to see the uncompressed usage of my assets but, Is any way to have a better insight about the exact size of the compressed assets? My game uses lots of textures and as far as I know, texture compression can make a difference in the size, so I will like to have more info.

    The only tool that I founded is a deprecated tool to analyze the build.

    My Report
    Code (CSharp):
    1. Build Report
    2. Uncompressed usage by category (Percentages based on user generated assets only):
    3. Textures               64.4 mb     61.2%
    4. Meshes                 8.9 mb     8.5%
    5. Animations             869.0      0.8%
    6. Sounds                 6.8 mb     6.4%
    7. Shaders                2.0 mb     1.9%
    8. Other Assets           5.3 mb     5.0%
    9. Levels                 6.1 mb     5.8%
    10. Scripts                2.6 mb     2.4%
    11. Included DLLs          6.3 mb     6.0%
    12. File headers           2.0 mb     1.9%
    13. Total User Assets      105.2 mb     100.0%
    14. Complete build size    158.0 mb
    Also, my game is a space theme game so I don't have lots of static objects however, "Levels" still is 6.1 MB, is anything more apart from dynamic baching? How do I optimize the "Levels" part?

    Thanks in advance, any tip will be welcome!
     
  2. kaarloew

    kaarloew

    Joined:
    Nov 1, 2018
    Posts:
    360
    In most cases only things that do matter are textures. And you can find size of each texture before they are LZMA/LZ4 compressed from Editor build log.
    https://docs.unity3d.com/Manual/LogFiles.html

    If you are in position to discard OpenGL ES 2.0 devices (this tip is for Android build target), then you can just use ETC2 texture compression (with or without alpha) for every texture.
     
  3. Suduckgames

    Suduckgames

    Joined:
    Nov 28, 2016
    Posts:
    218
    Thank you very for the suggestion! I have been using your technique to see the size of the texture before compression in order to optimize it, but can I see the size after the compression?

    I would like to discard OpenGL ES 2.0 devices but according to https://developer.android.com/about/dashboards it is 21% of the market that I don't want to lose! but I appreciate the tip!
     
  4. kaarloew

    kaarloew

    Joined:
    Nov 1, 2018
    Posts:
    360
    LZMA/LZ4 won't usually do anything special to compressed textures (unless you have lots of single color blocks in texture). So with compressed textures in most case the size you see in editor log matches size of file after LZMA/LZ4 compression.

    And that Dashboard figure includes ALL the Android markets. In most cases you do not want to target whole world. e.g. roblox devs have given their percentages out, and OpenGL ES 2.0 usage is near 12%
    https://gist.github.com/zeux/7d3ff56568c6b02de3a87cc69899d949
     
  5. Suduckgames

    Suduckgames

    Joined:
    Nov 28, 2016
    Posts:
    218
    Thank you very much for the information! You are right. Time to look at my own stats to see the OpenGL ES 2.0 usage then