Search Unity

Parallel downloads often causing issues

Discussion in 'Addressables' started by ImpossibleRobert, Jul 7, 2020.

  1. ImpossibleRobert

    ImpossibleRobert

    Joined:
    Oct 10, 2013
    Posts:
    530
    I have an interesting observation. I use addressables extensively. I have a number of levels that need to be loaded at startup. When I chain the loading, all is ok (except some weird exceptions being thrown about download errors which are simply not true as the assets have been loaded, but that is for a different thread). I wanted to utilize my bandwidth better and kick of coroutines loading all kinds of assets in parallel. That works mostly, but reproducibly not always. Some assets will randomly fail. Sometimes an image from a bundle will not be available for no apparent reason. Reloading will load this image but maybe another one not.

    My question is: is massive parallel loading of addressables (Addressables.LoadAssetAsync) with coroutines a supported scenario? I have the feeling the system gets confused and runs into race conditions. This is really unfortunate, as the parallel downloads were really promising and much faster than chaining. I am on 1.10.0 currently as 1.11.2 has a game breaking bug.
     
  2. ProtoTerminator

    ProtoTerminator

    Joined:
    Nov 19, 2013
    Posts:
    586
    Yes, parallel loading is supported and encouraged. In my WebGL game I parallel load assets through addressables without issues (though maybe not "massive", not sure what that means to you). If you are seeing issues, you should report a bug.
     
    ImpossibleRobert likes this.
  3. ImpossibleRobert

    ImpossibleRobert

    Joined:
    Oct 10, 2013
    Posts:
    530
    Are you also using Coroutines for loading and LoadAssetAsync?
     
  4. ImpossibleRobert

    ImpossibleRobert

    Joined:
    Oct 10, 2013
    Posts:
    530
    I have the feeling this happens if I have multiple parallel Addressables.LoadAssetAsync request to assets inside an addressable that is currently being loaded. Is it somehow possible this is not really bullet proof? I will investigate further as well.
     
  5. ProtoTerminator

    ProtoTerminator

    Joined:
    Nov 19, 2013
    Posts:
    586
    I'm not sure if they fixed it, but I did see mentioned before that requesting the same asset twice in the same frame caused things to break. I have my own asset manager that caches the operation, so if it's called multiple times it just returns the same operation, completely avoiding that issue.

    [EDIT] Also, no, I don't use coroutines. I use promises instead.
     
    gooby429 and ImpossibleRobert like this.