Search Unity

Are AssetReference dependencies mapped during Analysis?

Discussion in 'Addressables' started by Pasketi, Sep 27, 2019.

  1. Pasketi

    Pasketi

    Joined:
    Sep 27, 2019
    Posts:
    3
    Hi!

    I'm having an issue. I use a long list of identifiers and configuration data to match assets to received data in my project and after having used direct object references, Asset Bundle addresses and now addressables I've had a few issues along the way. The most recent issue is related to asset duplication and analyzing it using tools included in Addressables.

    The configuration was previously kept in Resources folder, but I want to move out of it so that I have only one place to load assets in my game, including the configuration and asset data lists. I would like to use Asset References for determining the asset location, but my configuration data contains so much data and asset references that running Addressable analysis tools reserved 130+ GB of my 16GB of RAM because of all the connections (Most likely using swap as well). The analysis never completed and instead my computer ran out of memory. I need to be able to run the analysis to map and split the shared dependencies within my game assets to separate bundles.

    Q: I know that AssetReferences won't affect my application memory footprint before I load the assets themselves, but do AssetReferences cause dependencies during Addressable analysis? (Can AssetReferences cause Asset Duplication warnings during analysis)

    Q: Would it be better to change all existing direct object references to AssetReferences or to asset addresses as strings?

    Thanks in advance
    - P
     
    mitaywalle likes this.
  2. AlkisFortuneFish

    AlkisFortuneFish

    Joined:
    Apr 26, 2013
    Posts:
    973
    Simply, no. An AssetReference is just a wrapper to an address, there is no serialized reference/PPtr to the object itself involved at all, so the engine does not treat is as a dependency.

    I would avoid having to type strings in manually, yes. Whether you use AssetReference for that or your own tooling is up to you of course. We use raw strings only where the address comes from the network or is created programmatically.
     
    Pasketi and unity_bill like this.
  3. luistorres_emvenci

    luistorres_emvenci

    Joined:
    Aug 23, 2021
    Posts:
    16
    I'm glad i've come to find this thread.
    I'm having issues where AssetBundles (groups) that should not get loaded on application start are getting loaded.
    I've tested my loading methods on a Empty project and has you said, it seems like AssetReference are not considered dependencies, however as soon as I try to load (in a similar way) on the main project, everything gets loaded on the load of the first scene...

    I've research a lot in the last couple of weeks, and I seem to not find a proper solution. Do you have any experience where a similar problem arise?