Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question ServerData: Different for each platform?

Discussion in 'Addressables' started by ManuBera, May 3, 2022.

  1. ManuBera

    ManuBera

    Joined:
    Aug 19, 2021
    Posts:
    70
    Hey!

    I was wondering if it is necessary to build ServerData separately for each platform, because by default it creates a directory for the current platform inside the ServerData folder.

    Or could I change this so it is the same directory for all platforms? Are the created bundles, hash and json files different?

    Thanks!
     
  2. ManuBera

    ManuBera

    Joined:
    Aug 19, 2021
    Posts:
    70
    Anyone? :)
     
  3. fengelbkool

    fengelbkool

    Joined:
    Feb 8, 2019
    Posts:
    6
    Hi @ManuBera, yes it needs to be in build separately in different directories for each platform.

    This is because what it is generated are AssetBundles that are different for each platform (and I think even if you change from unity version), and also the hash and json are different.

    Hope it helps...
     
    ManuBera likes this.
  4. ManuBera

    ManuBera

    Joined:
    Aug 19, 2021
    Posts:
    70
    Hey thank you very much, that helps a lot because I was assuming that it's the same for each platform. Do you by any chance know why they are different? Let's say we have an AssetBundle with just images. What is the difference if this bundle is build for one platform or another? Just curious, I'm already happy about the answer ^^
     
  5. fengelbkool

    fengelbkool

    Joined:
    Feb 8, 2019
    Posts:
    6
    The difference is basically how the images are stored and compressed inside the asset bundle. One compression format in one platform might not be compatible with the other platform. And also shaders in particular are different on each platform.

    If you have an AssetBundle only with data, for example ScriptableObjects (that doesn't have any reference direct or indirect to images or prefabs) that assetBundle can be shared between platforms. But you have to be very careful on what data those ScriptableObject refer to, explicit or implicit.

    I was looking for the documentation that explain that, but I could only find that in the documentation from 5.5 :(:
    https://docs.unity3d.com/550/Documentation/Manual/AssetBundleFAQ.html in the question
    Are AssetBundles cross-platform?
     
    ManuBera likes this.
  6. ManuBera

    ManuBera

    Joined:
    Aug 19, 2021
    Posts:
    70
    Of course, I forgot the platform specific stuff like compression and other settings. Makes a lot of sense xD Thank you again! :)