Currently, I’m developing a puzzle game for Nintendo Switch (it’s the crosswords to be precise). The game contains about 4500 puzzles (and this number can increase in the future). Each puzzle is represented as a ScriptableObject with some data, so nothing fancy.
Initially, I used a straightforward approach - hard references, no Addressables. It works quite fine except the loading time was not great. It turned out that loading, deserializing, and calling related routines (e.g. constructors) for 4500 puzzles takes some time. So I decided to give the Addressables a shot to make it possible to load only one required puzzle at a time.
But I was unpleasantly surprised by the build size.
Without Addressables: 96954 KB
With Addressables (packed separately): 150187 KB
With Addressables (packed together): 116587 KB
Interesting that when the assets are packed separately (and the build size is 150187 KB) the overhead is larger than the puzzles’ data themselves.
I checked for the duplication of the data (Addressables Analyze tools) and that was fine. I also manually checked the Editor.log to be sure that original assets (that were converted to addressables) were not included in the build. Everything seems totally fine. So as far as I can see, the only reason for that is the overhead produced by the Addressables system (metadata?).
I wonder what exactly causes this huge overhead and what’s the way to minimize it?
Unity 2021.2.9; Addressables 1.19.17
This will be various pieces of data.
Firstly the AssetBundle’s themselves contain various information about how to load the data in it, and various overhead see here for more info
So having a lot of Bundles with a very small amount of data will result in significant overhead when using pack separately.
With pack together that is likely the catalog data, or other string data needed to load the assets.
There are various ways you can reduce this.
1: In the Group settings disable any “Include Addresses, Guids, or Labels in Catalog” options depending on your needs: see here for more info
2: In group settings set “Internal Asset Naming Mode” to dynamic. This results in the smallest identification for the addressable assets and how to load them, in both the catalog and bundles.
3: In Addressable settings, enable, “Compress Local Catalog” and “Optimize Catalog size”