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. Join us on Dec 8, 2022, between 7 am & 7 pm EST, in the DOTS Dev Blitz Day 2022 - Q&A forum, Discord, and Unity3D Subreddit to learn more about DOTS directly from the Unity Developers.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

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:
    50
    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,356
    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:
    50
    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,356
    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.