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.