![]() The material is created empty and I setup the assetbundle settings for it via inspector (in our project we do that via code, but it works the same way). I haven't found much documentation on what that "version" code is for, but it seems to be Unity's version code for the asset bundle's file format for forward compatibility in the future (from what I've gathered). I literally want to just download the latest version from the server, or pull from the cache. I'm not checking for the AssetBundle's integrity to see if it downloaded correctly in this context. ![]() It's nice that there's a way to check if it downloaded correctly, but the problem is that this is the EXACT same mechanism needed to update the asset bundle too. Then, if an updated asset bundle is found, all Unity does to let you know is throw an exception saying there's a CRC mismatch as if it downloaded incorrectly. I create a UnityWebRequest object with UnityWebRequest.GetAssetBundle(), and call req.Send(). Not only that, but I have to manually open up all of the manifest files, so that I can copy and paste them into the database until I write a tool to do that for me. It's tedious and annoying because I have to make a call to our REST API to get the version/crc pair before I load an asset bundle. The only difference is that I store our asset bundles' version/CRC hashes in a database, and I have a Python script return the version/CRC pair for that asset bundle for the specified platform. Well, now I wrote the story before talking to the pros, but I'll post a follow up to Your asset bundle issue is EXACTLY the same issue we ran in our company's game. No passing in an external configuration file. In a perfect world, we would simply tell the game to download an assetbundle from our ftp and it checks from a small download header if that is already the data the game knows and if it is not corrupted. Maybe we can change our In my conclusion, the current main problem in the assetbundle system is, that the hashvalues and CRCs are given in from outside. Now to fix that, we could download the configration file each time we want to check if we need to download assetbundles, but that would mean to download 300 kb each time the player wants to enter a mission (which happens quite often and is not suitable for a mobile game). Now in the last step, we face our problem: if we update our assetbundles on our ftp while the player is playing, he could potentially download assetbundles with a different CRC than the client expects: the client downloaded the configuration file only at start of the game and we updated the assetbundles after that. game checks which assetbundles are actual needed for that mission and tries to download the assetbundles (battleground, models, textures, materials.) if needed (client knows the CRCs and hashvalues from the start of the game). player wants to play a mission, enters the mission and comes to a loading screen.Ħ. ![]() player can login into game and decides what he would like to do.ĥ. game gets on the preloading screen, checks and downloads static assetbundles (UI atlas, music.) if needed.Ĥ. game parses config and knows now the latest and correct CRCs, hash values and sizes for the assetbundles.ģ. player starts game, downloads "assetbundle_version.cfg".Ģ. The progress of downloading and updating looks like:ġ. We use a small textfile (well, kind of small, but still 300 kb for us) which contains all data we need to tell the client that the assetbundle is updated: CRC, hash value and a size for our loading screen display. Now the biggest problem we face is, that the player has to get from somewhere outside that an assetbundle has been updated. While the former is only loaded when used, the later is loaded when the player starts the game. We use the assetbundles to load battleground (base) and assets (custom additions) when the player is entering a mission, as well as for static assets (UI atlasses, music.). I assume the AB system suggests to have a "preloading mechanism" which loads and verifies all assetbundles, before the actual game starts, rather than check on the fly if an assetbundle is up2date or not (which is what we are doing at the moment). I thought about writing about it several times now, but I wanted to talk first to one of the Assetbundle System engineers if my implementation of our system is using the AB system wrong or if we missed something. I tried and it works, but not in the way I would like it to have.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |