Search Unity

  1. We've closed the job boards. If you're looking for work, or looking to hire check out Unity Connect. You can see more information here.
    Dismiss Notice
  2. We're running great holiday deals on subscriptions, swag and Asset Store packages! Take a peek at this blog for more information!
    Dismiss Notice
  3. Check out our Unite Austin 2017 YouTube playlist to catch up on what you missed. More videos coming soon.
    Dismiss Notice
  4. Unity 2017.2 is now released.
    Dismiss Notice
  5. The Unity Gear Store is here to help you look great at your next meetup, user group or conference. With all new Unity apparel, stickers and more!
    Dismiss Notice
  6. Introducing the Unity Essentials Packs! Find out more.
    Dismiss Notice
  7. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice
  8. Unity 2017.3 beta is now available for download.
    Dismiss Notice

Asset Bundle Browser initial release

Discussion in 'Asset Bundles' started by unity_bill, Apr 11, 2017.

  1. unity_bill

    unity_bill

    Unity Technologies

    Joined:
    Apr 11, 2017
    Posts:
    6
    The first release of the Asset Bundle Browser is now available as an open-source editor extension here: https://github.com/Unity-Technologies/AssetBundles-Browser.
    It is still very early in its life, so we recommend backing up your project before using it. All feedback is welcome. For full documentation, see the included README, otherwise see the high level overview below.

    Overview
    This tool enables the user to view and edit the configuration of asset bundles for their Unity project. It will block editing that would create invalid bundles, and inform you of any issues with existing bundles. It also provides basic build functionality.

    This tool is intended to replace the current workflow of selecting assets and setting their Asset Bundle manually in the inspector. It can be dropped into any Unity project with a version of 5.6 or greater. It will create a new menu item in Window->AssetBundle Browser. The bundle configuration and build functionality are split into two tabs within the new window.

    Configuration
    [​IMG]

    The configuration window shows you a list of all bundles in your project. You can select bundles to see their asset lists, and select assets to see their details. You can drag bundles and assets around within this utility to change bundle assignment, as well as drag assets in from the Project Explorer.

    Build
    The Build tab provides basic build functionality to get you started using asset bundles. In most profressional scenarios, users will end up needing a more advanced build setup. All are welcome to use the build code in this tool as a starting point for writing their own once this no longer meets their needs.


    Please reply to this post or add tickets to the github page with any questions, bugs, or feature requests.
     
  2. xuanyusong

    xuanyusong

    Joined:
    Apr 10, 2013
    Posts:
    45
    good!!!
     
  3. LingdongXin

    LingdongXin

    Joined:
    Aug 3, 2015
    Posts:
    2
  4. aoicocoon

    aoicocoon

    Joined:
    Feb 4, 2017
    Posts:
    1
    so good!!!
     
  5. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    2,034
    I still don't understand why you guys are wasting time on these types of efforts; the node graph, this thing, it's all pointless.

    The problem you should be solving is not one of interface, but of design. There is no world in which I want to manually design and build bundles; carefully trying to avoid duplicating data, with any mistake meaning things get duplicated in memory. Can you name a use case where having a user download an asset more than once and duplicating it in memory is desirable? On any reasonably sized project, it's a nightmare to use this system without writing tons of code to automate the process.

    Simply slapping new interfaces on it every other month is doing nothing but eroding my belief that the problems of shipping a game with asset bundles are understood by Unity. You guys are polishing a flawed design.
     
    ferretnt, polytropoi and StaffanEk like this.
  6. Reichert

    Reichert

    Unity Technologies

    Joined:
    Jun 20, 2014
    Posts:
    38
    Hi Jason,

    We are approaching this from two angles at the same time: 1) fix bugs and improve tooling and documentation around the existing build pipeline to relieve some user pain in the short term and 2) a complete overhaul of the build pipeline, editor workflows, and runtime resource management.

    The goal of the larger effort is that we address as many user scenarios as possible in a way that requires little to no code required from the user, while also improving the APIs to be more data oriented to minimize the amount of customization required when our built-in workflows are not sufficient.

    -Stephen
     
    Last edited: May 30, 2017
  7. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    2,739
    Hi @Reichert , is there any update on the progress you're making with asset bundles (the API, tooling, etc as you mentioned) ?

    Also, i submitted a PR against the "browser" repo. in case you guys want to check it out.
     
  8. Brathnann

    Brathnann

    Joined:
    Aug 12, 2014
    Posts:
    2,775
    I like it, except if you have a lot of asset bundles, there doesn't appear to be a way to right click to create one (as the list gets long and there is no empty bundle space) so it just selects whatever bundle you right clicked on.

    Is the intent to organize the bundles into folders? Does putting these in folders change the structure of the asset bundle any or it it just a way to organize them?

    Thanks! It's a huge improvement over the old way of doing things as we have new bundles each month for different levels and the old way was a huge pain.
     
  9. Reichert

    Reichert

    Unity Technologies

    Joined:
    Jun 20, 2014
    Posts:
    38
    I'm working on a blog post to talk in more detail about our plans and progress.
     
  10. unity_bill

    unity_bill

    Unity Technologies

    Joined:
    Apr 11, 2017
    Posts:
    6
    Thanks for your input Brathnann. I'll get working on a way to add bundles even if the list is too long to have open space. That should definitely be in there. As to the folder question... the file structure on disk will mimic that in the browser. So if you created a bundle "FolderA/BundleB", you'd see a folder called "FolderA" on disk, and that folder would contain a bundle called "BundleB". I think in many cases, if you have large number of bundles in your game, it makes sense to use folders, but obviously there are situations where it does not. Independent of specific situations, the tool should work with whatever structure you choose to have.
    I've created an issue for you on the github projct here: https://github.com/Unity-Technologies/AssetBundles-Browser/issues/14
    Please subscribe to the issue so that once it's fixed I can let you know, and get feedback on the validity of the fix.
    Thanks,
    Bill
     
  11. unity_bill

    unity_bill

    Unity Technologies

    Joined:
    Apr 11, 2017
    Posts:
    6
    Thanks for the PR @liortal, I'll take a look at it.
     
  12. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    2,894
    Hi Bill, I recently posted Dependencies seem to be "Editor-based" and therefore misleading as issue on GitHub and this is related: Originally, I assumed that Unity's build-system / dependency checks would work in a way so that any assets that are included in the "main build" (i.e. all assets used by scenes included in the build settings and not included in assetbundles) are available to scenes / assets stored in AssetBundles. If that was the case, one could very easily add a few scenes to AssetBundles and rely on Unity to put the Assets exclusively used by those scenes into the relevant bundles (potentially duplicating assets that are used by multiple scenes in asset bundles that are not part of the "main build").

    Using the AssetBundleBrowser, however, it seems that this is not the case, and instead, you have to use an "all or nothing" approach when using AssetBundles: Any assets used by any scenes in the main build, that are also used by scenes or assets in AssetBundles will always be both in the main build and also added to the AssetBundles.

    So that means when you use AssetBundles, in most scenarios you'll be best off to just have one tiny "loader"-scene that uses almost no Assets and kind of bootstraps the game by loading the first AssetBundle(s) which has the first actual scene because that way, it's all in AssetBundles.

    Is that really the case? Or am I just confused due to limitations of the tools I am using (currently, I'm trying to figure things out using AssetBundle-Browser and AssetBundleEditor, but even though AssetBundleEditor gives me much better info on why an Asset is included in any given bundle, it still seems to rely on the dependencies from the editor-perspective, which may be misleading.

    It seems that once the AssetBundles are built, one could get the actually relevant information: Which Assets Are Included In An Asset Bundle? ... it seems like this would probably provide for a much better workflow if that information is somehow added to what AssetBundle-Browser (or AssetBundleEditor) shows.
     
  13. unity_bill

    unity_bill

    Unity Technologies

    Joined:
    Apr 11, 2017
    Posts:
    6
    Hi @jashan, It looks like you have two separate concerns to address.
    One is that you'd like to be able to view the contents of a bundle after it has been built. This is a feature that I am currently developing for the browser and hope to have out soon. Its definitely something that we know to be helpful and are making a priority to get out.
    The other item is what exactly happens when you mix and match including things in asset bundles and the standard player build. The short answer is that the two systems are completely unaware of each other, and the bundle browser is only aware of bundles. The player build will generally include the scenes explicitly added, those scenes' dependencies, and things in the Resources directory. If you also include assets in asset bundles, you do have potential duplicates due to shared dependencies. One solution is what you suggest; to only have a lightweight bootstrap scene in your player build and include everything else in bundles. It is not the only solution, and what you choose to do depends on your situation. For some the right solution would be to include the first handful of levels or tutorials in the built player, and have later levels in bundles on a content server. For others, it could be best to only reference prefabs by name in script, including those prefabs in bundles, but all other data with the player build. The key is to understand which items are getting built with your player.
    I hope this is helpful information, and you can find use in the browser. I will post to this forum once the browser supports a post-build-analysis of bundles.
     
  14. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    2,894
    That is great to hear!

    Do you have the information that those two systems are completely unaware of each other anywhere in the documentation? I believe that I have read most of the documentation about AssetBundles (including the tutorials and guidelines and "background information") at least one time, some parts several times ... and it only slowly dawned on me that this might be the case after running into some odd behaviors. The AssetBundleBrowser you're working on definitely helped realize this - but it's something I'd expect to read in the documentation. Actually, it probably should be one of the first things to read.

    This is really not obvious - especially because normal player builds are uncompressed, and AssetBundles are usually compressed. So when I started using AssetBundles, my build size did decrease, even though I had lots of asset duplication in the builds.

    Let me know what the best way is to let the documentation team know about this (if it's even an issue - but for me, it certainly was ;-) ).

    Ironically, there is a fairly large section about how to organize AssetBundles in the manual - but it does not address this fairly fundamental issue (or at least I didn't see it addressing that issue).


    Something else: It seems that another real minefield when using AssetBundles is shaders/materials. I noticed this when the terrain in some of our environments did not get effected by fog (there is also a related setting in the Player / Graphics settings, if I'm lucky this will fix this issue for me). One solution seems to be putting materials and shaders into the same AssetBundles so that the shader variants / keywords are properly handled. If that is the case, one nice feature for the AssetBundle browser would be to check materials / shader dependencies (i.e. give me a warning if I have the material without its shaders in a bundle). There may be even more to it (e.g. shaders used for image effects, or special purpose shaders may require some "special handling").
     
  15. unity_bill

    unity_bill

    Unity Technologies

    Joined:
    Apr 11, 2017
    Posts:
    6
    @jashan, I'll get your feedback on the documentation passed around so that it can be made more clear. I'll also investigate if there's anything the browser could do to help with shaders, but I'm not sure there is. A shader generally will be pulled in as a dependency of a material _but_ may not have the correct varaints. I don't think there's a good way for the browser to know what is wrong (if anything) in this situation. https://docs.unity3d.com/ScriptReference/ShaderVariantCollection.html might be something to look into.
    Thanks for all your feedback.
     
  16. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    2,894
    Ah, that does sound good - I'm already using ShaderVariantCollections extensively and actually started pulling in the Shaders using those collections. So if Unity AssetBundles behave well with ShaderVariantCollections, I'm covered ;-)

    Thanks for passing the documentation feedback around.
     
  17. Reichert

    Reichert

    Unity Technologies

    Joined:
    Jun 20, 2014
    Posts:
    38
    A ShaderVariantCollection will correctly influence how shaders are compiled by the Asset Bundle build pipeline when they are included in the same bundle as the target shaders.

    Our in-progress work to refactor the build pipeline will make this unnecessary as we will correctly calculate tag usage across shaders used in scenes and regular asset bundles. One exception to this will be any usage of Shader.Find from script.
     
  18. BerlinLiu

    BerlinLiu

    Joined:
    Jun 23, 2017
    Posts:
    1
  19. Tuni

    Tuni

    Joined:
    May 24, 2013
    Posts:
    57
    Will it be possible to include an asset in a bundle only on specific platforms?

    We are using a custom asset bundle build tool which builds asset bundles out of folders. If you create a subfolder named "PS4" the assets in this folder will only be included in a PS4 build. Shared for all platforms, Standalone or Windows for Windows builds and so on.

    This is used for config files, prefabs, textures (we don't need Xbox button sprites on a PS4 build) and many more assets.
     
  20. unity_bill

    unity_bill

    Unity Technologies

    Joined:
    Apr 11, 2017
    Posts:
    6
    Unfortunately, no, the browser will not be providing platform specific functionality. It simply provides a (hopefully) better interface for Unity's built-in bundle assignment system. That system doesn't have any per-platform configuration at this time, so we can't really add it on top. You may be able to achieve what you're after using the graph tool (https://bitbucket.org/Unity-Technologies/assetbundlegraphtool). If you have the latest version of both the browser and the graph tool, you can use the browser to preview what the graph tool is going to build.

    Of note as well is that the build-pipeline team is actively working on a redesigned build workflow that should cleanly support this kind of thing in the future. At that point, you would not use this bundle browser (or at least not in its current form) but should be able to define build configurations specific to each platform.

    Thanks for your feedback, sorry it doesn't quite meet your workflow needs.
     
  21. Tuni

    Tuni

    Joined:
    May 24, 2013
    Posts:
    57
    Thank you for your fast reply.

    Maybe you can implement a similiar feature in the future. As long as the current API is supported we will use our tool anyway. Our artists and designer are used to work with it.
     
  22. polytropoi

    polytropoi

    Joined:
    Aug 16, 2006
    Posts:
    653
    Must scene asset bundles now be built from the same project that requests them, or can I (continue to) build them in one project and load them in another?
     
  23. polytropoi

    polytropoi

    Joined:
    Aug 16, 2006
    Posts:
    653
    Can anyone confirm that they're able to load asset bundle scenes built from external projects? Is this a new policy, or an oversight, or a bug, or just me being dense? I hate to be a pest, but I'd really appreciate some official comment on this issue, I have a lot riding on it.
     
  24. Brathnann

    Brathnann

    Joined:
    Aug 12, 2014
    Posts:
    2,775
    Why not try it out? (while you're waiting for an official response) I honestly don't have an answer for you, because I haven't done a scene bundle. I do asset bundles that can be built in older versions of the project (still same unity version, just older copies that don't have all my updates). But those are simply bundles with images in them, so nothing compared to what you're asking.

    Hopefully someone from Unity or that has tried this will be able to get back with you!
     
    Last edited: Jul 21, 2017
  25. polytropoi

    polytropoi

    Joined:
    Aug 16, 2006
    Posts:
    653
    Yes, it works for me on previous versions of Unity, but not on 2017x.
     
  26. polytropoi

    polytropoi

    Joined:
    Aug 16, 2006
    Posts:
    653
  27. Stormy102

    Stormy102

    Joined:
    Jan 17, 2014
    Posts:
    413
    Hi, I'm loving asset bundle browser - helped us to eliminate lots of asset duplication. However, could you also check to see if asset bundle assets are referenced within a scene, as there is still duplication of assets (in our case, mixers), which took longer to track down without this brilliant tool :) Would it be able to be added that ABB will check if asset bundles are referenced in scenes in the build list?