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. Dismiss Notice

Add the ability to download non-async pls.

Discussion in 'Addressables' started by unity_5fpsmegasupergiperprogramer, Apr 9, 2019.

  1. unity_5fpsmegasupergiperprogramer

    unity_5fpsmegasupergiperprogramer

    Joined:
    Dec 1, 2017
    Posts:
    101
    Why Addressables ONLY async ??
    Very uncomfortable!
    Add the ability to download non-async pls.
     
  2. BinaryEclipse

    BinaryEclipse

    Joined:
    Sep 1, 2016
    Posts:
    43
    addressables will never be async because it needs to determine dependencies and stuff. You can always create one asset at the start and Instantiate based off that and it'll be sync
     
  3. joshcamas

    joshcamas

    Joined:
    Jun 16, 2017
    Posts:
    1,268
    It would be nice to have the option to by synchronous. Since the whole point of addressables is for us to be able to build our own asset management system, we should be able to decide whether our asset management system is async or not. For example, our asset management system may load the assets in the beginning, then use addressables to find the asset that has been loaded.

    I personally plan on adding a extension that will allow for synchronous loading (assuming this is possible), I'll post it here when I make it :)
     
    zhuxianzhi likes this.
  4. unity_5fpsmegasupergiperprogramer

    unity_5fpsmegasupergiperprogramer

    Joined:
    Dec 1, 2017
    Posts:
    101
    Okay, async Addressables = USLESS
    Resources aync / non async > Addressables async

    nice new technology.
    EASY
     
  5. MNNoxMortem

    MNNoxMortem

    Joined:
    Sep 11, 2016
    Posts:
    723
    Async addressables are not useless. Learn how to write async programs around them. They are more complicated, but they are definetly not useless.
     
    dzamani and Rotary-Heart like this.
  6. unity_5fpsmegasupergiperprogramer

    unity_5fpsmegasupergiperprogramer

    Joined:
    Dec 1, 2017
    Posts:
    101
    learn basic materiel
     
  7. joshcamas

    joshcamas

    Joined:
    Jun 16, 2017
    Posts:
    1,268
    Yeah async is absolutely not useless at all. Half the point of async is to use in tandem with servers and such, and imagine what happens when you use synchronous functions with a server. :^) Please try to control yourself when asking for features on this product you're using for free.
     
  8. unity_bill

    unity_bill

    Unity Technologies

    Joined:
    Apr 11, 2017
    Posts:
    1,053
    don't want to chime in too much on the sync vs async debate here, but I will point out that the thread request is the absolute worst case for a sync call. Doing a blocking download is pretty much completely out of the question. If you are blocking your game's entire loop while something downloads, you should fix that.
     
    MNNoxMortem likes this.
  9. joshcamas

    joshcamas

    Joined:
    Jun 16, 2017
    Posts:
    1,268
    I agree, absolutely. However, since addressables (as far as I can tell) are a general way to address assets, enforcing a asynchronous system is not the best. For example, lets say I have already loaded all of my assets. The addressable system would simply grab the asset, which of course wouldn't need to be asynchronous.

    I'll I'm saying is that in my eyes, both async and sync can be used in their own ways. Since addressables core is a way to control how assets are requested, I personally believe it would be useful to allow the developer to choose how they're going to use the system.
     
  10. unity_5fpsmegasupergiperprogramer

    unity_5fpsmegasupergiperprogramer

    Joined:
    Dec 1, 2017
    Posts:
    101
    No.sync in fade transition.

    Fade in, load data sync, Fade out.
    Well, will you remove sync load from Resources ?????
     
  11. unity_bill

    unity_bill

    Unity Technologies

    Joined:
    Apr 11, 2017
    Posts:
    1,053
    Let's use that example. so you have to do `Addressables.LoadAsset("thing")`, then some time later call something like `Addressables.InstantiateSync("thing")`?
    The key problem is exactly what you mention... "lets say I have already loaded all of my assets". What happens if you call `InstantiateSync` too soon? do we throw an exception? return null? Now does your game code surround all of the `InstantiateSync` in a bunch of safety logic that does some sort of callback or yield if the sync call fails?

    This sort of interface is not one we can safely provide for the general case. That being said, we have on our to-do in the coming months to create a sample of how a user could create sync wrappers for certain scenarios in their own game. Odds are these will place restrictions on the game flow (such as enforcing that all relevant things are loaded while in a loading screen). So depending on you use case, we want to empower you to create the flow you want, without us needing to create flows and APIs that will always work in the general flow.

    -Bill
     
    MNNoxMortem likes this.
  12. unity_5fpsmegasupergiperprogramer

    unity_5fpsmegasupergiperprogramer

    Joined:
    Dec 1, 2017
    Posts:
    101
    thx, need async and sync variants!
    Analogue Resources
     
  13. DevinW

    DevinW

    Joined:
    Jun 19, 2014
    Posts:
    36
    It would really be nice if this was an option. I'm storing some very small data in some scriptable objects and really do not need to shift everything depending on them to async.
     
  14. AlkisFortuneFish

    AlkisFortuneFish

    Joined:
    Apr 26, 2013
    Posts:
    959
    Have a look at the SyncAddressables sample. I've had success using it for this sort of thing while prototyping transitioning existing sync load code over to addresables. I did not end up using it in production in the end, as I refactored the code instead, but it could well provide what you need.