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

[RELEASED] RemotePackageManager - AssetBundles

Discussion in 'Assets and Asset Store' started by matheuslr, Jun 7, 2014.

  1. hjupter

    hjupter

    Joined:
    Dec 23, 2011
    Posts:
    628
    Hi, there is any way to build a single asset bundle? we a lot of bundles in our project and every time we click Build Packages that takes like 10-15 minutes (maybe more) and it looks like its building all bundles. Any idea?

    Thanks
     
  2. matheuslr

    matheuslr

    Joined:
    Aug 27, 2013
    Posts:
    42
    Hello, there!

    Unfortunately, there's no way to build a single AssetBundle because of the way the Unity API works. However, whenever you click the "Build Packages" button, Unity will try to iteratively build your bundles. But for that to work, you can not delete the bundles previously built.

    Internally, we use this Unity's function BuildPipeline.BuildAssetBundles()
    http://docs.unity3d.com/ScriptReference/BuildPipeline.BuildAssetBundles.html

    Hope it helps!

    Matheus
     
  3. agamemnon-prime

    agamemnon-prime

    Joined:
    Aug 1, 2014
    Posts:
    9
    Has anyone succeeded in building an app for Windows Store? We are getting an error "Could not either download or load a cached copy of the AssetBundle Manifest"?
    Still investigating further. Just thought I'd ask :)
     
  4. JoeriVDE

    JoeriVDE

    Joined:
    Jan 28, 2015
    Posts:
    6
    Hi, I work with agamemnon-prime and am also in quest of a working wsa build using Remote Package Manager. We're using a .Net scripting backend to compile the code from Unity to Visual studio and from there make a windows store package (we're targeting surface tablets). We get to a succesful build in VS, however at runtime we are getting the Remote Package error stated by my colleague. We also tried using streamingassets instead of downloading the packages, but with no result.

    So we decided to try to build the RemotePackage examples to see if we were doing anything wrong. Some questions/details surrounding that:
    1 Are we building the packages for the right target? We thought that WSA would be the right target, but this didn't solve our problem.
    http://tinyurl.com/zozzplf

    2 For testing the app on my local pc, I'm using these settings:
    http://tinyurl.com/ht3tgfu

    3 This is the output we get when running the app in VS (the error as stated above):
    http://tinyurl.com/jhunol5
    http://tinyurl.com/h9ke2pk

    4 Because the output error returned a path using the 'MetroPlayer', I figured that maybe we should be using the Metro Player build target in the Remote Package Manager, but trying to build that gave me this error: 'Building an AssetBundle for target '' is not allowed because your license does not include it.' Frankly, I have no idea what module/build support or license I'm supposed to install to build the packages for the Metro Player target.
    http://tinyurl.com/j64quxm
    http://tinyurl.com/jnlkrtw

    Does anyone have an idea how to fix this?
    Thanks in advance, any help would be greatly appreciated!

    EDIT: since the 'Images' do not seem to be working, I had to change them to normal links..
     
    Last edited: Sep 13, 2016
  5. JoeriVDE

    JoeriVDE

    Joined:
    Jan 28, 2015
    Posts:
    6
    Fixed it ourselves, the problem was that the bundle was expecting the platformname 'wsa' while Unity's 'Application.platform' returns 'MetroPlayerX86' or 'MetroPlayerX64'. So it was a simple matter of editing the 'GetCurrentPlatformName()' method to catch these. I've also included 'WSAPlayerX86', 'WSAPlayerX64' and the ARM variations.

    Note: In the Unity Editor, these platforms actually do return 'wsa' when building for the windows store, because that is the active build target. It's only later in VS that these change to the selected build mode (described in my earlier post).

    The snippet (starts at line 287 in RemotePackageManager.cs) :

    Code (CSharp):
    1.     private static string GetCurrentPlatformName()
    2.     {
    3.         string platformName = string.Empty;
    4. #if UNITY_EDITOR
    5.         platformName = GetPlatformName(UnityEditor.EditorUserBuildSettings.activeBuildTarget);
    6.         Debug.LogFormat("Active build target == {0}", platformName);
    7.         return platformName;
    8. #else
    9.         platformName = Application.platform.ToString().ToLower();
    10.  
    11.         if (platformName.Contains("webplayer")) {
    12.             Debug.Log("Active build target == webplayer");
    13.             return "webplayer";
    14.         }
    15.  
    16.         if(platformName.Contains("metro") || platformName.Contains("wsa") || platformName.Contains("arm")) {
    17.             // Using Debug.LogError because normal Unity Debug.Log does not log in VS debugging mode
    18.             Debug.LogError(string.Format("Active build target == {0}", platformName));
    19.             return "wsa";
    20.         }
    21.  
    22.         bool windows = platformName.Contains( "windows" );
    23.         bool osx = platformName.Contains( "osx" );
    24.         bool linux = platformName.Contains( "linux" );
    25.         if( windows || osx || linux ) return "standalone";
    26.  
    27.         string replacedPlatformName = platformName.Replace("player", "").Replace("iphone", "ios");
    28.         Debug.LogFormat("Active build target == {0}", platformName);
    29.  
    30.         return replacedPlatformName;
    31. #endif
    32.     }
    Might be worth to put in your next update dev. ;)
    I also would altogether go for a switch case statement running through the UnityEngine.RuntimePlatform enumeration, will work a bit faster than converting it to a string and checking if it contains something.
     
  6. matheuslr

    matheuslr

    Joined:
    Aug 27, 2013
    Posts:
    42
    Hello, JoeriVDE.

    Glad that you were able to fix this issue!
    I'll post an update ASAP to the AssetStore.

    Thank you for taking your time to share this fix :)

    Matheus
     
  7. destiny0114

    destiny0114

    Joined:
    Sep 18, 2016
    Posts:
    2
    does the package can upload to mega?
     
  8. matheuslr

    matheuslr

    Joined:
    Aug 27, 2013
    Posts:
    42
    Hmmm never tried it. Does it support upload via FTP? If yes, then yes you can. However, if it's a proprietary file upload protocol, then I'm afraid not. It'd require a custom uploader code if it's even possible :)
     
  9. TripAAA

    TripAAA

    Joined:
    Nov 20, 2012
    Posts:
    8
    Just bought your plugin, having issues understanding how it works because I have it loading correctly but even when I delete the asset and the bundle data exported it still loads (and even when I turn off access to the internet). Is it cached somewhere and where if so and how do I clear it to make sure it's loading from my S3. Also does ftp support sftp (I use ec2). Lastly and this is the big one, I can't seem to get this to work with WebGL, it simply doesn't load, I did export to Mac Intel and it worked fine, does this not support webGL yet, I made sure the bundle was built with webGL selected by the way in the manager. Any tutorials by the way on how to use this properly , I see some videos but its fragmented , no simple start to finish tutorial video that I can find at least. Anyhow thanks in advance.
     
  10. matheuslr

    matheuslr

    Joined:
    Aug 27, 2013
    Posts:
    42
    Hello, TripAAA.

    I'm sorry to hear that :(
    What troubles/issues are you facing? Did you take a look at the example scenes?

    This is how you're supposed to used to use AssetBundles in a nutshell: instead of pre-buildingBui every possible asset in the build, you let yourself add assets to your project post-build/runtime. This way, you can't have a direct reference to the asset within the editor otherwise, it will be included in the build. What we do instead is to pack these assets into bundles (prefabs usually) and we reference them just by name.

    So, when using this asset, you'll be calling RemotePackageManager.Load("bundlename") to find these bundles and then take your dynamic assets from there. Check the example script "InstantiateCube.cs" to illustrate it better.

    Regarding WebGL, it should work. Here is a picture of me running one of the example scenes through Firefox (attached). What is your setup? How are you testing? What server you're using to serve the Asset Bundle files? What does your RemotePackageManager inspector look like? Does it have "Use Streaming Assets" checked? What is its "Base Uri"?

    How I managed to make it work locally:
    - force rebuild all bundles to WebGL (leave "local" button unchecked in "Pkg Manager Window")
    - start an HTTP server in the folder "Assets/RemotePackageManager/AssetBundles_RecentlyBuilt"
    -- I used nodejs. "npm install -g http-server". Then you run it by going to the target folder with cmd and then pasting "http-server -a localhost -p 80 --cors"
    - Uncheck the "Use Streaming Assets" in the RemotePackageManager in the scene
    - Change the "Base Uri" to "http://localhost" in the RemotePackageManager in the scene
    - Then build and run it

    Hope it helps you :)

    upload_2016-12-15_23-52-26.png
     
  11. TripAAA

    TripAAA

    Joined:
    Nov 20, 2012
    Posts:
    8
    Thanks for the quick thorough response! I ended up simplifying and writing my own code to realize that didn't work. After all was said and done I got it to work with a combination of cross domain tweaks and big thing was enabling gzip in nginx on my ec2 server. So most likely a lot of the issues is not with your work but rather the server setup. I'm going to retry your asset again with this in mind. Thanks
     
  12. matheuslr

    matheuslr

    Joined:
    Aug 27, 2013
    Posts:
    42
    Glad to hear that you managed to make it work :)
     
  13. neoneper

    neoneper

    Joined:
    Nov 14, 2013
    Posts:
    48
    In my current project aimed at mobiles, the need arose to include new languages. We use narration audio files, so for each new language, our project will gain a lot of weight, due to these new audio files that should be part of the project.

    The solution now is probably to use a Bundle system, to put these audio files and other pertinent files to your language in separate packages. This way, the user will download only the assets related to the language chosen.

    I do not have any experience with these services, so I have the need not only to buy your asset but also to receive a small amount of support, enough to make this service clearer for me.

    So I have three doubts.
    1 - With your Asset, I will be able to solve my problem mentioned above ?.
    2 - After I buy your package, would it be possible for me to match some additional value with you through skype so that I have a support with a little more attention?
    3 - My application is currently available in the App Store and also in Google Play. With your Asset, will not I have trouble continuing to work with them?

    I am looking forward to acquiring your your asset if it meets these needs of my project!
    Thank you! I apologize for my bad English!
     
  14. matheuslr

    matheuslr

    Joined:
    Aug 27, 2013
    Posts:
    42
    Hello, Neoneper!

    AssetBundles seem like a good solution for your case. We have a game (Holodrive) which uses bundles to only load character's equipped customizations and reduce build size.

    That said, you could work it by creating a bundle for each language you need. Then, in your application, you only download the correct bundle. That's the super high-level logic.

    If you need support, you can contact me by email: matheus@bitcakestudio.com

    You said you have the applications already live. What kind of trouble do you mean? It's ok to use AssetBundles in these stores. Just keep in mind that you'll need to update your application in these stores with the AssetBundle logic.

    Any question you can contact me :)
     
  15. qualitat

    qualitat

    Joined:
    Nov 24, 2014
    Posts:
    2
    no work unity 2017
     
  16. matheuslr

    matheuslr

    Joined:
    Aug 27, 2013
    Posts:
    42
    Hey, Qualitat.

    Thank you for reporting this issue!
    I'm already on it and it should be live on the Asset Store soon :)
     
  17. kaiyum

    kaiyum

    Joined:
    Nov 25, 2012
    Posts:
    686
    I do not need the "building asset bundle" feature as this has already been done by official packages. I need to load them from disk. The situation of mine is like this:
    1. On appropriate time, I call a method like this to download the dlc data from internet:
    Code (CSharp):
    1. TryDownloadBundle(string serverURL, string bundleName, Action<bool> OnFinishDownloadBundle, string diskSaveRelativePath = "/data/dlc/foo1/");
    2. Then on appropriate time, I call this method to load the bundle into memory:
    Code (CSharp):
    1. TryLoadDLC_DataFromDiskToMemory(string diskPath, string bundleName, Action<bool> OnFinishLoad);
    3. Then when I wish to load an asset or scene, I call something like this:
    Code (CSharp):
    1. T TryLoadAsset<T>(string bundleName, Action<bool> OnLoadAsset);
    2.  
    3. TryLoadScene(string bundleName, Action<bool> OnLoadScene);
    Remember all these operations are asynchronous and I wish to know the progress to show some UI thing or even a minigame-who knows.

    Can this be done by your plugin?
     
  18. matheuslr

    matheuslr

    Joined:
    Aug 27, 2013
    Posts:
    42
    Hello, Kaiyum!

    So, IMO, one of the coolest features of RemotePackageManager is that it allows you to change from where you download the bundles (even to load it from the editor) at any time, without changing a line of code and it still works.

    This way, you can rapidly (iterate while still inside the editor) without needing to build/rebuild bundles.

    Also, there's an API to receive updates on the download progress of your AssetBundles, so you can update your UI to display a nice progress bar.

    Hope this helps :)

    Matheus
     
  19. Kagyu

    Kagyu

    Joined:
    Mar 5, 2016
    Posts:
    95
    Hello!


    I have just bought RPM and now playing around with it.

    I made my Amaozn Aws account and it seemed I managed to upload some asset bundles to my bucket via RPM.

    But when I tried to get the asset from Amazon S3(with "force WW" check box on, "use streaming asset" check box off and set correct url of my amazon s3 bucket), my console gave me an error saying ""souryu" package error: "Encountered invalid redirect (missing Location header?)""

    Unfortunately, I am newbie coder, very new to Amazon S3 and asset bundle stuff, so I have no idea what caused this error.

    The test scene work fine when I grab the asset from streaming asset folder.

    Can you please tell me how I solve this issue, please?



    Windows 10
    Unity 2017.2.0f3
     

    Attached Files:

  20. matheuslr

    matheuslr

    Joined:
    Aug 27, 2013
    Posts:
    42
    Hey, Gisono!

    hmm never seen that error. Maybe the provided URL is not correct?

    If you right-click the manifest file under standalone folder it shows its public url
    (something like copying it to clipboard or opening in a new tab).

    Once you have its public url, are you able to download it from the browser (by
    opening it in a new tab)? If that works, what was its url? If it doesn't, can you show
    me a print of the menu when you right-click the manifest file?

    Thanks :)
     
  21. Kagyu

    Kagyu

    Joined:
    Mar 5, 2016
    Posts:
    95
    Matheusir,

    Thank you so much for your reply!
    Now I got it working. It was all about wrong URL. As you advised, I got url from its manifest and used the part of url to set RPM's base url then all problems were gone.
    Before that, I set RPM's base url in virtual host style. With setting base url in path style, everything seems fine.
    Thank you for your help.
     
  22. matheuslr

    matheuslr

    Joined:
    Aug 27, 2013
    Posts:
    42
    I'm glad you figured it out :)
     
  23. heavy_thebrit

    heavy_thebrit

    Joined:
    Mar 2, 2017
    Posts:
    8
    @matheuslr I am trying to use the package but I am getting an "Absolute URL is too short" error when uploading to S3?
     
  24. heavy_thebrit

    heavy_thebrit

    Joined:
    Mar 2, 2017
    Posts:
    8
    Seems it is to do with Us-east-2 which is not available in the selection drop down?
     
  25. blueFire

    blueFire

    Joined:
    Nov 27, 2010
    Posts:
    68
    Does this product now work on Unity 2017.3?
     
  26. matheuslr

    matheuslr

    Joined:
    Aug 27, 2013
    Posts:
    42
    Hey, heavy_thebrit, I was unaware of the Us-east-2 region. You can add it by adding the enum "
    us_east_2" to AmazonS3Uploader.Region in the AmazonS3Uploader.cs script :)

    blueFire, it should work on Unity 2017.3, yes!
     
  27. heavy_thebrit

    heavy_thebrit

    Joined:
    Mar 2, 2017
    Posts:
    8
    I havde added it in but it fails to work. I assume its due to the versioning they have with the endpoints and it needs to submit requests differently?
     
  28. matheuslr

    matheuslr

    Joined:
    Aug 27, 2013
    Posts:
    42
    Hmmm now I'm not sure.
    Did you try it on another region just to see if everything else works?
     
  29. heavy_thebrit

    heavy_thebrit

    Joined:
    Mar 2, 2017
    Posts:
    8
    Other regions are fine, just cannot add this new one. Could you test for me? There are a lot of regions to choose from now, more than whats available in the plugin.

    Another thing I am wondering is why you do not provide a callback with plain AssertBundle data, instead of converting it all into your own callbacks?
     
  30. noamriahi

    noamriahi

    Joined:
    Oct 15, 2019
    Posts:
    4
    Hi, there is support with scenes? I Mean can I save scenes as asset bundles?