Hello there, wanted to share some feedback on Addressable, and maybe get answers to some of our issues.
It’ll be a long thread, sorry for that. If you think some points should have their seprate threads of bug filled, don’t hesitate to say so.
We’re working on a mobile game that we intend to update regularly with new content. Addressables seemed the way to go when we started investigating, and after a few month of development having moved our assets on using Addressables where we wanted to (all the data that can be updated during the game lifitime), but still having them embedded in the application, it’s time to move on putting most of them on a CDN server so we have a client as small as possible. And with that step comes a bunch of issues.
1 - Auto download
The first point for us is one of the core features of Addressables: if the asset is not present, it is imediately downloaded. Problem is, on mobile phone, I need to display an acceptation popup if the download is too big… I truly wished there was a way to prevent auto-download (for, now, I’m going the hacky way using InternalIdTransformFunc to cut all download tentatives before I said ok).
And if you’re asking “why am I doing this, requesting a file I don’t have already downloaded?”, the answers is related to a dependency issue I will explain later. What I’m willing to do (and supposed to have) is to show my stat screen, which uses some addressable elements that could be dynamically modified using Addressable updates (like background, but alos localization files). The game embedd the group containt the initial version of the file, so we don’t need to download anything theorically to display it (which is true if we don’t consider the issue I got into).
2- “Download All” feature
There is currently no way to use DownloadDependenciesAsync to download all missing bundles at once (and obviously same for GetDownloadSizeAsync). I hacked this by creating a custom BuildScriptPackedMode and adding a tag to all files present in all groups.
3- Catalog managment
I played a bit and did some tentatives on this one. What I need is to be able to update the catalog at a later time, so the game can select a specific version based on a bunch of parameters (which server I’m connecting to, am I in preview mode…).
Proble is that the catalog distant location (including server URL) is set at compile time, and goes through InternalIdTransformFunc only once at first connection tentative AFAIK. After that, there is no way to change which distant catalog I want to use.
I tried to use the additional catalog to bypass this, but unfortunately some files were present in both catalogs if I used this method, resulting in wrong download size comutation and or file collisions.
Also on this part it would be nice to have a catalog rollback or similar feature. It would be nice to correctly handle “partial download cases”:
- game is on rev 1 with all files locally present
- new catalog is downloaded, file download on the run
- game is killed for any reason during downlaod
- game is restared: we’re on the new catalog, but we don’t have the related files yet… risk of auto download of files prior to getting to the point where we can ask the user.
4- Strange file depencies (bug?)
I think this one is a bug. My packages have something in the likes of:
Pack A
- Asset 1
- Asset 2
Pack B
- Asset 3 (used by Asset )
I have Pack A in local, Pack B is distant at first. Asset 2 uses Asset 3, but not Asset 1.
If I load Asset 1, Pack B is immediately downloaded (and asset 1 is not loaded unitl Pack is here). The reason is clearly because Asset 2 has a dependency to Asset 3, which was proven by doing some researchs and moving assets between packs.
I even found out what could be the issue and may fix it (I insist on the could/may, didn’t test a lot or proff check it a lot), and I don’t know if it was intended, bu I managed to have what seems to be more logical dependecies by altering a bit GenerateLocationListsTask (on 1.17.xx it’s around line 220)
original:
entry.CreateCatalogEntriesInternal(locations, true, assetProvider, bEntry.ExpandedDependencies.Select(x => x.BundleName), null, input.AssetToAssetInfo, providerTypes, schema.IncludeAddressInCatalog, schema.IncludeGUIDInCatalog, schema.IncludeLabelsInCatalog, bEntry.AssetInternalIds);
My hacky, unoptimisez, non guaranteed version
List<string> depList;
IEnumerable<string> dependencies = null;
input.AssetToFiles.TryGetValue(assetGUID, out depList);
if(depList != null)
{
dependencies = depList.Where(k => input.FileToBundle.ContainsKey(k)).Select(k => input.FileToBundle[k]).Select(k => bundleToEntry[k].BundleName);
}
entry.CreateCatalogEntriesInternal(locations, true, assetProvider, dependencies /*bEntry.ExpandedDependencies.Select(x => x.BundleName)*/, null, input.AssetToAssetInfo, providerTypes, schema.IncludeAddressInCatalog, schema.IncludeGUIDInCatalog, schema.IncludeLabelsInCatalog, bEntry.AssetInternalIds);
5 - (Bug) Initialization lock
I unfortunately have no concrete info or produce step for this one, but I hade several cases where the call to
Addressables.InitializeAsync(); is stuck, the operation handler is stuck in a “waiting to launch” state and never begins, preventing all other operations afterward. At this point we can’t do or load anything, except for checking catalog updates.
I might be wrong, but it seems to only occur if the files are all downloaded, or after doing a full data clear on android device using system menus (the latter in my case always resulted in a “now you must reinstall everything” state). But due to the randomness of this issue I can’t point out what’s going on
6 - (Bug) Hosting & CPU
If you have the Addressable Hosting window visible, it eats a core of the CPU at full charge. No matter if hosting is running or not, and if I have it open as a tab but not visible (another tab on the same group is selected), the problem does not occur.
7- Data encryption
As far as I know, there is no encryption of the file on your side, not even a basic one (we have to do it ourselves). A lot of people are asking for it, so we are: preventing data mining or tampering is important for us.
8- Pack separately option & directories
The Pack separately option as it shown in tooltip pack together all files in a given directory. It would be nice to have another option to pack separately all the files in those folders : some groups are left managed by folders so non-tech can more easily uses the system, yet for packaging, update & download reasons we’d like to stil have them packed separately.
I did a quick test to try to do it, and it seems to be doable easily in BuildScriptPackedMode.PrepGroupBundlePacking (I have yet to confirm it 100 % works). But as the function is private with no way to override it, changing it results in needing to have a local copy of addressable and forget about updates.
9 – More export override option
You’ve prepared a bunch of features and virtal functions so we can override part of the build process, it’s nice. It would be great to have more private stuff moved to protected (so we can call them in our overrides) or virtual (so we can specialize them).
10 – The Local group export directory
Using Profiles, you can change the export directories, which is nice. But if I set something other than the default value in LocalBuildPath, it seems to me that the files won’t be embedded in the build. It would be nice to allow us to specify a folder that will still be embedded, as the default directory is inside « Library » which may cause issues with source control, auto build generation and so on.
Thank you for reading everything. I know I did a big wall of text. If anybody has hints regarding my issues it’ll be highly welcomed.