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.
  2. Dismiss Notice

Question Is it possible to store Scenes in a cloud platform?

Discussion in 'Scripting' started by Nicokam, May 26, 2021.

  1. Nicokam

    Nicokam

    Joined:
    May 28, 2020
    Posts:
    64
    Hello everyone,

    Is it possible to store Scenes in a cloud platform and download them to open locally AND/OR load directly from the cloud?

    I have a mobile game with MANY scenes and they are taking up a lot of space. I want to make it light and give the user the possibility to choose what level he wants to play, giving him an option to download the level in order to do so offline or if he is connected to the internet, loading directly from the cloud.

    Is this possible? I haven't found anything online... What are the alternatives?
     
  2. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,741
    Use Addressables, which allow you to bundle assets (including scenes and all their requisite stuff) into downloadable files outside of your executable.
     
    Lurking-Ninja and Kurt-Dekker like this.
  3. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,711
    Very possible. The old way was Asset Bundles. The new way is "Addressables," which are a more-powerful wrapper around AssetBundles. Hie thee to some Addressables tutorials and give it a look. Making individual scenes into addressables and loading them at runtime off some cloud service is totally a thing.
     
    Last edited: May 26, 2021
    Lurking-Ninja likes this.
  4. Brathnann

    Brathnann

    Joined:
    Aug 12, 2014
    Posts:
    7,143
    I'm thinking you'll have to go with addressables. Because you're going with scenes and not just assets, I don't know if you could just save them into a folder yourself and load them somehow. So I believe you'll need to use the addressables caching system. The caching system will allow you to load the level while the player is offline.

    https://forum.unity.com/threads/download-and-save-external-content-catalog.833023/

    An older post, but it might have some good info on how it's used. I only glanced over it.
     
    Lurking-Ninja likes this.
  5. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    9,903
    And if none of the above is working for you, you can choose Addressables too! Cool system with automatic download and reference count and async load and stuff. :D (sorry)
     
    StarManta and Kurt-Dekker like this.
  6. Brathnann

    Brathnann

    Joined:
    Aug 12, 2014
    Posts:
    7,143
    Go with this, much better than the other suggestions. :D
     
  7. Nicokam

    Nicokam

    Joined:
    May 28, 2020
    Posts:
    64
    Wow, wasn't expecting this many answers so fast. I will study this subject then. Thanks!

    Hahahahahah Nice
     
  8. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,711
    One other note: you can put all kinds of random assets into addressables and pluck them out individually by hand, i.e, have special code to extract and put the assets into their place, like images, prefabs, materials, audio, or whatever. This is suitable for certain applications.

    However, it really is like 10,000 times easier if your game is already chopped into scenes, to put the entire scene in the addressable.

    When you add a scene to an Asset bundle or Addressable, 100% of everything for that scene is brought into that bundle and the act of loading that one scene just takes care of ALL of it. Nothing could be easier to code.
     
  9. Nicokam

    Nicokam

    Joined:
    May 28, 2020
    Posts:
    64
    Noted. It makes sense, will keep that in mind. Thanks again!