Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Unity 5: Is Streaming Asset Bundles now compatible between unity versions

Discussion in 'Unity 5 Pre-order Beta' started by nsandhu, Oct 27, 2014.

  1. nsandhu

    nsandhu

    Joined:
    Sep 24, 2012
    Posts:
    8
    It looks like there is a lot of great new features coming out in Unity 5.0 but one of the questions I had is does Unity 5 now support streaming asset bundles from earlier unity versions? For example, if I create a asset bundle in Unity 5.0 and then a few minor releases later say Unity 5.5 will I still be able to stream and load the same unchanged asset bundled to a iOS device without having to re-build it? I know there is still cross platform building but thats a different issue.

    Will the new ignoretypetreechanges build option solve this problem? If so, what are the cons here?
     
    Last edited: Oct 27, 2014
  2. deram_scholzara

    deram_scholzara

    Joined:
    Aug 26, 2005
    Posts:
    1,031
    I doubt it - features get improved/replaced/etc, so there's no way to guarantee that a compiled 5.0 asset would work in 5.1.
     
    Last edited: Oct 27, 2014
  3. nsandhu

    nsandhu

    Joined:
    Sep 24, 2012
    Posts:
    8
    Specifically, the feature below they added should allow old assets to work. The type tree was never included before so the asset bundle was required to use the version compiled on the mobile device. Now that it's included I wonder if you could you use the one provided in the streamed asset build itself.

    Unity 5.0 Release Notes:
    • AssetBundles: By default include type tree in the assetBundle on all the platform except metro.
     
  4. nsandhu

    nsandhu

    Joined:
    Sep 24, 2012
    Posts:
    8
    This was on the user manual before:

    Will an AssetBundle built now be usable with future versions of Unity?

    AssetBundles can contain a structure called a type tree which allows information about asset types to be understood correctly between different versions of Unity. On desktop platforms, the type tree is included by default but can be disabled by passing the BuildAssetBundleOptions.DisableWriteTypeTree to the BuildAssetBundle function. Webplayers intrinsically rely on the type tree and so it is always included (ie, the DisableWriteTypeTree option has no effect). 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. (Except for bugfix releases) It also happens if you add or remove serialized fields in monobehaviour’s that are included in the asset bundle. When loading an AssetBundle Unity will give you an error message if the AssetBundle must be rebuilt.

    It would be great to get someone from Unity to verify that it will work on Unity 5 moving forward.
     
  5. Aurore

    Aurore

    Director of Real-Time Learning Unity Technologies

    Joined:
    Aug 1, 2012
    Posts:
    3,106
    This is is probably better suited for the beta forum. Moved.
     
  6. Deleted User

    Deleted User

    Guest

    In Unity 5.0, we do consider the asset bundle compatibility issue. From 5.0, asset bundle contains type tree by default. So the future version of Unity should be able to read the asset bundle built by Unity 5.0. You may notice the below information in the release notes:

    Unity 5.0 Release Notes:
    • AssetBundles: By default include type tree in the assetBundle on all the platform except metro.

    And ignoretypetreechanges is the option to let you decide if you want to rebuild the asset bundle if only type tree changes, for example you change the public member of the script. It's not compatible with DisableWriteTypetree, if you disable typetree, then you cannot ignore typetree changes.