Search Unity

Almost nothing with addressables work for me

Discussion in 'Addressables' started by Mockarutan_, Oct 3, 2019.

  1. Mockarutan_

    Mockarutan_

    Joined:
    Apr 26, 2017
    Posts:
    2
    So I've been trying to convert my project to Addressables ever since heard about it 1 month ago. Almost annoyed that I did not catch this feature earlier. I love the idea and at my previous job at Stunlock Studios we actually developed a very similar system (in Unity) back in 2016 for Battlerite, although way less features over all. I think this is overall an excellent way of handling assets and I think that on paper, Unitys approach seems very good!

    But almost nothing works for me. I'm going to run down a few things I can't get to work and then a bunch of questions. It's quite late for me, so maybe I will miss some details or just ramble a bit, but I just need to get this of my chest and try to get some answers before I go mad.

    The first issue is that generally I can't change any settings related to Addressables after first run or so. For example, if I use the "[PrivateIpAddress]" key in "LocalLoadPath" and press play for the first time in a fresh project, I get:

    Exception encountered in operation Resource<IAssetBundleResource>(defaultlocalgroup_assets_all_d0e8a998ddb089c00096f5fc5c08657e.bundle): RemoteAssetBundleProvider unable to load from url http://192.168.0.7/58452/defaultlocalgroup_assets_all_d0e8a998ddb089c00096f5fc5c08657e.bundle, result='HTTP/1.1 404 Not Found'.
    UnityEngine.AsyncOperation:InvokeCompletionEvent() (at C:/buildslave/unity/build/Runtime/Export/Scripting/AsyncOperation.cs:21)


    And my Hosting is turned on, Play Mode Script is in "Packed Play Mode" and my assets are built. So not only does a fresh project not work with Editor Hosting of assets, if I change to "[PrivateIpAddress_1]" in my Local Group settings, Save Project and then press play again. My log will say the exact same thing with the same IP. Only if I delete the Library folder and restart Unity will it change, this problems applies to most Settings. I fully expect this to just be something simple that I missed, but I read every docs I could find, and I have not found an answer.

    Then secondly we have the fact that I can't seem to get the Hosting to work at all. I maybe have managed to get a build to run from it, but then I stopped the Hosting Service and it still worked? I guess there is caching somewhere, but I cant find that either? But since it worked without the hosting running, I presume it did not load assets from it... So I've done the following:

    1. Created a custom Addressables Profile with the LocalLoadPath set to "http://[PrivateIpAddress_1]/[HostingServicePort]" (And build to ServerData/[BuildTarget])
    2. Set my new Profile as the active one
    3. Made sure my Local Group has the right Build and Load path (the one with the IP address)
    4. Marked my test asset (a ScriptableObject) as an Addressable and put it in my group
    5. Made a build with my Addressables Profile Active
    6. Build my assets, (Build -> Build Player Content)

    When I start my build, the Hosing Service does not even notice my build trying to contact it, let alone loading assets from it.

    Third, some questions.
    Can you run from your Editor Hosted Assets in the editor itself? My understanding is that Packed Play Mode does this?
    Can you rebuild assets to you Hosting Service and load the new assets into a build without restarting the running Unity build/player, or do you have to restart the player? (Nothing of this worked at all for me btw)
    In AddessableAssetSettings, what does "Build Remote Catalog" do? I've tried messing with that, but it did not do anything for my problems.

    I'm sorry this is sort of rambly, but I honestly don't event know where to begin to get help with this. Nothing works! I haven't even covered half of the stuff I've gotten stuck on. It's beyond annoying since all concepts makes total since to me after working with a very similar system for 3 years straight.

    Thank you for any help!!
     
  2. Favo-Yang

    Favo-Yang

    Joined:
    Apr 4, 2011
    Posts:
    464
    LocalLoadPath is the path to load settings, local bundles. Shall stay no changes for most cases. Change RemoteBuildPath, and RemoteLoadPath instead.

    Here's a trivial settings look like, upload_2019-10-3_11-29-21.png

    And please build player content every time you change settings to apply it.

    Yes, both catalog and bundles will be cached. Bundle cache through standard asset bundle caching (search caching in unity docs). To avoid caching during development, change your remote group settings as below ("Use Asset Bundle Cache").

    upload_2019-10-3_11-33-51.png

    And if you get any loading errors, make asl test the http address in your browser to verify reachability. To find out the working [PrivateIpAddress_?] in your environment.

    Yes.

    Yes. Make sure using remote catalog, and you need override the player version in settings to get consistent remote catalog url. Otherwise your existing build will of course not be able to notify new changes.
    upload_2019-10-3_11-40-20.png

    Put your catalog (a mapping file from address to asset location) on your server, to make new assets available for old build.

    Checkout this for a step by step tutorial. - https://forum.unity.com/threads/demo-tutorial-for-remote-hosting-using-amazon-s3.724022/
     
    KwahuNashoba, unity_bill and HugoClip like this.
  3. Mockarutan

    Mockarutan

    Joined:
    May 22, 2011
    Posts:
    159
    Thanks for the help, it cleared a bunch of stuff up! Most stuff works now, although it had little to do with what you covered here. I realized a few of the reasons why it did not work. Manly I forgot about "http://" in a few instances, and I did not realize you had to Build Player Content to change meta data about the Assets, like path and URL. So it was just a lot of thing that seemed to do nothing. But I think I have a good grasp of most thing now.

    The Remote Catalog was a mystery to me, so thanks for that! But reloading assets in a player without restarting does not work for me. Have I understod everything right here?

    1. Override Player Version, to like "1"
    2. Build everything
    3. Start the player and load the asset
    4. Change the loaded asset
    5. Increase the Version override to "2" and Build Player Content
    6. Call load on the same asset

    Should this work? Because it does not for me.
     
  4. Favo-Yang

    Favo-Yang

    Joined:
    Apr 4, 2011
    Posts:
    464
    Step 5, changed the version catalog, then the remote catalog path changed. Without publishing a new build, the old client won’t know it changed.

    And I’m confusing about what you mean by loading new asset without restarting your app. The system currently only fetches remote catalog once during an app lifecycle. If remote content updated during an app running, it will not get notified, unless you load remote catalog yourself.
     
    Last edited: Oct 8, 2019
    unity_bill likes this.