Is there any more information on the new BuildOption ‘CompressWithLz4’? eg. What exactly gets compressed and what are the potential downsides (increased load times or memory usage?)
I haven’t checked the beta 8 yet, but I’m hoping it would compress all assets (at least outside StreamingAssets, not sure if those get the treatment as well). I’d appreciate some more info, too.
Hi!
The option is equivalent to BuildAssetBundleOptions.ChunkBasedCompression and allows to compress Player’s data with LZ4. (See also [AssetBundleInternalStructure](http:// https://docs.unity3d.com/Manual/AssetBundleInternalStructure.html)).
That affects all data related to scenes and resources (Resources folder) you build player with. Data in StreamingAssets folder is not compressed and copied as is like before.
The following section has been added to the scripting api docs (should be updated soon):
Use chunk-based Lz4 compression when building the Player.
This value allows the data to be stored in a compressed form when the Player is deployed to a device. Decompression is performed in real time when the Player reads the data. Scene or Asset loading might be faster or slower depending on disk read speed when compared to using uncompressed data.
Compressed data files include:
- Player settings - ‘‘globalgamemanagers’’ and ‘‘globalgamemanagers.assets’’ files.
- Scenes and Assets - ‘‘level*’’ and ‘‘sharedassets*.asset’’ files.
- Resources - ‘‘resources.assets’’ files.
- GI data.
- Built-in resources - ‘‘unity_builtin_extra’’ file.
CompressWithLz4 sets compression parameters to Lz4 compression and splits data files into 128KB chunks.
This feature is supported for Standalone, Android, iOS build targets and is default for WebGL target.
Enabling CompressWithLz4 in Android might be a significant performance boost when loading data as Lz4 decompression is faster than the default Zip decompression.
Note:
Compression might affect the size of a game installer making it larger, even though size of the Player on a device is smaller. Subsequent compression is less efficient or even impossible.
Awesome. Thanks for the information ![]()
That’s exactly what I wanted to hear, great job! Thanks! ![]()