Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    Dismiss Notice

Unite Europe 2017 - ResourceManager Feedback

Discussion in 'Asset Bundles' started by Ferazel, Jul 16, 2017.

  1. Ferazel

    Ferazel

    Joined:
    Apr 18, 2010
    Posts:
    355
    Unity Europe 2017 - Asset Bundles current and future


    Unity Europe 2017 - Roadmap


    I just saw the AssetBundle talk at Unite Europe and the roadmap discussion where the new resourcing system was mentioned. I'm really excited that you are looking into this problem in Unity as this has been a pain point since the beginning. Where are these assets stored and how do we best store and load assets in our game. The Resources folder always was the go to use for this problem, but obviously that doesn't give a great compatibility with AssetBundles moving forward or storing assets in different storage formats or locations. The other option is that the current direct references are loaded on object creation system works great if you don't mind load times and runtime memory spikes. So I'm really happy that you're considering using something else and looking into a different mentality for managing these resources.

    However, after watching the talks I have some concerns, and maybe those are topics problems that are not going to be solved initially by the system, but just wanted to provide some feedback.

    Strings are Fragile
    As the 2D system found out with their atlasing system, making a string for an asset is not maintainable and it is just a poor user workflow. Trying to keep the name of the asset in two places named the same is a headache. Naming everything from the "Group Name" and the individual assets just sounds like a difficult workflow to manage.

    Managers Aren't Connected to Assets
    When I see the current asset manager, I think it's great to access these resources at a high level, but if I have hundreds of assets packaged into dozens of asset bundles, I could see the editor becoming very unruly finding the necessary asset that I made addressable. There is just a management concern with the UI that was displayed.

    My recommendation:
    I think this would make much more sense at a another layer of abstraction of an asset that we could call a "resource asset". Let's say you have defined with data, 3 levels of quality in the game but a Low/Med/High preset for mesh and texture. Now lets say that you have a shrub manager that places shrubs throughout the world. Wouldn't it make sense that the shrub manager had a reference to a resource asset that referenced the GameObject asset as the game's data is currently setup for? The shrub prefab's mesh renderer and material would also have resource asset references to both a mesh resource asset and a texture resource asset respectively. These resource assets would act as intermediaries between a direct assets and would be usable in all places where that asset type can be referenced in Unity serialized field. These resource assets would also define their asset bundle (via an editor window picker) and other loading properties. This asset inspector would also include, would this asset be loaded/instantiated at deserialization, OnEnable, or manual loading (via a simple script API) in addition to which asset bundle assets are loaded from!

    I feel this type of approach could solve both of the problems I mentioned above. SerializedFields would still be referencing GUID links to the resource asset thus allowing for more desirable drag and drop Unity behavior. It would also allow users to work more closely with the setup of the data closer to asset level.

    You could still have direct asset links that would instantiate after deserialization. However, if you wanted to have more control, these resource assets could be used instead and a lot of the loading behavior could have common implementations done for the user automatically.
     
    rakkarage likes this.
  2. srivello

    srivello

    Joined:
    Jan 16, 2011
    Posts:
    16
    Great points.

    What is the timing of the New Unity ResourceManager? (repo, beta, docs, etc...)

    What is the timing of the New Addressable System? (repo, beta, docs, etc...)

    Will these become accessible to us as developers together or separately?
     
  3. Reichert

    Reichert

    Unity Technologies

    Joined:
    Jun 20, 2014
    Posts:
    63
    We've heard this concern quite a bit and have responded to that by adding a new type called an AssetReference, which essentially a weak reference to an addressable.

    Code (csharp):
    1. [AssetReferenceTypeRestriction(typeof(GameObject))]
    2. public AssetReference player;
    3.  
    4. void Start()
    5. {
    6.     player.InstantiateAsync<GameObject>();
    7. }


    This is a fair concern and we're keeping this in mind as we evolve the UI/UX. We want this system to scale to tens or hundreds of thousands of Addressable assets.
     
    rakkarage and Ferazel like this.
  4. Ferazel

    Ferazel

    Joined:
    Apr 18, 2010
    Posts:
    355
    This post is kind of a zombie because this originally was right after Unite Europe and before Unite Austin where the addressable system was displayed in more detail. I agree that the addressable system is definitely more what I had in mind and that UI you showed is there is looking like a great first step.

    For a second step, I'm trying to think of having designers and artists pick the right asset out of thousands of prefabs and not realize the requirements for that asset. Picking the wrong blue box out of thousands is kind of easy to do even with the name. Are there thoughts on adding restrictions with user-defined components/tags that we can also apply to these asset references? With tags, you might be back to the same strings are fragile problem mentioned above, but with components you couldn't add to certain assets (like Texture2D) to be accepted in the field or not. Maybe some sort of addressable tag manager scriptable object that we could centralize all of the strings into and add/remove/rename the tags types en-masse if needed? Then you apply the reference to the tag type to each of the assets via the addressable system? Regardless, not a problem that necessarily needs to be solved day 1, but something to think about.

    I'm really looking forward to the addressable system in my day-to-day Unity life so thanks for working on it!
     
  5. Reichert

    Reichert

    Unity Technologies

    Joined:
    Jun 20, 2014
    Posts:
    63
    We do in fact have a labeling system for addressables, and a way to restrict AssetReference types to specific labels:

    Code (csharp):
    1. [AssetReferenceLabelRestriction("characters")]
    2. public AssetReference player;
    Addressables can have any number of labels.
     
    Stormy102 and Ferazel like this.
  6. mons00n

    mons00n

    Joined:
    Sep 18, 2013
    Posts:
    233
    Are addressables available now? If not is there a rough timetable? It's difficult to find information on them besides the Unite Austin talk.
     
  7. Reichert

    Reichert

    Unity Technologies

    Joined:
    Jun 20, 2014
    Posts:
    63
    Yes, it's still on track for a 2018.2 release. We'll have more info as we get closer to that.
     
    Stormy102, optimise and mons00n like this.
  8. raybarrera

    raybarrera

    Joined:
    Nov 20, 2010
    Posts:
    205
    Hey @Reichert, I see the documentation live for the resourcemanager, but it seems the package has been pulled. Interested in test-driving this feature--any idea when the git project will be made available?

    Also sending a PM with some additional questions. Thanks!
     
  9. nilsdr

    nilsdr

    Joined:
    Oct 24, 2017
    Posts:
    231
    I second this. If you need testers please let us know, we have many usecases for this.
     
  10. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    468
    I ady see 2018.2b1 has been released. ETA which beta build will be available?
     
  11. Rocktavious

    Rocktavious

    Joined:
    May 10, 2017
    Posts:
    41
    Bump ^ Really looking forward to the AssetReference type - this is going to open so many possibilities - when can we test this out!!!!
     
  12. yang-yu

    yang-yu

    Joined:
    Mar 8, 2013
    Posts:
    21
    is ResourceManager available now?
     
  13. Reichert

    Reichert

    Unity Technologies

    Joined:
    Jun 20, 2014
    Posts:
    63
    It will be made publicly available via Packman closer to the 2018.2 release date. Thank you for your patience :)
     
    mons00n likes this.
  14. Stormy102

    Stormy102

    Joined:
    Jan 17, 2014
    Posts:
    495
    If you are really curious, you can modify the manifest.json in 2018.2 and add the references to the addressables asset system and resourcemanager manually - https://garry.tv/2018/04/16/unitys-staging-packages/
    However, ofc these are in development and are previews, not guaranteed to work, don't use in production etc.
     
  15. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    468
    Hi @Reichert, I have the use case that first time user downloads asset bundles from web server to the mobile phone and store them into the phone storage then second time it will load asset bundles directly from phone. Each time when you run the game, it will check for new updates then download or update asset bundles automatically if there is new or new version of asset bundle found aka differential patching. Do addressable and resources manager able to handle this use case out of the box currently?
     
    Last edited: May 4, 2018
  16. Reichert

    Reichert

    Unity Technologies

    Joined:
    Jun 20, 2014
    Posts:
    63
    Yes, is designed to make this particularly scenario very easy. You'll be able to delete a lot of code :)
     
    nilsdr and optimise like this.
  17. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    468
    @Reichert, thanks for replying. Btw will you guys open unity forum more frequently after releasing addressable package etc? I would like to give feedback.
     
  18. Reichert

    Reichert

    Unity Technologies

    Joined:
    Jun 20, 2014
    Posts:
    63
    We'll definitely be responsive to forum support for Addressables - we want to make sure we're really solving your problems. And because it is delivered via Package Manager, we should be able to roll out updates on a regular basis, without depending on full new Editor releases.
     
    optimise likes this.
  19. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    468
    @Reichert, awesome. Btw have u guys get the permission from Android and IOS platform to support game code differential patching without going through their respective app stores so not only art asset can have differential patching directly but also for game code?
     
  20. Reichert

    Reichert

    Unity Technologies

    Joined:
    Jun 20, 2014
    Posts:
    63
    I can't really speak to dynamic code/patching - my team is squarely focused on content building and delivery. I know other people are thinking about that, but I don't know the latest.
     
    nilsdr and optimise like this.
  21. Kichang-Kim

    Kichang-Kim

    Joined:
    Oct 19, 2010
    Posts:
    358
    @Reichert Does ResourceManager support these features?

    1. Assetbundle caching
    2. Pre download for essential assetbundles (or Download only method)
    3. Managing cached assetbundles (especially, clear downloaded caches)
    4. Encryption for catalog and asset itself

    And how ResourceManager identify that assets are changed? (Does ResourceManager provide "very small" hash value for entire assets?)
     
  22. Reichert

    Reichert

    Unity Technologies

    Joined:
    Jun 20, 2014
    Posts:
    63
    We have most of 1-3 implemented and plan to fully support all of those before release. #4 is something you'll have to implement yourself but should be far easier to do so within the system. Later on it may be something we will support as a first class feature.
     
  23. Kichang-Kim

    Kichang-Kim

    Joined:
    Oct 19, 2010
    Posts:
    358
    @Reichert Thanks for reply. ResourceManager looks very cool and I have some feature requests for moving our own asset management system to new ResourceManager system.

    1. Partial asset encryption (ex, encrypt only asset which has "Encrypt" label) or API for own implementing
    2. Checkig current status of ResourceManager for showing UI like "Downloading ..."
    3. Document and Samples for customizing ResourceManager
     
  24. David_GameDev

    David_GameDev

    Joined:
    Dec 25, 2016
    Posts:
    25
    Just wanted to ask if there are any News regarding the Resource Manager and Addressables, as I didn’t seem to find anything about it in the 2018.2 updates/features list. Just asking so I know whether to wait for it or should I rather start looking into asset bundles (the problem is just that the resource manager asset from Unity seems to be deprecated)
    Thanks in advance!
     
  25. nilsdr

    nilsdr

    Joined:
    Oct 24, 2017
    Posts:
    231