Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Question Manual OBB Download Handling No Longer Necessary?

Discussion in 'Android' started by Neonlyte, Jul 9, 2022.

  1. Neonlyte

    Neonlyte

    Joined:
    Oct 17, 2013
    Posts:
    505
    I'm refactoring my existing project and have been considering the current situation on Android. I noticed that the Unity Docs since version 2021.2 removed any mentioning of the necessity of handling manual OBB downloads:
    https://docs.unity3d.com/2021.2/Documentation/Manual/android-apk-expansion-files-host.html

    As late as 2021.1, the Docs would instead say:
    https://docs.unity3d.com/2021.1/Documentation/Manual/android-OBBsupport.html


    The linked Android documentation says:
    https://developer.android.com/google/play/expansion-files.html#Downloading

    Thus, I'm wondering what has made Unity to remove the text around manual OBB download handling. Was there any promise made by Google that they will guarantee OBB will be installed (i.e. OBB install failures due to storage would cause the entire install to fail), or was it just because that the situation where OBB is manually removed or not installed properly is very unlikely nowadays?
     
  2. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,011
    OBBs are deprecated*. Use aab instead.

    *You can probably still use them for existing apps, not sure, but if you do, all the issues with obb are still there.
     
  3. Neonlyte

    Neonlyte

    Joined:
    Oct 17, 2013
    Posts:
    505
    I’m aware of the OBB limitations. I just don’t want to deal with the 512MB per pack limit and the 1GB initial download size of Play Asset Delivery, otherwise I would have to also refactor the asset placement and the loading mechanism.

    For my project, in addition to Unity’s main OBB, I also bundle a second OBB for resource files of an audio middleware that requires file access for streaming audio from disk. (That OBB is bundled using jobb tool and is just a FAT16 disk image that Android can mount using StorageManager and act like a read-only directory) That OBB alone is already 600+ MB due to the nature of my project, so to adopt Play Asset Delivery I have to slice it up, and if I add more audio in the future and the size of the install-time packs exceeds 1GB, I would have to strategize the asset placement so that players can start playing without seeing another download screen, and having some lookup table to know which audio resource locates at where. These considerations are significant that still having OBB option available to my existing project means I don’t have to consider them now amongst the other tasks I have to go through.
     
  4. mkg2w

    mkg2w

    Joined:
    Aug 19, 2013
    Posts:
    49
    I don't believe Google has made any promises of delivering the OBB. In fact, their documentation mentions the need to handle the edge cases when the file is missing (perhaps users deleting it, as it's on shared storage)

    There is a Downloader Library Google provides to download the OBB manually. Unity used to have a similar plugin on the Unity Store, but it's no longer available. From my what I understand, this library is primarily to download the OBB from Google's servers ; if you are hosting it yourself, a standard download handler with error handling should work.

    Do keep in mind that you can only use OBBs for existing games (my understanding is, games published before August 2021) .
     
  5. Neto_Kokku

    Neto_Kokku

    Joined:
    Feb 15, 2018
    Posts:
    1,751
    AFAIK popular games that don't fit the AAB constraints end up hosting and downloading data themselves. It's a shame AAB ended up making things more restrictive than OBB files for some use cases.
     
  6. Neonlyte

    Neonlyte

    Joined:
    Oct 17, 2013
    Posts:
    505
    Yes, it’s absolutely a shame.

    In contrast, Apple’s on-demand resources allows up to 20GB on server, 4GB downloaded to device at anytime, and there can be as many as 1000 asset packs. While Apple only allows app to load at most 2GB resources at any moment, it’s more than workable, and it’s extra allowance on top of the 4GB app bundle size limit, comparing to Google only allowing 2GB max for asset packs, 50 packs, and measly 150MB for base app.