Using LoadContentCatalogAsync with CCD buckets?

I feel like I’m very close to getting my desired remote content setup working, but it’s probably better to simply describe the plan rather than my specific trouble spot first.

What I’d like to achieve:

I know it’s possible to have a ‘main’ project add remote Addressable catalogs from multiple ‘content projects’ by using LoadContentCatalogAsync; I want to do this by hosting the bundles from each content project on CCD. I’ve never done it before but it’s supposedly been possible for years now. The plan is to have a minimal main project use Remote Config at startup to fetch a list of remote catalog URLs for LoadContentCatalogAsync to fetch. However, for simplicity sake, I’m just using one debug URL at the moment.

I’ve got a separate content project with the sole job of building out an Addressable scene asset, complete with dummy cube. Remote catalog building is enabled and I’ve set the RemoteLoadPath for this project to point to a CCD bucket release (not sure if this is necessary…). That builds out as cube_all.bundle nicely, so I upload the bundle and catalog and hash to the CCD bucket.

Ideally, this ‘main’ project would be able to pull remote scenes like this from potentially many different CCD buckets without any knowledge of each other. This is possible, right?

The problem I’m having in my attempt:

Now for my specific issue, I fetch the remote catalog using LoadContentCatalogAsync and that works great. I can query Addressables for ResourceLocations at that point and it does find this Cube.unity scene. If I ask it what the download size is with GetDownloadSizeAsync, it correctly answers the byte amount, looking good. But when I go to actually download using DownloadDependenciesAsync, I get the following:

UnityEngine.AddressableAssets.InvalidKeyException: Exception of type 'UnityEngine.AddressableAssets.InvalidKeyException' was thrown., Key=Assets/Scenes/Cube.unity, Type=System.Object

If I go to actually load via LoadSceneAsync, I get a whole bunch of errors:

Unable to open archive file: Library/com.unity.addressables/aa/OSX/StandaloneOSX/af0ec3231eaf1c31deb12038dda80b64_unitybuiltinshaders_3dd91f4109fbd8368fc8155e49d57676.bundle

Failed to read data for the AssetBundle 'af0ec3231eaf1c31deb12038dda80b64_unitybuiltinshaders_3dd91f4109fbd8368fc8155e49d57676.bundle'.

RemoteProviderException : Invalid path in AssetBundleProvider: 'Library/com.unity.addressables/aa/OSX/StandaloneOSX/af0ec3231eaf1c31deb12038dda80b64_unitybuiltinshaders_3dd91f4109fbd8368fc8155e49d57676.bundle'.

Both the main project and content project are using Unity 2022.1.23f1, Addressables 1.20.5, CCDM 2.1.0.

Any idea how close I am to achieving the setup? It feels very close so it’s correctly ingesting the remote catalog and can poll the scene bundle sizes… it just seems to be tripping over the bundle containing Unity’s default shaders, but that doesn’t appear in the bundle build location (it appears elsewhere) and uploading it anyway makes no difference.

Oh, interesting revelation.

If I copy the unitybuiltinshaders bundle into the Library folder on the main project (which won’t possible through Addressables/CCD but just curious if it would work)… Unity will actually start loading the scene but never seems to complete, the scene name appears in the hierarchy panel with (Loading) next to its title. My guess is an internal error that doesn’t appear in scope of the console.

So upon closer inspection, it seems that my content project scene bundles have this unitybuiltinshaders as a dependency. But if I make the main project generate its own, the name hash and file size is a bit different so it’s not a good replacement.

There’s an ongoing thread of people trying to hack their way around this issue here > Loading multiple catalogs each using builtin shaders

But I’m wondering if it’s simply the wrong approach or something being misunderstood here, it doesn’t sound like the right way to use LoadContentCatalogAsync.

Is it possible to get a quick official thumbs up or thumbs down on whether remote catalog scenes are possible? I really need to know if it’s worth pursuing for the business year.

I am not sure if this will help you or not but in my investigation into creating a separate content application I came across this https://docs.unity3d.com/Packages/com.unity.addressables@1.21/manual/common-workflows/MultiProject.html and there is a note at the bottom

Handling Shaders
Addressables builds a Unity built in shader bundle for each set of Addressables player data that gets built. This means that when multiple AssetBundles are loaded that were built in secondary projects, there could be multiple built in shader bundles loaded at the same time.

Depending on your specific situation, you may need to utilize the Shader Bundle Naming Prefix on the AddressableAssetSettings object. Each built in shader bundle needs to be named different from others built in your other projects. If they’re not named differently you’ll get The AssetBundle [bundle] can’t be loaded because another AssetBundle with the same files is already loaded. errors.

1 Like

Thanks, looks very relevant, next time I’m trying out this structure I’ll give it a shot!

Did you ever manage to achieve this? I’m trying to implement now and running into trouble!