Asset Bundle Improvements

Hello!

As you have probably seen in other threads, we like to check in on the direction we are taking with our technology to make sure we are best serving you. In this thread we would like to discuss the direction of Asset Bundles with you. Instead of restating the long term roadmap and short term projects I’d rather just step back and listen to what you all have experienced and what you all are needing. Knowing a bit about you also helps us better understand your feedback so please consider the following questions to get this discussion going.

Who are you?

What kind of game are you trying to build or would like to build?

How do Asset Bundles fit into that? What use-cases do you have?

What are the GOOD things about Asset Bundles that you like?

What are the BAD things about Asset Bundles that you dislike?

How can we make it BETTER?

Thanks!
Erik

3 Likes

Small indie currently making 2d puzzle/word/trivia games but previously made a couple of games for BBC’s Top Gear.

A current game in development needs to download textures as we don’t want to include them in the build as there are a lot (1000s). I’ve looked at the pros/cons of using assetbundles (vs other methods).

Pros:

  • Good download size.
  • Can use compressed textures (low memory usage on device).

Cons:

  • Have to build for both iOS and Android.
  • Have to build again for each Unity version and keep all hosted to cater for people on different versions of app.
  • All textures must exist in a Unity project (long wait any time a reimport is required, e.g. Unity update, textures modified).
  • Will take a long time to build assetbundles (textures will be compressed again).
2 Likes

Are Asset Bundles extractable allowing the contents to be modified and then repacked?

Thats the only thing that would make them useful for me. Unity games have really crappy mod support because of propriety file formats and no tools to work with them.

1 Like

Here is the feedback from Labster’s development team.
We are creating laboratory simulations to give students an immersive learning environment.
We pack a lot of assets for each lab simulation in asset bundles containing either sets of assets or scenes.
We actually use XML definitions of the whole simulation and assemble it by downloading necessary assets.
Default look of the room comes from scene bundle with some assets already on exact position.
Other assets come as asset collection which we then pick out from on demand and place assets on correct position.

We hack around many restrictions that you made for new asset building system.
We simply don’t use asset bundles in the way you imagined it.
For example, we need to have some assets in more than one asset bundle.
So we can’t keep assigning asset bundles in Editor - we can’t assigning more than one that way.
We’re using BuildPipeline.BuildAssetBundles to build asset bundles with AssetBundleBuild configurations.
But we can’t put all the configurations at once because the system won’t build if it finds an asset in more than one bundle. Instead, we call that BuildAssetBundles method many times with different single AssetBundleBuild configurations to avoid that issue. That way we get valid .manifest file for that single asset bundle but .manifest for the whole set of bundles is unusable. It gets overwritten each time.
We tend to move built asset bundles around when the build is complete, so it would be nice to have the output location as an option in AssetBundleBuild.
We’re assigning asset bundles with our names of the simulations. Our names are case sensitive so we need to rename asset bundles again since they come out lower cased. And what happened to .unity extension? We have to add that again since our loading system was designed to use that extension.
You see, we have a lot of post processing in our code base to get the wanted results. We could do without those.
We’re building bundles for multiple supported platforms. It takes a lot of time to build them all.
We think it would be great if you could specify platform in the AssetBundleBuild. See if BuildPipeline could be optimized to only switch required assets for that platform instead of changing all the assets you have in your project.
We notice that iOS takes really really really long time to switch to and build for so we avoid building for that platform as often as we do with other platforms. We have to hack around using asset bundles built for WebGL when we try to use them in Editor. We get the known pink materials a lot.
We get sound issues for unsupported format, too. All of these are knows to community but we hope that Unity team is going to work something better for those problems than our hacked approach which we always need to keep in mind.

The biggest problem we had with assetbundles is that we couldn’t check what was actually included in the bundles themselves, and lots of bugs, many were fixed in the recent patches though.

An included asset bundle inspector on the editor, showing all the files and texture compression formats in the bundle, would go long ways to improve usage.

One of the “bugs” (maybe it’s intentional, IDK) I found, still happens and I couldn’t yet find time to create an example project to report, but when I used loadfromcacheordownload and tried to instantly use the asset, instead of downloading it to cache them make it available to use, it would install to cache and them never return to the main function, I was required to make the function into a coroutine to be able to continue execution…

There was also a small issue it had when trying to load an assetbundle from an file included in the project in the streamingassets folder, it loadfromcache was case sensitive, took a while to figure it was the problem :stuck_out_tongue:

Hello,

I am working on converting our build for a large project (https://www.shroudoftheavatar.com/) to use the newer Asset Bundle system, and have noticed one thing in particular that seems to really slow things down. I am not sure if there is something I can do to improve it, if it is just the size of our project, or something Unity could fix. Thought I would post here to help get it noticed! Would love to provide more feedback of our experience using the Asset Bundle system as I dig into it more and get further along. Building Asset Bundles "Compiling Scripts..." step repeats for each bundle? - Unity Engine - Unity Discussions

How can I unload single asset from asset bundle? Resources.UnloadAsset(…) seems to at least destroy the asset, but I am not sure it plays nicely with asset bundle system.

Who are you?

Programmer with Blowfish Studios, have developed our internal build management tool and Asset Bundle management tools.

What kind of game are you trying to build or would like to build?

Have built mobile games in the past, and now console / desktop games.

How do Asset Bundles fit into that? What use-cases do you have?

For mobile games, want to keep the package sizes as low as possible (<100MB for initial install). Need asset bundles to do that (and we do use them for that). Also helps with updating, as we can push out new assets in the asset bundles without needing to update the client.

For console / desktop games, we haven’t gotten into using them much yet, but would like to use them mainly to support updating content without requiring a new build to be submitted.

What are the GOOD things about Asset Bundles that you like?

  • Being able to update small parts of the game without re-downloading the entire game.
  • Reducing build size by splitting it up into parts

What are the BAD things about Asset Bundles that you dislike?

  • Game becomes much harder to manage

  • Pre-Asset bundles, we could just load any scene and grab any resource object we needed.

  • Post-Asset bundles, we need to make sure it has all been downloaded and ready to go

  • Our Asset Bundle management tool takes care of this section though automatically (but we had to develop it internally)

  • Slows down development (and / or build times)

  • Lets assume we have our game scenes in an asset bundle, and the main menu is part of the base package

  • In the Editor, if I were to go and edit the game scene, lets say I move the player spawn position somewhere else. Then if I go to play the game again, it would load the main menu, then load the Game scene from an asset bundle which has NOT been updated with my immediate changes, and it would not show my new change.

  • The work-around for this is to not load the Asset Bundles in the editor, but to add the scene to the scenes list in the editor, which is easy enough to do (at least with our in-house build management tool it is). Other alternative is to re-build the asset bundle every time you make a change, but that just slows things down significantly.

  • This is easy enough for Scenes, simply tick them in the Build menu on / off. However for Assets, e.g. a texture, if it lives in an Asset Bundle and gets changes, then the same thing would happen - it would not update until you re-build the asset bundle or load the texture directly from the project. But in this case, its not as simple as just ticking a box to add the asset to the build. For assets, this is done by adding them to the Resources folder. The only problem here is that if you leave them in the Resources directory so you can test it in the Editor, then when you go to do a build, it will include those assets in the build (and the size will shoot up). So you need to put them into Resources in the editor, but move them OUT of resources for a build. For a single texture, this is fine - we automatically move files in and out of resources (have another folder called “Resources_NotInBuild” managed by our build tool) - however in one of our games, this adds up to thousands of files. Any time you switch between the two and move all the files in / out of Resources, it takes an hour to reimport things, which is totally unusable. I end up having to manage two separate clones of the project, one with files in Resources, one with files out of Resources, so that I can develop the game with one, and build the game with the other.

  • Can’t easily include scripts. I know there are some tricks to make this work on certain platforms, but not all support it (reflection). And I know its not really a fault, but it would be super nice to be able to add or edit a script and just chuck it into an asset bundle. So many times we have bugs that are just one line of code that needs to change, and would be so much nicer to just push it out via an asset bundle.

How can we make it BETTER?

  • Maybe look into some sort of Editor-Emulated asset bundles, which are not built, but behind the scenes re-map loads (e.g. AssetBundle.Load(“myTexture”)) into UnityEditor calls (e.g. UnityEditor.AssetDatabase.xyz). This would be very nice in the Editor, as it is still using the single-path of code for Asset Bundles, and will be much closer to how the final build would be outside of the Editor (e.g. would show issues if a file / scene was missing from the Asset Bundles)
  • Better UI to show asset bundles. Unity 4.x had nothing at all, all code - which is where we developed our GUI system for Asset Bundles. Unity 5.x has a tiny label to assign things to asset bundles, which is a step forward. But I believe you cant preview all asset bundles - you can’t open a window and show a list of all the asset bundles that exist by name, and to show what assets exist in each bundle. Our tool has been doing this since 4.x, and helps to visualise them. Also helps to find when an old / unused asset is taking up space - the only way to know now is to inspect every single asset manually.
1 Like

Who are you?

One-man-studio.

What kind of game are you trying to build or would like to build?

PC (Mac/Linux) multiplayer games.

How do Asset Bundles fit into that? What use-cases do you have?

AssetBundles can be used as content patches for games, so adding new content is just a case of downloading the latest version of a given assetbundle.

What are the GOOD things about Asset Bundles that you like?

  • Being able to update small parts of the game without re-downloading the entire game.
  • Reducing build size by splitting it up into parts
  • Having separate projects to keep/maintain each assetbundle. Makes a clean workflow.

What are the BAD things about Asset Bundles that you dislike?

  • Instantiation freeze - which can add a frozen eon to game-startup. Must have multithreaded extraction and instantiation of assets from bundles. I know this is a joint issue, and probably my biggest gripe about Unity as a whole. Let me just reiterate my complaint… Stop Instantiation Freeze - pass instantiation to another thread.

How can we make it better?

Performance, performance, performance. I’m happy with everything else about AssetBundles.

As I’ve (and some other people) mentioned in the End of Resources Folder thread, a wrapper for Asset Bundles that is syntactically same or at least similar to Resources.* calls, but instead scans all currently loaded asset bundles would be very helpful. The only reason I tend to stay away from AB is because they are a royal PITA to implement properly (compared to using Resources folder) and then load resources from them. A function to get a list of all asset bundles that exist in a given directory would be useful as well.

Who are you?
Independent developer

What kind of game are you trying to build or would like to build?
Moddable voxel based world with RPG and sim elements.

How do Asset Bundles fit into that? What use-cases do you have?

  1. Users download specially crafted mod project,
  • put in texture files,
  • write scripts,
  • (optionally) add shaders (not really crucial)
    Build their asset bundle and put it in a proper folder for the game. Folder is then scanned, Asset bundles are loaded and initialized. Users can enjoy their new content.
  1. Pushing small content fixes/updates
  • Content modularization: If I have a bug in one of my content packs(in a script), I replace a pack, not all of the project which reduces bandwidth and promotes modular design(which I like).
  1. DLC creation
  • Because all of the content can be created using interfaces/inheritance and textures, it becomes easy to interface complex mechanics without implementing a scripting language for everything and thus slowing everything down.

What are the GOOD things about Asset Bundles that you like?

  • Simplicity of texture preprocessing in editor translates into simplicity in mod creation
  • Free, full featured editor to create them(Users don’t need to purchase Unity editor to make mods)
  • Small size, nice way of interfacing with the current resources.

What are the BAD things about Asset Bundles that you dislike?

  • No scripts inside.

How can we make it BETTER?

  • Enable creation of a lib to be included in an asset bundle.
    Obviously it would not work on majority of mobile platforms, but modding isn’t big there (probably because You can’t easilypublish there), unsure about consoles. But the Windows, Mac and Linux market would be very happy to have that.
    And it would require the user to create multiple versions of a mod for multiple platforms too, but with proper documentation, modding communities can thrive.

Cheers,
Sivael.

1 Like

Who are you?
Independent developer

What kind of game are you trying to build or would like to build?
We create virtual worlds which are basically a selection of scenes, object list that are instantiated into the scene, and characters. The scene logic depends on the purpose of the scene. Everything from nurse training simulators, ecommerce spaces, presentations spaces and learning spaces.

How do Asset Bundles fit into that? What use-cases do you have?
We use asset bundles to separate the content from the executable. As such our uses cases are load scene, load objects and load characters.

What are the GOOD things about Asset Bundles that you like?
We like that we can separate the assets from the executable and dynamically download them at run time. We like that we can have asset bundles for different platforms.
We like the Unity interface to manage the assetbundles and build them.
We like the direction of manifest files and management of dependencies.
We like the idea of being able to use asset bundles in the Unity Editor when testing.

What are the BAD things about Asset Bundles that you dislike?
I think that last changes to the asset bundles were kind of moving in the right direction, compared to only script based creation of asset bundles.

  1. For us, we would like to be able to manage the asset bundle list, although we kind of do that by selecting a folder, seems better if we can actually manage the list, and some objects can be added to more than one list.
  2. Now that manifest files are created at a project level we aren’t sure how to handle asset bundles created in more than one Unity project and how to use asset bundles created in one Unity project with another Unity project. Separating content assets from the main scripting project makes multi-user development easier and scripting development faster.
  3. Better control of the file extensions used, and file name, or use “.unity”. Not sure its safe to be using MIME defined as just “.”, to get files without an extension.
  4. The way variants are done you can’t control the file name extension. The file name extension is the variant name and won’t let you have two “.” in the name.

How can we make it BETTER?

  1. I suggest a UI for managing the list of assets that are in an asset bundle, kind of like a c# DLL project is made where you can control the output file name, the list of assets it contains, what platform it can target.
  2. Support for asset bundles created from more than one Unity Project, and some how the application manifest handles this.
  3. Better control of file names and extensions.
1 Like

I’m unable to load AssetBundles built with BuildAssetBundleOptions.ChunkBasedCompression and placed in the StreamingAssets folder when running on iOS. The same AssetBundle and code load properly when running in the OSX Editor. I have verified proper building and placement of the bundle. All bundles downloaded usingWWW.LoadFromCacheOrDownload built at the same time work properly

The error received in the XCode output log when running on a iOS device is:

Unable to open archive file: /var/containers/bundle/application/9c2e7214-9980-4ea6-a8b8-1554f5cc0c9a/myvegas.app/data/raw/mybundle.unity3d

Here is the code being used to load the bundle. According to the docs herehttp://docs.unity3d.com/Manual/StreamingAssets.html, it’s best to use Application.streamingAssetsPath to get the location of the StreamingAssets folder and I assume this also means when running on iOS devices.

AssetBundleCreateRequest abcr = AssetBundle.LoadFromFileAsync(Application.streamingAssetsPath + “/mybundle.unity3d”);

yield return abcr;

if (abcr.assetBundle == null)
{
Debug.LogError(“Error loading bundle mybundle.unity3d”);
}

When running on iOS, I have also tried replacing Application.streamingAssetsPath with:

Application.dataPath + “/Raw/”

but them same error occurs.

This same error exists on all versions of Unity from 5.3.2p4 through 5.3.4p1.

I have seen some references to this issue in the forums but no formal response from Unity nor any specific confirmation that there is a resolution.

Is there any fix for this issue? It’s a show-stopper for the use of including AssetBundles in the iOS binary.

You need to clarify at what point AssetBundles need to be rebuilt for Unity updates.

The FAQ is vague.

“Type trees are never included for mobile and console asset bundles and so you will need to rebuild these bundles whenever the serialization format changes. This can happen in new versions of Unity.”

Can happen?

Thanks everyone for taking time to give us your feedback on Asset Bundles. I will try to summarize everything said so far below. If you have feedback that hasn’t been captured in the summary please post it here.

The Good
Good download size
Can use compressed textures
Being able to update small parts of the game without re-downloading the entire game.
Reducing build size by splitting it up into parts
Having separate projects to keep/maintain each assetbundle. Makes a clean workflow.
Simplicity of texture preprocessing in editor translates into simplicity in mod creation
Free, full featured editor to create them(Users don’t need to purchase Unity editor to make mods)
Small size, nice way of interfacing with the current resources.
Can separate the assets from the executable and dynamically download
Interface to manage and build

The Bad
Have to build for each platform
Have to build for each Unity version
All textures must exist in a Unity project
Takes a long time to build
Game becomes harder to manage when using asset bundles
Slows down development
Cant include scripts
Instantiation freeze
Cant manage asset bundle list
Cant use or manage asset bundles across projects

What could be Better
Documentation
Make extractable allowing the contents to be modified and then repacked
Have some assets in more than one asset bundle
Output location as an option
Specify platform in AssetBundleBuild
An includled asset bundle inspector in the editor
Editor-emulated asset bundles which are not built
Better UI to show asset bundles
Performance
Enable creation of a lib to be included in an asset bundle
Better control of the file extensions used

4 Likes

In addition to all that, I’ve got a few specific things to add.

Who are you?
Software developer at a small studio.

What kind of game are you trying to build or would like to build?
A 2D mobile game (iOS and Android) with high definition art.

How do Asset Bundles fit into that? What use-cases do you have?
Asset bundles are supposed to solve the HD/SD problem (see here). In addition to that, art for new game levels will be downloaded rather than packaged with the APK/IPA.

What are the GOOD things about Asset Bundles that you like?

  • I can package not just art but animations, scenes, and potentially anything else I want with a TextAsset.

What are the BAD things about Asset Bundles that you dislike?

  • Unity is recommending that Asset Bundles be included in the build to solve problems like HD/SD but since AssetBundles must be built separately for each platform, and there is only one StreamingAssets folder for all platforms, it doesn’t work. See this feedback item for more information. This isn’t just for HD/SD, it’s for any time an AssetBundle is to be included in the StreamingAssets folder, which has also been suggested as a way to LZ4 compress Truecolor assets in the build.
  • There needs to be a preprocessing hook for building the game and/or asset bundles. For example, swapping in platform-specific assets into the build, or packaging custom data into TextAssets. There may be many different ways to initiate the build process so creating an additional menu item to do the processing AND start the build is not a good solution. See this feedback item for more information.
  • PVRTC texture compression is too ugly for many art styles and yet it is the only compression option for iOS. LZ4 doesn’t compress Truecolor sprites well enough. Sprites/textures should be packaged in the asset bundle using PNG or JPG compression, and decompressed/streamed to Truecolor when loaded. If the asset bundle is decompressed and cached, then the sprite must stay in PNG/JPG format until loaded into memory. This is not just an asset bundle problem but a more general Unity packaging problem. My iOS build is about 10x bigger than my Android build and cannot be released that way. See this feedback item for more information.
  • Cached asset bundles don’t get cleaned up properly, wasting space on the player’s device. I don’t remember the specifics but this thread and this thread discuss some variation of the problem.

How can we make it BETTER?
By fixing the bad things.

  • Have Platform-specific StreamingAssets folders, like you do with Plugins.
  • Have a pre-build hook that we can do our own pre-build processing in (for asset bundles builds and full builds).
  • Store Truecolor textures/sprites in PNG/JPG format so they don’t take up so much space. But this should be optional because some people might prefer larger build sizes to longer load times.
  • Provide ability to manage asset bundles in the cache at runtime.

Who are you?
I’m an intern at an educational enterprise.

What kind of game are you trying to build or would like to build?
We have an educational project of augmented reality + books.

How do Asset Bundles fit into that? What use-cases do you have?
We want to diminish the size of the initial application, so that people would only download the scenes that they want to use.

What are the BAD things about Asset Bundles that you dislike?
Well, it would be good if the tutorials were explanative, a thing that they aren’t. There are a lot of things missing, I, for example, am looking at a ton of tutorials for over 2 weeks and still, I can’t make my system work.

How can we make it BETTER?
Please, PLEASE, I beg you Unity, make those tutorials more understandable. There are a lot of functions in the Asset Bundle Manager that doesn’t even exist. Maybe it’s just me, but I couldn’t really make it work in any way I try because the bundles won’t load properly unless the Assets are present in the Asset folder.

Who are you?
Team lead of the Unity team in a semi seized mobile games development company.

What kind of game are you trying to build or would like to build?
Fantasy RPG, Tower Defense games, Adventure games for mobile and standalone.

How do Asset Bundles fit into that? What use-cases do you have?
As we’re mostly developing mobile clients and don’t want to update the clients everytime we have some content fixes (textures, 3d models, whole scenes…), we use Asset Bundles to update it.

What are the GOOD things about Asset Bundles that you like?

  1. Build process much improved!
    It’s pretty easy now to create an assetbundle. I really like that.
  2. Updating content without new client update
    That’s the best thing about it. It works if you have a good asset pipeline set up (see below what can mess that up).

What are the BAD things about Asset Bundles that you dislike?

  1. Debugging!
    You can’t simply figure out what is wrong. Animator Controllers can’t be seen, assets in the AB have all to be unloaded before you know what’s the problem and then you don’t actually know if you have the right version downloaded or if it is the cached one.
  2. Versioning
    Currently we have to track the downloaded versions on our disk, instead of checking if the AB is present and if so, which version it has. We thought about adding a textfile into the AB to achieve that, but we would prefere a “native” solution of course.
  3. Cross platform
    Ah… don’t know how to fix, but it’s not nice atm. We support 5 different versions (WebGL, iOS, Android, Windows and OSX editor) and we have to build our assetbundles for each platform. I think it’s the least bad thing, but the first you fall into when working with ABs.

How can we make it BETTER?

  1. I would like to see the versioning of assetbundles improved. If I could give the versionnumber in the AB buildprocess and later see it when I downloaded the AB, then it would be much simpler to check if you have the latest assetbundle or not.
  2. Also referencing assets from other assetbundles is not that intuitive. If that could be improved, that would be awesome. Currently we have some assetbundles which are loading all one texture on their own, instead of using only the same texture again. I know there is a way to workaround that, but it would be cool if our artists could setup “references” to other textures by themself.

Who are you?
I’m the developer of an indie studio.

What kind of game are you trying to build or would like to build?
A standalone PC title.

How do Asset Bundles fit into that? What use-cases do you have?
We have a lot of dynamic assets for procedural level creation. I used to just stuff all the prefabs, some textures, serializable objects etc. into the Resources folder, so I can specify a path, and get everything of a specific type from inside it. So I frequently have to get everything inside a folder, in order to select the appropriate assets for instantiation (e.g. load everything from “weapons” and then pick a random one of the correct type for my current enemy).

I ran into major performance issues and I decided to move the content to Asset Bundles. It is said they can do all Resources can do, but it seems that is not the case. I do not know yet if it will actually work faster than using Resources, since I’m still far from finishing the switch.

What are the GOOD things about Asset Bundles that you like?

  • Letting the user only download what has actually been updated.
  • The promise of decreasing build time by only building what has actually changed.
  • The promise of better performance when loading assets.
  • Still being able to test from the editor using the AssetBundleManager.

What are the BAD things about Asset Bundles that you dislike?

  • I’ve spend the past 4 days watching tutorials, reading manuals and decyphering code, and I still don’t know if I can get my use-case to work.
  • If I use AssetBundles directly, I can at least use LoadAllAssets to get a specific type or GetAllAssetNames(), but I can’t test in the editor (no simulation mode). If I use the AssetBundleManager, so I have simulation mode, I have to request an asset by the specific name AND specific type, which I do not know at that time.
  • I have to spend endless brain cycles wrapping my head around what has to go in which folder and which bundle, which is very error prone.
  • There is not enough information on AssetBundles.
  • It feels risky to adapt to a new system that seems error prone and incomplete.

How can we make it BETTER?

  • Add the functionality of Resources to the AssetBundleManager. Most importantly Resources.LoadAll(path);
  • Integrate simulation mode into Unity.
  • Create more use case examples.

Hi,

I just wanted to send a quick note to first of all thank everyone for their input, and secondly to let you know we’ll be talking about future development plans for Asset Bundles at Unite LA next week. If you are attending Unite, the session will be part of Track 2, Thursday at 1PM PST. I’ll be sure to cross-post information from that session back here as well in case you can’t attend.

-Stephen Palmer
Build Pipeline and Asset Bundle Lead

3 Likes