Search Unity

Unity assetbundle file management issue

Discussion in 'Asset Bundles' started by Gubendran_Vins, Apr 11, 2022.

  1. Gubendran_Vins

    Gubendran_Vins

    Joined:
    Mar 20, 2018
    Posts:
    62
    Hi all,

    - What is the maximum file size is assessable in unity WWW?

    - Any other option to download the asset bundle in unity except : unitywebrequest?

    Suggest me to get clarification on above.

    Thanks in Advance.
     
  2. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,732
    There is no general limitation. Load time plays more important role here and more smaller asset bundles will often win against single large one.

    You can use anything to download it. UnityWebRequest only allows you to download and load it efficiently and has integration with built-in caching system. If you chose other means of download, use one of AssetBundle.LoadFrom functions to load it.
     
  3. Gubendran_Vins

    Gubendran_Vins

    Joined:
    Mar 20, 2018
    Posts:
    62
    Thanks @Aurimas-Cernius

    We are using the Unitywebrequest to download the files completely, while we are trying to save the file using the file.writeallbytes its working properly if size is less than 200Mb in android VR, but we trying to download the files and save using file.writeallbytes whos size is near 800Mb after downloaded completely, we call save function its cause crash in VR app.

    Suggest me to get clarification on it.
     
  4. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,732
    Multiple things here.
    First of all even 200MB asset bundle sounds larger than recommended. If possible, you should consider splitting your bundles into multiple.
    If you use File.WriteAllBytes, you should have entire bundle in memory. 800MB is a lot of memory, even on desktop machine, let alone Android. UnityWebRequest does have a feature called DownloadHandlerFile, which would write downloaded bytes to file with very low memory usage.
    If you used UnityWebRequestAssetBundle, you could donwload and cache the bundle to builtin cache as single operation. There should be a good reason to implement caching yourself as opposed to using built in one.
     
    drillingvr likes this.