Search Unity

Cross platform asset bundles

Discussion in 'Asset Bundles' started by liortal, Oct 22, 2017.

  1. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,562
    Are there any plans to support "cross platform" asset bundles ? i mean, a single package that would be compatible across all (or: multiple) different platforms ?

    Consider this use case:
    upload_2017-10-22_20-34-12.png
    Consider the case of modifying a single Vector3 value in the inspector, which requires us to rebuild the entire asset bundle.

    We support 3 different platforms so this means switching to the target platform and rebuilding the bundle per platform, which is a very long process.

    It could be great to build it once and use it on multiple platforms.
     

    Attached Files:

    Last edited: Oct 23, 2017
  2. Ryanc_unity

    Ryanc_unity

    Unity Technologies

    Joined:
    Jul 22, 2015
    Posts:
    332
    There are no current plans to implement or support platform agnostic asset bundles.

    That being said, we are actively working on speeding up the platform switching process and build process. Have you tried using the Unity Cache Server? We just recently fixed a lot of the bugs and performance issues in the existing version and released it under Apache-2.0 license. This will help speed up the platform switching process. (https://github.com/Unity-Technologies/unity-cache-server) For the improved build process, you will have to wait until I finish releasing it as it's still in progress (target first half 2018).
     
  3. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,562
    Awesome. i didn't know its available on github :)

    we are actually using it (running a local copy on every developer's machine), but i've seen it fails to resolve assets in many cases, and in other cases it's just super slow, even with the cache server active..
     
  4. Ryanc_unity

    Ryanc_unity

    Unity Technologies

    Joined:
    Jul 22, 2015
    Posts:
    332
    Try out the new cache server then, you should notice a nice performance improvement with it. Also it may be better to run a single network cache server for all your users on the same project instead of just local ones on each machine. If you are still getting failures to resolve assets, open up an issue in github with the details so we can fix it.
     
  5. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,562
    why is that ?
     
  6. ortin

    ortin

    Joined:
    Jan 13, 2013
    Posts:
    221
    it's not the one bundled with unity?
     
  7. Ryanc_unity

    Ryanc_unity

    Unity Technologies

    Joined:
    Jul 22, 2015
    Posts:
    332
    So if a team member imports a version of an asset for a specific platform, you can just download that imported version of the asset instead of having to import it as well. This allows you to share importer work across the entire team. Also since the version of the asset is based on the hash, if you both have the same asset, but different versions, the cache server will see that and send you just the correct data for your version if it has it already.

    Nope, the one shipped with Unity is before our changes. So if you want the latest you will need to get it from github.
     
    ortin likes this.
  8. Ben-BearFish

    Ben-BearFish

    Joined:
    Sep 6, 2011
    Posts:
    1,204
    Do you know if the latest Cache Server is not integrate with Unity 2018.3?
     
  9. User340

    User340

    Joined:
    Feb 28, 2007
    Posts:
    3,001
    Here's a tip for switching platforms instantaneously:

    Keep separate Library folders for each platform. When you want to open the project in a certain platform, just rename it's library folder to Library and rename the existing library folder to Library [platform-name]. Please see screenshot for sample.
    Screen Shot 2019-03-02 at 2.51.55 PM.png

    To let you know, it is relatively easy to automate this process making it all happen with just 1 button click. You could even set this up on a different machine so that it doesn't interfere with your work.
     
    Last edited: Mar 2, 2019
    CSuman likes this.
  10. Chris_Entropy

    Chris_Entropy

    Joined:
    Apr 11, 2011
    Posts:
    202
    I am currently researching possibilities for modding with Unity. The main obstacle I see at the moment is, that Assets are always platform dependent. Therefore a Mod made for Windows would not work on Linux or Mobile. This is made even more complicated, as we aim to support the Nintendo Switch. We could provide users with build scripts to automatically create asset bundles for several platforms, but the Unity SDK for the Switch is not publicly available. So we effectively would not be able to support modding for the switch.
    Any ideas? Is there maybe a way to provide at least basic assets like sound files, models and textures in a platform-agnostic way?
     
  11. jiraphatK

    jiraphatK

    Joined:
    Sep 29, 2018
    Posts:
    297
    Sound and texture should be fine by loading from your own server at runtime using UnityWebRequestTexture and UnityWebRequestMultiMedia.

    fbx runtime import
    Why would you need Unity SDK for that?
     
  12. Chris_Entropy

    Chris_Entropy

    Joined:
    Apr 11, 2011
    Posts:
    202
    We don't want to create our complete own asset handling system, but instead use Addressables and AssetBundles. Those can only be built from the Unity Editor, if I am not mistaken, and are platform dependent. Which means, that you have to have access to the Platform Support for the target platform, if you want to build AssetBundles for it, correct?
     
  13. nilsdr

    nilsdr

    Joined:
    Oct 24, 2017
    Posts:
    374
    yep, correct
     
  14. Neto_Kokku

    Neto_Kokku

    Joined:
    Feb 15, 2018
    Posts:
    1,751
    I haven't tested it myself, but since the Switch GPU supports DXT textures it should be able to load a bundle built for Windows, in theory, as long as that bundle doesn't contain any shaders.

    At any case, full self-service user mods is uncommon on consoles, due to the tighter restrictions. For example, in Warframe the devs select the best user made skins and make them available on consoles by hand.

    In all consoles there are also limitations to downloading and storing arbitrary files, you would need to talk to them to obtain approval to use additional storage space for things other than save data.
     
    liortal likes this.
  15. Chris_Entropy

    Chris_Entropy

    Joined:
    Apr 11, 2011
    Posts:
    202
    Interesting. We already had the idea to showcase mods we like on our website, so this would be indeed an option for the Switch. Thanks for the hint with the limited storage, I will look into this.