Search Unity

Feedback Universal Assets Management

Discussion in 'Asset Bundles' started by JesOb, Jun 14, 2020.

  1. JesOb

    JesOb

    Joined:
    Sep 3, 2012
    Posts:
    1,109
    Do you want to have system that allow you to create:
    • DLC and/or MODS that add/replace assets in original game without special architecture
    • Localised assets
    • Holidays specific assets that replace few assets in already running game to new thematic ones
    • Different asset packs for different devices without specific code to support that
    • Live link system that will deliver every asset directly from connected editor and redownload it on change. Not only for ECS and in easy way
    • Custom cache system like Unity Accelerator if you wish
    • Custom Addressables system to load part of game assets on demand with ease
    • Do all stuff above simultaneously :)
    Just simple core system that covers asset management in Unity universally on every platform and even in editor

    All this can be done with simple core concepts of managing assets - FAT, AssetRef, AssetBundle and Chain.

    Concepts

    FAT - (File Allocation Table) is simple in memory file system that looks like Dictionary<AssetRef, (AssetBundle+Offset, MemoryPointer)>
    AssetRef - (guid+localId) must be part of core and serve as WeekReferenceToAsset that can be loaded on request
    AssetBundle - is just BundleOfAssets that can be packed together and loaded in runtime into FAT
    AssetDeliveryChain(ADC) - is chain of AssetDeliveryManagers(ADM) that can deliver assets into FAT on request

    Work details
    • Everything is just a DATA in FAT - Dict that we can look at and modify. It can store 3 states for any asset.
      • 0. AbsentKey - FAT dont know anything about asset
      • 1. Know about asset but not loaded into memory, just know where to load it from (AssetBundle+Offset)
      • 2. Know about asset and it loaded into memory and we have instance
    • If FAT dont have some key on request it try to load that asset through AssetDeliveryChain
    • AssetDeliveryChain is chain of systems that can load asset into FAT. When FAT request asset X32Y than one of managers in chain (topmost that know how) will load (may be from inet) AssetBundle with this asset, fill FAT with info about all assets in Bundle state 1. So every new request for any asset in Bundle will be just loaded into memory from known path. Then asset X32Y loaded into memory and ADC return status success to FAT. New requests to this asset in FAT will be resolved by FAT immediately.
    • AssetBundle must be the only way to serve persistent assets in Unity.
    • We can unload asset from FAT moving it state from 2 to 1 to 0.
      • Can unload only from memory moving asset to state 1. Nearest request of asset will cause FAT to load asset from known path again.
      • Can remove record in FAT moving asset to state 0. Nearest request of asset will cause FAT to request asset through ADC
    Default Implementations
    • AssetDatabaseADM - is just editor ADM that will load assets on request through Editor.AssetDatabase and reload them on asset change.
    • DiskBundleADM - default runtime ADM that can load assets from bundles that packed with game
    • DiskResourcesBundleADM - default runtime ADM that can load assets from ResourcesBundle by name. It just will store assetnames on pack and convert it to AssetRef to pass into FAT for default resolve.
    Custom Implementations
    • DLC - can me just ADM that will load assets into FAT replacing all default assets with assets in DLC
    • MOD - is the same as DLC
    • Addressables package is just one ADM to the system with details and some EditorUI to create bundles, no need to use special Addressables Api to load/unload assets
    • LiveLink ADM that will load all requested assets directly from connected Editor
    • Just unlimited field of possibilities, flexibility and use cases…
    • Tricks like in SpriteAtlas will be available to users and in runtime too.
      We can in runtime create atlas from sprites and remap refs in FAT to point to different actual sprite
    AssetBundles
    Unity in process to create AssetBundles2.0 solution as I know :)

    Please make them universal, I really want to create 1 bundle and use it on ios and android because there just no single difference in content itself.

    Please Unity, make it base and the only way to load game content in runtime.
    Just remove default other way and make asset bundles the only way to do content in Unity

    That way you will create one system and make it just work in every condition and cases when AssetBundles can not pack/load something will end :)
    For simple projects just treat all assets in Assets folder as 1 giant assetbundle. All Resources folders just another AssetBundle and thats it. DiskBundleADM will load everything as needed :)


    Unity Cloud Content Delivery

    Please dont base it on Addressables base it on AssetBundle and simple ADQManager that just load assets from UCD, so we can create another systems that can work with UCD with ease and Addressables will be just solution from Unity
     
    CameronND likes this.
  2. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,618
    What about platform specific stuff?

    Compiled shaders come to mind. Or textures. DXT isn't natively supported on iOS for example. Some platforms support hardware encoding for specific audio/movies formats that other platforms don't support.

    How would that be handled?
     
    Last edited: Jun 22, 2020
  3. JesOb

    JesOb

    Joined:
    Sep 3, 2012
    Posts:
    1,109
    Compiled shaders is the only one I want to have different bundle per platform all other mostly the same
    difference only between Arm and x86 where on arm we have ASTC or ETC on x86 we have DXT
    All other files like scenes game data, meshes... is the same.

    I actually want to have only one bundle version for all arm devices (mobile) because they dont differ (except compiled shaders :))
     
  4. unity_bill

    unity_bill

    Joined:
    Apr 11, 2017
    Posts:
    1,053
    Thanks for your feedback. If I'm reading this right, your feedback is essentially "scrap the current system and start over". Which I suppose is fair if you don't like the current system.

    I will say several of the points you made align with your plans for DOTS. Many of the concepts in Addressables today will instead be baked into the core of DOTS. Things like asset references. So, as we work on the core pieces of the new runtime, we will definitely keep this feedback in mind. Of note as well, our intention eventually is to create a wrapper around this so that those not using DOTS could still benefit from the newer system. Though details on that are still being figured out.

    There is no AssetBundles2.0 in the works, but instead, for DOTS there is a "blob asset" file. Right now that means different content is built into different files. Long term, I believe the intent is to move more and more types into the blob format, but I'm not sure exactly how that will play out.

    not so sure about this one. Someone already mentioned shaders, but there's also texture format. Right now, with bundles, there are also restrictions around how the type trees are serialized. Perhaps the blob format will open up doors for more flexibility here though.

    The delivery service is completely independent of Addressables. You can use it with or without addressables. And in fact with or without Unity.
     
  5. JesOb

    JesOb

    Joined:
    Sep 3, 2012
    Posts:
    1,109
    Thanks for response :)
    New DOTS system looks exactly like start over :)

    Main idea was to allow most low level access to assets system so we can load, unload and replace part of loaded assets by layers system (memory file system sandbox). Have universal asset reference type like GUID+internalId so loading through string names will be additional optional feature :)

    Hope new system for DOTS will be as great as DOTS itself :)
    Looking forward for news about it :)

    Good to know thanks :)