![]() This is important for us because the total size of our app using LZMA AssetBundles on iOS devices (once all AssetBundles had been downloaded from our servers) was close to 1.5Gb. ![]() The hardware requirements for LZMA AssetBundles are the disk space of the compressed LZMA bundle plus a memory buffer equal to the entire uncompressed size of all of the assets in the LZMA bundle. So, the hardware resources required for LZ4 AssetBundles are just the disk space of the compressed LZ4 bundle plus a small memory buffer to decompress chunks of the bundle. If you use LZMA, the entire AssetBundle must first be decompressed into a separate buffer to read even a single Asset. Assets in LZ4 compressed AssetBundles can be loaded directly from the compressed LZ4 file without needing to decompress the entire AssetBundle. ![]() There are other benefits to using LZ4 compression in addition to the fast loading times. This average is based on the results of about 50 AssetBundles that range in size from 3Mb - 20Mb. LZMA compresses on average 34% smaller than LZ4 for AssetBundles we have built to deploy on our servers. The total combined size of the three LZ4 compressed AssetBundles is (16.5Mb): one of them is 14.5Mb and the other two are about 1Mb each. They are all loaded immediately at startup and required for the app to continue. jar (Android) file so the binary you place in the App Stores won't be much larger.Ĭurrently, we are deploying three AssetBundles to the StreamingAssets folder. Keep in mind that while LZ4 AssetBundles are larger than LZMA AssetBundles, the AssetBundles in the Streamingssets folder will still be compressed further when included in a. every downloadable AssetBundle would include its own copy causing every downloadable bundle to be larger than it needs to be.īy keep these "system" assets inside an AssetBundle in the StreamingAssets folder compressed with LZ4, we get very fast load times and don't have duplicates in every downloadable asset bundle. If you have commonly used assets like fonts, shaders, etc. Assets placed in the Resources folder aren't available to assets inside AssetBundles! Instead a copy of the asset found in the Resources folder will be added to each downloadable AssetBundle that references it. The reason is that many of these "system" assets are referenced by other assets contained in AssetBundles that are downloaded from our servers. You may ask: "Why we you just keep these assets in the Resources folder and not inside an AssetBundle?" Using LZ4, the loading is nearly instantaneous (1-2 seconds). ![]() With LZMA, we would see 10-15 second startup times as the bundles in the StreamingAssets folder were decompressed. We found that LZMA decompression caused a pretty serious slowdown in the startup time of our app. These are things we want the user to see immediately without having to wait to download them from our server. This includes things like dialogs, the initial game tutorial, etc. We keep all of "system" assets that we want immediately available to our app inside AssetBundles in the StreamingAssets folder. The tradeoff is that LZ4 bundles are larger than LZMA bundles. LZ4 decompression is way faster than LZMA decompression. ![]()
0 Comments
Leave a Reply. |