#📦┃addressables

1 messages · Page 4 of 1

undone hound
#

You need to put the CDN URL in the path, with /[BuildTarget] on the end..

steep lichen
undone hound
#

where's the https://?

#

the build path is the path to where the addressables should be built to on your machine.

ServerData/[BuildTarget]

Will put it in <drive>/UnityProjects/ProjectName/ServerData/Android

steep lichen
undone hound
#

it's difficult to help when you don't provide things exactly as you have them.

#

name.b-cdn.net/[BuildTarget]

This doesn't look very unique. How is the CDN supposed to point to your bucket (or whatever name they use)

steep lichen
#

i should stop making examples and just show screenshots instead, i guess

undone hound
#

is creobitdata unique to you?

steep lichen
undone hound
#

I haven't used this platform you are, no idea if
creobitdata was given to you -> fine
is the host -> not fine
is something you added -> fine

steep lichen
#

i just follow the tutorial because this thing is needed for one test program for job offer, so i'm also in the dark here, and running out of time a little

it is something i added

rancid wigeon
#

whats the correct way to check if an asset reference is already loaded so not to load it again?

#

unity has not got very good code samples to learn addressables

rancid wigeon
#

I tried IsDone and IsValid but neither of those seem to be correct

foggy widget
#

Are Addressables a good way to make Scriptable Object references into savable data?

I have this idea of using Newtonsoft alongside Addressables, to make inventory items in my game use an Addressable "Asset Reference" that leads to the Scriptable Object they're meant to use.

steep lichen
#

i'm going insane here.
addressables throw Invalid URI: Invalid port specified. exception on pretty much anything i put in LoadPath.
i tried a lot: CDN, local FTP, local directory, native RuntimePath.

i'm guessing here that my addressables are just broken.
Any ideas?
Or better yet, any way to unpack bundles manually in code? Cause i think loading and unpacking them manually will be better solution now catcrymic

#

fucking nevermind me

#

it works now

#

Now i know that you have to rebuild assets

quaint locust
#

What are addressables and what do they do?

frigid stag
rancid wigeon
#

the docs kind've suck at explaining them

frigid stag
rancid wigeon
#

so IsDone is true if essentially .Asset is not null?

frigid stag
#

It can fail I believe. If like it isnt valid I believe

#

I had issue earlier when trying to only use IsDone

#

So I used .Asset to check

rancid wigeon
#

@frigid stag quick Q, if you add a scriptable object as an addressable and it references a unity object say a mesh file, does that mesh file also need to be marked addressable or is it automatically done for you

hoary rampart
rancid wigeon
rancid wigeon
#

rebuilding addressables every time i change something is such a slow down on dev time

frigid stag
paper frigate
#

is there a way of speeding up the loading for these addressable prefabs that include models. The initial loading is quite slow. After loading them once, they are in the cache, even after restarting the application (which makes testing speeds quite annoying because I can't find a way to empty it)

Any setting I could change to make the intitial loading faster? Online I read a lot of conflicting things e.g. using unitywebrequest is faster even if the files are local (but this would only apply for android?). Also uncompressed is faster than LZ4?

viral cairn
#

i just downloaded unity and its using thunderoad (which is the game thing for b&s) and while its loading the timer stops and it doesnt load

#

whats the problem?

remote lantern
#

This might be a dumb question, but does the Android platform support Addressables (prior to the Addressables for Android for Unity 2023)?

I've been using Addressables for PC (Unity 2019 and 2020) for a while and thought that mobile was supported, but I'm really struggling to get a working apk with addressables and Asset Bundles. Is there something I'm missing? When I build out, the apk is smaller than expected and no addressables load, so they files must not be present. Is there a StreamingAssets folder in the Android build folder I can move them to manually?

There are no plans for a Google Play store release, so hacks are welcome.

hoary rampart
stuck wolf
#

Hi there, I have a question that's stumping me... In the cloud build I have written a PostExport script and configured it; this script is being called and what it does is it Brotli compresses all of my Addressable files one by one and then it deletes the original .bundle files. I have debug logged to confirm it works in the cloud build. So far so good. ✅ Now, when I try to click the 'Download Addressables' button in the Build History I get the good old zipped folder with the .bundle files instead of my .br files... HUH? 😆 Does anyone know why this would happen?

Solution: Hey everyone so in the end by logging things we came across the fact that the download button downloads from a certain path on the cloud server. You can use the following path to reach there. Hope this helps someone who comes across it! ${WORKSPACE}/.build/last/${BUILD_TARGET}/extra_data/addrs/

bitter root
#

is there no true way to background download addresables in webgl? 😐

#

all download methods freeze my game until the download finishes 😐

#

I mean, I can do it in javascript 😐

#

it's just fetch and continue with your life

remote lantern
#

@bitter root Unfortunately not -- WebGL only has a single thread available to it.

remote lantern
bitter root
bitter root
#

99.9% of the way there... now I only need to get a list of all addressable bundles...

#

unity catalog ain't helping 🥲

storm cove
#

hello can anyone help me with this errors, the build of the addressable is field and I don't know how to fix that

next inlet
#

Or you can move your assets so they are closer to the root Assets folder, keep folder paths as short as possible, and keep the asset names as short as possible

late agate
#

Are Addressables the recommended solution for storing things like ScriptableObjects? I have a bunch of Weapon & Armour scriptable objects and am wondering what the best way to store them and reference them is so I can reference them later in code (like when a weapon is equipped to find the weapon scriptable object and attach it to a player class)

rustic scarab
warm talon
#

Hi

How can I fix this??

I use addressables to load audio clips

When I load this from bundle I have this error(

next inlet
#

HI all, my team is trying to decide between two strategies for packing Addressables. The game uses a dynamic streaming solution where assets are organized into cells, and different cells of content are loaded/unloaded as the player moves around the world.

Strategy 1: The Game Object Prefabs that are actually loaded/unloaded are organized into Addressable Groups by content type. At the moment this means Terrains go into one group, and non terrain goes in a separate group. For the terrain, Pack Separately is used, so each terrain gets packed into its own bundle. For the non terrain, there can be multiple prefabs per cell, so all prefabs that are associated with the same cell get the same label, and Pack by Label is used. So basically the content that is loaded/unloaded together can be packed into the same bundle. For dependencies (meshes, shaders, materials, etc.), everything is placed in a single Group that is Packed Together, with the idea being that most of these assets will be needed no matter which cell the player is in.

With this strategy, most of the memory used by the prefabs is freed right when each cell is unloaded, which is optimal. Some memory from the dependencies might not be freed even though it could be, however Resources.UnloadUnusedAssets can be used as a fail safe if memory grows too large.

Strategy 2: All prefabs (terrain and non terrain) and dependencies are placed in a single Addressable Group set to Pack Together.

With this strategy, Resources.UnloadUnusedAssets has to be called fairly regularly since assets from the single bundle aren't unloaded automatically. This results in noticeable lag during game play.

You might be thinking, Strategy 1 is the obvious winner, however there is a conundrum that we can't figure out that is confusing the issue. On both my PC and iPhone, RAM usage is nearly identical between the two strategies. However, on my teammates iPhone 13, he is crashing upon startup and says the memory is going over 3GB.

#

_ _
Yet with Strategy 2, he does not have this problem.

#

_ _
This isn't making sense to me, as as far as I can tell there are not enough additional asset bundles with Strategy 1 to make a difference (they are KB's in size). So two questions:

  1. Does your understanding of the packing modes support the notion that Strategy 1 should be the winner, and not result in a large increase in RAM usage?

  2. Does anyone have any ideas as to why RAM usage might be higher with Strategy 1? Is there a possible Addressable Setting somewhere that could be causing this, or must it be something unrelated (some bug or other issue)?

#

Sorry for the long question!

#

For reference, this is the build report for Strategy 2.

#

And this is the build report for Strategy 1. As you can see there is hardly a difference in the size of the output

#

I also checked the catalog sizes to see if there was a big difference. There was not

#

Also perhaps worth mentioning. My teammate is using a PC to build the addressables for iOS, using the well known hack. Whereas I am running two tests. One for a Windows Build on PC, and one for an iOS build using a Mac. Is it possibel the use of the PC to make the iOS addressables is somehow resulting in the RAM difference?

hoary rampart
next inlet
#

@hoary rampart On my systems the RAM usage is nearly identical for both strategies with Memory Profiler. My teammate has not been able to test either strategy with the profiler, because strategy 1 crashes on load and also due to some quirk with building the addressables on PC for iOS, he is not able to connect to the editor.

candid pelican
#

@next inlet pls have a look at addressables best practices pinned in the channel.

warm talon
#

I have sprite atlases that are included in the addressables, the Include in build checkbox is disabled

Tell me the correct way to load sprites from this atlas into objects on the scene? What is the best way to do this?

next inlet
# candid pelican <@399073402935181313> pls have a look at addressables best practices pinned in t...

Thanks. I just read through that and it supports my thesis that strategy 1 is better for an open world mobile game. However, my teammate is quite sure that strategy 1 is causing crashing due to high memory use.

Do you think this is remotely possible or must something else be going on?

Everything I have read says that having more bundles can possibly increase memory use, however from what I have seen the bundles are each only KB in size.

The other concern mentioned a lot is the increased catalog size, but I haven't seen much of a difference between the two strategies

hoary rampart
frigid stag
neon pilot
#

Hi there! how is going guys? i have a question about addressables because i use "cutsceneinstanced" gameobject to access his playabledirector and do play, but when i release it it remaining the gameobject in scene, i need to destroy it? chatgpt ask and told me its not necessary to be destroyed but then is reamining in scene with all content of the cutscene

neon pilot
#

well, after search in google unity docs, community, etc.. i cant find a solution but in my hierarchiy remains the gameobject

#

if i did this its clean then

candid pelican
#

@neon pilot since u r instantiating it manually so u have to destroy it manually too. If u use instantiateasync function of addressables class release function will handle the deletion for u. This is also explained in the documentation

neon pilot
prime relic
#

I surely cannot be the only one encountering this. Addressable builds seem to ignore Animation Clips embedded inside models (e.g. fbx), and even though the model is marked as "Addressable" (and also the clips on the animation tab), they are simply ignored and not included in the Addressable build

#

Worse, the Animation clips are all extracted and included in the base build (Which is critical as this prevents making a Google Store submission when you are trying to keep the base build size down)

#

Additionally, the same happens with "sub meshes" of a model, which are also only extracted to the base Unity project and skipped in the Addressable build.

#

Thoughts anyone?

#

Yes, If I separate the clips out of the model, they can be packaged. But this requires you to also remove them from the model, else you just have duplication.

prime relic
#

OK, after further examination, it turns out the Animations and Meshes are actually in the Addressable Bundle. HOWEVER, they are also duplicated in the base build #facepalm

#

Anyone got any ideas for how to exclude these?

candid pelican
#

@prime relic are u referencing ur fbx or its prefab in a script or scene ?

next inlet
#

Our team is using Unity 2022.3.32f1, and we are seeing some performance issues related to shader loading/unloading when using addressables (Shader.ParseMainThread and Shader.MainThreadCleanup). What is the recommended way to deal with this? Using Shader Variant Collections?

I read from a Unity person on the forums that they were working on getting this shader loading/unloading work onto a background thread, but that was back in 2019 and I can't find any information on whether this was ever added in a newer version of Unity. Anyone have any clue?

prime relic
# candid pelican <@332131294664327168> are u referencing ur fbx or its prefab in a script or scen...

No, all prefabs are instantiated at runtime using dynamic configuration.

Essentially what seems to be happening:

1: The Addressable build process runs
2: It unpacks the Models for build
3: Creates the addressable packs
4: Removes ONLY the model file itself from the build
5: packages everything that is left in the core build

Seems to be a genuine bug in the Unity build system, which surprises me that it has existed for so long
(Confirmed the same in a test project with ONLY the model file, not even a scene)

#

I've created a custom build script which actually deletes the built folders after the addressable build which seems to resolve it.

#

However, now I'm having issue trying to run the "Play Asset Delivery" build script for Addressables instead of the default build.

#

Very little docs anywhere on how to build custom build scripts with addressables in C# (which is needed for automation)

#

Anyone got any thoughts on how to change a default build script (as shown below), to one that will use the "Play Asset Delivery" addressable build script?

    [MenuItem("Build/Custom Build with Addressables")]
    public static void BuildGame()
    {
        // Step 1: Build Addressable Data
        AddressableAssetSettings.CleanPlayerContent();
        AddressableAssetSettings.BuildPlayerContent();
        // Need to build "Play Asset Delivery" script and not default
    }
prime relic
#

OK, this seems to hint at how to customise the Addressables Build

#

OK, progress, it is a little destructive and likely only actually useful for automation (unless you like Git revert "a lot") but essentially the process is like this:

  1. Perform an Addressables build using the "Google Play Delivery" profile
  2. Remove the folders containing the packed content
  3. Run a Unity Android build
  4. Profit

Critically
You must ensure that the "Addressable" build settings are set to NOT build with the project to avoid the addressables trying to build twice.

Also, only use the custom build script during automation, or with a folder projected by git (to recover what was removed).
Possibly you might be able to rename the folder(s) your packed content was in with a "~" prefix, then rename it again afterwards

#

Actually, might try that now

next inlet
#

Addressables.LoadSceneAsync has an activateOnLoad parameter that can be used to delay the activation of the scene, which is great. Is there some way to do the same when using Addressables.LoadAssetAsync?

I need this because I have tracked some performance issues down to the Single Frame Integration of multiple Addressable Assets that I queue up to be loaded at the same time. Without any control over the loading, the assets end up getting "integrated" all at once, whereas if I could delay the integration, I could control it in an orderly fasion (only allowing x assets to be integrated in a single frame).

I know I could probably load each one individually, but as far as I can tell the actual loading does happen on a background thread and doesn't impact the game, so queuing them all up at once results in faster loading.

next inlet
#

It's quite strange that there is no mechanism for doing this considering every other Async load method has this functionality.

slate timber
#

Where can i find "what is changed between versions"? There is no "What's new" tab

peak kraken
#

Is it weird to store an asset reference as a field of a gameobject for help keeping track of instance count and then unloading when it reaches zero

somber crypt
#

on android I always get a hang on first load after install.
the first thing I do is download the basic app dependencies. it's failing to find a key file, but I think it's trying to access it too soon. on second load it works. code attached

#

maybe it's my shitty progress bar

#

hmm nope. it's an addressable error. I think I can replicate it with a dev build maybe

#

it spends quite a while downloading, it's just that after that addressables can't find the file I need

somber crypt
#

in the end I just force-restart the app on android after the first download

#

that worked

slate timber
#

Does anyone know why the first addressable request takes so long, the subsequent calls are fine

slate timber
slate timber
#

Im using simulate groups i

#

Asset db dont really simulate the request does it?

candid pelican
#

nope it doesn't

slate timber
#

Man addressables are so meh

#

var sceneLoadHandle = _addressableScene.LoadSceneAsync(LoadSceneMode.Single);

If i yield return this it hangs forever

#

No error

#

funnily enough this only happens the first time when i dont have the file

#

It downloads it fine, but dont load the scene

#

If i reload my game and the file is downloaded itll load the scene

slate timber
#

LoadSceneAsync gives me this:
Scene 'Assets/Scenes/UIs.unity' couldn't be loaded because it has not been added to the build settings or the AssetBundle has not been loaded.

#

And it only happens on the build not editor

slate timber
#

did you manage to figure this out? having same issue on a win build

#

seems like 1.21.20 has issues?

#

aware of a bug but dont attempt to reproduce

#

great

#

time to make a new repo

slate timber
#

yep so addressable scene loading is broken for all of 1.2.0

shell lichen
slate timber
#

The only thing which is a issue rn is the scene loading

shell lichen
#

asset bundles

shell lichen
slate timber
#

hmm dont the asset bundles get loaded in memory though

#

This is the behavior i was trying to prevent

shell lichen
#

only if you call assetbundle.load

slate timber
#

ah

#

ty

shell lichen
#

np

#

another alternative

#

you could serialize the scene to a json file

#

like save all the objects and their position and all components on the object etc to a json file then instantiate it all one at a time

#

will work fine for small scenes

#

but prolly not so w ell for large scenes

slate timber
#

ic ty im going to try the asset bundle stuff and see if it works

molten stone
#

I ran the analyzer and it decreased build size by putting everything in the duplicate asset group. I then moved parts of it(the characters and all assets they use) into a different group and build size increased again. The characters group doesn't reference any bundles and it is not referenced directly either(only by assetreference). What am I doing wrong? Am I not supposed to group assets used together?

slate timber
#

if you select the group, it should show the settings in the unity editor

#

Note how my build and load paths are remote

molten stone
slate timber
#

even my scenes are set to addressables (But this is bugged iin addressable 1.2.0+)

molten stone
#

My scenes are addressable too

slate timber
#

i only said this because your original question mentioned decreasing build size

#

The only way i've seen the ways to decrease build size is if the assets aren't actually in the build and served remotely

#

You can use compression like LZ4HC

#

to decrease it further though

molten stone
#

Maybe. But the issue is that the build size is low(1.69gb) if I leave everything in the jumbo duplicate asset isolation group. If I group related assets into another group the size jumps(3.6gb).
Am using LZ4HC

teal mortar
rocky ember
#

Hey folks! If I load a particle effect prefab from an Addressable, it has no material in builds (or in editor while using the existing build). The Addressable Report lists the material under the prefab. Any idea what's going on there?

solemn apex
slate timber
#

No reply on forum too

#

Looks like they don't give a toss

coral sentinel
#

Where do you guys host your addressables?

warm talon
#

Hi
we are loading a scene from the addressables

the bundle itself is loaded successfully, but then it can't find the scene in the bundle and can't load it

the scene name and the key name in the bundle are the same

this problem occurs when many different bundles are loaded during loading, if you try to load the scene in the game through the debug menu in the same way, it finds it in the bundle

we tried to set a delay before calling LoadSceneAsync but it didn't help

Scene 'Assets/Game/Scene/Scenes/Hotel_03.unity' couldn't be loaded because it has not been added to the build settings or the AssetBundle has not been loaded.
To add a scene to the build settings use the menu File->Build Settings...

warm talon
#

I reproduce this in unity editor

onyx bear
#

What’s the correct way of freeing up memory? I’m using the Release() method but the memory only goes down if I use Resources.UnloadUnusedAssets(), which always causes a stutter.

Any info about this would help me a ton!!

gilded quartz
#

Would a question about localization package make sense here?
I am trying to change the "String reference" of "Localize String Events" through code, like this :
public LocalizedString Title {
set {
this.titleTextUpdater.StringReference = value;
this.titleTextUpdater.RefreshString();
}
}

But when I do, the "Locolive String Event" seems to stop working. It stops reacting to me changing the game's language, and even dispalys a different default language than the rest of the game on startup!

#

Interface is English (correct language the game is in ATM. the Localized String Events there are not code-changed)

#

But the cards display the other language available : French. This is where I applied the code shown above

gilded quartz
#

OK... Made a few more tests and here are a few new things :

  • If I make a build, things go smoothly there
  • The amount of "texts displayed in the wrong language" can vary after changing scenes, etc
#

So this has to do with the way the editor accesses Adressables data that have not been compiled to adressables yet, I believe (direct asset access, I am no longer sure how it's called)

#

I think the editor can be setup to use the compiled adressables instead of doing that direct access. i am going to try that

#

Doing that actually solves my issue.

#

I'll just have to recompile my addressables every time.

#

But I'll leave all that stuff here, could still be useful info to someone or the unity team. There clearly are some issues with that "use asset database" mode. it does not replicate the behavior of adressables properly in this case

dusk viper
#

Anyone know how to build to a specific path ?
When i do that i have an error and i don't know why 😩
I try to build to D:/Assets

Error:

earnest raptor
#

Hello. I have 500 groups in addressable, each group has prefabs, of which there are 11 groups with an approximate number of prefabs of 100, each prefab has 30 child objects with the Sprite Renderer component. The remaining groups have about 20 prefabs with child objects (about 30 objects), which have animations, a sprite renderer. When assembling bundles, I consume more than 220 GB of RAM for the dependency calculator process. Please tell me how to optimize this? Maybe I'm doing something wrong. The project is growing and soon I will not be able to assemble bundles.

graceful notch
earnest raptor
faint surge
#

I just changed my SceneManager.LoadSceneAsync to Addressables.LoadSceneAsync. In editor there is no difference but in built Webgl app it is much slower and buggy. Any settings I need to do? I'm using List<SceneInstance> activeScenes to store the activeScenes.Add(await Addressables.LoadSceneAsync(AssetReference, LoadSceneMode.Additive)); for Addressables.UnloadSceneAsync(SceneInstance) later when scene changes

inner verge
#

Hey, I'm having alot of issues with addressable. Everything works fine in editor/player but when I build none of addressables is moved into build.

Forums told me to try going into addressable groups window and hit build there first, that succeeded the first time now throws an error every time even though nothing has been changed in the project or addressables.

Was told to try using the analyser in addressables but It runs for infinity stuck at importing assets.

The only thing in my addressable groups is terrain data as that's where most of my memory usage is in my game. Plan to add more to addressables later, but can't get this to work

inner verge
#

Screenshot of errors when i click new build inside addressable groups

elder mulch
#

I'm using LoadContentCatalogAsync and the RuntimeKey and GUID seem to become the addressable key. Is there any way to stop this?

inner verge
prime edge
#

Hi. I want to load assets from remote path (../[Environment]/Android if the environment of the app is set to beta) Can someone help me how to do that?

inner verge
solemn apex
#

My remote Addressables was easily done for UnityCloud but im having trouble for Amazon AWS. I only changed the LoadPath to AWS URL but somehow it can't access the files or something

slate timber
#

There is no fix for it, and its been like that for almost a year

slate timber
solemn apex
slate timber
#

if you use S3 alone the cost will be great

slate timber
#

or just downgraded?

solemn apex
#

yes. wait what exactly are people having problem about scenes?

slate timber
solemn apex
#

ohyeah that was exactly my task back at work

#

yeah it loads

slate timber
solemn apex
#

ohhhhhh no wait

slate timber
#

I have to download the scene then exit the game

#

then restart the game

#

For the scene to load

solemn apex
#

ohhhh I get you

slate timber
#

Its only if you're using addressables >= 1.2.0

solemn apex
#

So if I update the cloud, will need to restart the app first before it gets the updated catalog?

slate timber
solemn apex
#

what the heck

slate timber
#

yea ik

#

Ive been trying to get this issue looked at for 1 month now

#

Its been reported a year ago

solemn apex
#

hold on what does it look like when you test it?

#

let me also check what version im using cause I manage to load mine without any issues. Load a scene and set it to active

slate timber
#

It will just be stuck

#

If i restart after downloading its fine

#

Gives this issue:

  at UnityEngine.ResourceManagement.ResourceProviders.SceneProvider+SceneOp.InternalLoadScene (UnityEngine.ResourceManagement.ResourceLocations.IResourceLocation location, System.Boolean loadingFromBundle, UnityEngine.SceneManagement.LoadSceneParameters loadSceneParameters, System.Boolean activateOnLoad, System.Int32 priority) [0x00017] in <8ca064ccd930487f9d9e4a1371e793da>:0 
  at UnityEngine.ResourceManagement.ResourceProviders.SceneProvider+SceneOp.Execute () [0x00077] in <8ca064ccd930487f9d9e4a1371e793da>:0 
  at UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1[TObject].InvokeExecute () [0x00000] in <8ca064ccd930487f9d9e4a1371e793da>:0 
  at UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1[TObject].Start (UnityEngine.ResourceManagement.ResourceManager rm, UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle dependency, DelegateList`1[T] updateCallbacks) [0x0008b] in <8ca064ccd930487f9d9e4a1371e793da>:0 
  at UnityEngine.ResourceManagement.ResourceManager.StartOperation[TObject] (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1[TObject] operation, UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle dependency) [0x00000] in <8ca064ccd930487f9d9e4a1371e793da>:0 
  at UnityEngine.ResourceManagement.ResourceProviders.SceneProvider.ProvideScene (UnityEngine.ResourceManagement.ResourceManager resourceManager, UnityEngine.ResourceManagement.ResourceLocations.IResourceLocation location, UnityEngine.SceneManagement.LoadSceneParameters loadSceneParameters, System.Boolean activateOnLoad, System.Int32 priority) [0x0004b] in <8ca064ccd930487f9d9e4a1371e793da>:0 
  at UnityEngine.ResourceManagement.ResourceManager.ProvideScene (UnityEngine.ResourceManagement.ResourceProviders.ISceneProvider sceneProvider, UnityEngine.ResourceManagement.ResourceLocations.IResourceLocation location, UnityEngine.SceneManagement.LoadSceneParameters loadSceneParameters, System.Boolean activateOnLoad, System.Int32 priority) [0x0000e] in <8ca064ccd930487f9d9e4a1371e793da>:0 
  at UnityEngine.AddressableAssets.AddressablesImpl.LoadSceneAsync (UnityEngine.ResourceManagement.ResourceLocations.IResourceLocation location, UnityEngine.SceneManagement.LoadSceneParameters loadSceneParameters, System.Boolean activateOnLoad, System.Int32 priority, System.Boolean trackHandle) [0x00020] in <de4f843f379446e18f14228fd803abe8>:0 
  at UnityEngine.AddressableAssets.AddressablesImpl.LoadSceneAsync (System.Object key, UnityEngine.SceneManagement.LoadSceneParameters loadSceneParameters, System.Boolean activateOnLoad, System.Int32 priority, System.Boolean trackHandle) [0x0005d] in <de4f843f379446e18f14228fd803abe8>:0 
  at UnityEngine.AddressableAssets.Addressables.LoadSceneAsync (System.Object key, UnityEngine.SceneManagement.LoadSceneMode loadMode, System.Boolean activateOnLoad, System.Int32 priority) [0x0000c] in <de4f843f379446e18f14228fd803abe8>:0 
  at UnityEngine.AddressableAssets.AssetReference.LoadSceneAsync (UnityEngine.SceneManagement.LoadSceneMode loadMode, System.Boolean activateOnLoad, System.Int32 priority) [0x00027] in <de4f843f379446e18f14228fd803abe8>:0 
  at LoadingScreen+<Preload>d__9.MoveNext () [0x000c9] in <ddf5da6850b3418da299f9379d5432e3>:0 
  at UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) [0x00026] in <e422ced3d0f64bb29423e8338d57bc04>:0 
slate timber
#

And see if it switches scenes properly

#

Are you making scenes addressables?

solemn apex
#

that is... weird. now that I think of it I don't change scenes in mine. When I load a scene I just additively add the scene and set it as activescene.

slate timber
#

you basically want to delete this then run the game to test it

#

C:\Users\YOURUSERNAME\AppData\LocalLow\Unity\YOURPROJECTNAME

#

Thats your downloaded addressable files

solemn apex
#

uhuh this all looks good. Yeah I pretty much just use the latest version of Addressables. Altho I dont manually download dependencies... aren't dependencies automatically handled by AdressablesPackage?

slate timber
#

You dont need to call Addressables.DownloadDependenciesAsync but then the download will happen once you need the object

#

Which isn't that nice cause users have to wait

#

I use:
Addressables.DownloadDependenciesAsync(_label)

Where my label is something like "downloadOnStart"

#

And then i label my addressables which should be downloaded right when the user runs the game

slate timber
solemn apex
#

ohhhhhhhhhh damn now that is something

#

I just learned addressables this week tbh. Doing them remote

#

I was thinking about how dependencies go once you reference remote asset bundles will they be included in the build

slate timber
# solemn apex I just learned addressables this week tbh. Doing them remote

So imagine this script:

public class AScript : MonoBehaviour {
   [SerializeField]
   private GameObject _gameObject;
}

Now regardless of this script being in an addressable or non addressable scene. If my _gameObject is a prefab which is an addressable. It will not ACT like an addressable because i use GameObject instead of AssetReference

solemn apex
#

I guess I didn't encounter that problem because in our use-case we basically just call the scene by addressables ONLY. Like calling a roblox map or smt

solemn apex
slate timber
#

yes

#

Addressable Instaniation has 2 steps

#

Downloading -> Instaniating

#

I do the download at the start of the application so the downloading phase is already done and its not loaded in memory until i need it, so instaniating is pretty quick and user isn't waiting around for downloading when in the actual game

solemn apex
#

yeah that makes sense

#

its sort of like preloading then kind of caching

slate timber
#

yea

#

i use reference counting for addressables to free up memory

solemn apex
#

I don't get it. Doesn't make sense why doing this to Scenes will cause it to not work

solemn apex
#

So it's either we change to a lower version of Addressables or only use addressables in more simpler straight forward way

slate timber
#

ive been upset man

#

for ages

#

At this

slate timber
#

OR

#

dont include scenes in addressables

#

its not too much of an issue if your scene is small

solemn apex
#

What if you not reference addressable scenes but just call them by Tag so when building the scene it doesn't get included?

slate timber
#

This is my scenes rn on my build, I only have the asset downloader in my build which downloads my KitsuMapOne and UIs

solemn apex
#

wait so

#

Loading addressable scenes in general doesn't work?

#

I wanna test this

slate timber
slate timber
#

I submitted it just now to the report bug, nobody on forums or discord looks like they can help

#

@solemn apex Oh yea i forgot to mention

#

the bug isn't in the editor

#

So if you run it with the editor itll be fine 🤣

#

If you build the game, then run the exe it wont

solemn apex
#

Alright ill get back to you guys after a while its a little late. Also Find this really weird. Been using a macbook pro at work and used Unity Cloud and AWS to load our scenes. I don't even preload the scenes I load them when you pick the map. Like if you pick Level2 it will then just call Level2Tag -> LoadSceneAsync -> SetScene as active

#

no problems. Scene then has things like spline, scripts and baked occlusion working

rain quartz
#

Where is Analyze Tool in Unity 6? Also didn't find in docs

Addressables version 2.2.2

eternal river
#

Hi, is it possible to make a player able to choose to have English subtitles and Spanish audio using Unity's Localization package?

fair cape
#

I have this error most of the time when update a previous build. Do you know how to fix it?

small sorrel
#

Hello all, can i use aws s3 bucket to handle unity addressable? and preferably the s3 bucket is private / have some protection so it not publicly accessible. is that possible? and how can achieve that?

sudden drift
candid pelican
small sorrel
onyx wolf
#

@candid pelican @small sorrel @sudden drift i am trying to test the load and unload prefabs on demand. right now i have one simple prefab with its mesh and shader. all of them are addressables checked. The prefab and its related resources are correctly loading and unloading from memory, but even after unloading something tagged Untracked taking a huge memory space. my main goal is to reduce memory usage after unloading. any solution, please?

small sorrel
teal mortar
candid pelican
candid pelican
onyx wolf
#

but something called untracked is taking space

onyx wolf
candid pelican
#

pls share ur loading script

onyx wolf
# candid pelican pls share ur loading script
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.ResourceManagement.AsyncOperations;

public class PerformanceOnSizeTest : MonoBehaviour
{
    AsyncOperationHandle<GameObject> handle;
    public string prefabToInstantiateAddressableKey;
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Q))
        {
            handle = Addressables.InstantiateAsync(prefabToInstantiateAddressableKey);
        }

        if (Input.GetKeyDown(KeyCode.A))
        {
            Addressables.ReleaseInstance(handle);
            Resources.UnloadUnusedAssets();
        }
    }
}
#

pretty simple one

sudden drift
#

ohhh. might be the memory from memory profiler...

#

the thing with untrack is, you don't really know where it come from. but I know some time openning memory snapshot also increase it

onyx wolf
sudden drift
onyx wolf
sudden drift
#

I mean, it's hard in that you have to know what u put in prefab and know where the memory cost will go, audio will be shown in audio section, texture in video memory, mesh in other place etc etc. I would do it with prefab first. managing multiple scene seems harder in your use case, for prefab you can just directly reference them. & put them into list nicely. and loading addressable scene have some implication which might be hard to reason about.

balmy carbon
#

Do Addressables not work in unity 6? I imported the package but cant use UnityEngine.AddressableAssets like if I never imported it

teal mortar
balmy carbon
#

I dont know what its missing, in the editor it works fine, it only becomes problematic when I try to access it in code

#

I just installed it so I dont think its missing a definition unless the package manager did an oopsie, but it should do all that on its own, no?

balmy carbon
#

All it took to work was to restart unity, how I love this engine sometimes

sharp shoal
#

I am trying the "Fix" step for Check Bundle Dupe Dependencies analyze rule for around 19k duplicated assets in bundles. This always gets stuck at the importing assets step. I have let it run overnight for ~9 hours but still the process won't finish. I had to force quit and open unity. I do see that all the duplicate assets are now moved to a separate group.

To counter this behavior I wrote a custom rule similar to Check Bundle Dupe Dependencies but this time instead of processing all the bundles, I forced it to fix just one bundle with one duplicated asset. I still see the same behavior where unity is stuck on importing assets step which is very annoying... Has anyone else seen this behavior with Analyze Rules. Using unity 2021.3.42f1 and addressables version 1.21.20

sharp shoal
#

I built addressables locally and noticed a strange update to the AddressableAssetSettings.asset file. The m_currentHash value is updated to 00000000000000000000000000000000 Has anyone seen this before?

nimble plume
#

But I'll leave all that stuff here,

serene sphinx
#

PROBLEM RESOLVED!!!

Hello, guys! I was wondering if I could get some help with a script. One of my team's coders (now on hiatus) recently converted some functions in our game's AssetFinder script to return an async Task<GameObject>. However, all the other functions that he hasn't touched are expected to recieve a standard GameObject. I'm not sure how to convert it to a normal GameObject, and I would appreciate some assistance, as I've never worked with Addressables or ASync.

NEW FUNCTION EXAMPLE:

    {
        string[] guids = AssetDatabase.FindAssets("t:Prefab");

        foreach (var guid in guids)
        {
            var path = AssetDatabase.GUIDToAssetPath(guid);
            var operation = Addressables.InstantiateAsync(path);
            GameObject go = await operation.Task;

            if (go != null && go.name.Equals(prefabName))
            {
                Collectable goCollectable = go.GetComponent<Collectable>();
                goCollectable.type = goCollectable.itemSO.type;
                goCollectable.icon = goCollectable.itemSO.icon;
                return go;
            }

            // Clean up if the prefab doesn't match
            Addressables.ReleaseInstance(go);
        }
        return null;
    }```
#

I need to take the result and turn it to a simple GameObject

hexed shell
#

AssetDatabase only exists in the editor, this code would not be able to be built with the game

serene sphinx
sturdy valley
#

Hi guys. I have only half a question about addressable. I've been looking for an answer to the question about changing scenes for a couple of days. I've seen the practice of using an empty scene between unloading one scene and loading another. But no one can explain why this is necessary. And at the same time, everyone claims that when using addressables scenes, this is not necessary.
And the next problem is that I want to build the architecture of the game on one base scene where to store all the common things and the additive scenes that will be loaded into the base and unloaded. As I understand it, in this case, an empty scene will not work for me at all.
Please explain this problem with loading scenes and how best to do it for my architecture variant.

onyx wolf
#

can anyone please explain me the Bundle Mode in addressables? i can't understand it properly even after reading the documents

floral current
#

Hi! I was testing "Addressables.GetDownloadSizeAsync(key)" and there was something i'm confuse about in my testing. This method actually get whole size of my addressable asset instead of an individual. I'm showing a debug log on each of the key to get its download size but it keep stating the same value. To my surprise when I initiate download, It also download the same amount of size.

My question is, does that method return the full size of my addressable instead of individual (by key)?

floral current
orchid mountain
#

I’m trying to wrap my head around something that should be incredibly straight forward: have multiple Addressables.LoadAssetAsync() calls simultaneously on different game objects that each need to load their own respective textures. There’s no overlap between these calls, yet I’m always hit with Exception of type ‘UnityEngine.AddressableAssets.InvalidKeyException’ was thrown. No MergeMode is set to merge the multiple keys requested” I tried awaiting Addressables.InitializeAsync() first to ensure that this isn’t the issue, to no avail. Any pointers?

teal mortar
orchid mountain
teal mortar
#

🤔

#

hmm are these remote or local assets, and are they from different bundles or the same bundle?

orchid mountain
#

Local, different groups (and therefor bundles I imagine)

teal mortar
#

can you share any code?

#

that InvalidKeyException can sometimes be misleading, it gets thrown for various reasons, but i guess you should only need to set a merge mode while loading multiple keys in one call or if one key resolves to multiple locations for some reason

orchid mountain
honest halo
honest halo
novel aurora
#

Good day everyone. I am quite new to the addressable term in cases of remote collections. I rather have a general question. are addressables also capable of delivering content like assetbundles with the whole LoadAsset() pipeline across different apps or are they bound to a specific app and/or version of it?

finite basalt
#

for the love of gawd, i don't why keep getting this at the addressables module while profling, is it adding the same build layout over and over or something?

rigid kernel
#

Check which key is duplicate and removed that

#

I think nothing complex

tiny swan
#

Did anything change with addressables in unity 6? Having an issue that didn't happen in an older 2023 version of unity where every single addressible fails to load in builds (but load fine in editor)

#

First one that errors is:```
Unable to open archive file: 5a3bf240d84f9364a8a6616e6c5e36cb/defaultlocalgroup_assets_all_4db2a28a305d8173b91be6d70ef75575.bundle
Unable to open archive file: 5a3bf240d84f9364a8a6616e6c5e36cb/38a1f2d2d5f81899292f497a8e6b92e9_monoscripts_1655fdb55b1eea88e8a8784efa650302.bundle
Unable to open archive file: 5a3bf240d84f9364a8a6616e6c5e36cb/38a1f2d2d5f81899292f497a8e6b92e9_unitybuiltinassets_55411ff6b77a1f1a73611d08d30dec57.bundle
RemoteProviderException : Invalid path in AssetBundleProvider: '5a3bf240d84f9364a8a6616e6c5e36cb\defaultlocalgroup_assets_all_4db2a28a305d8173b91be6d70ef75575.bundle'.

tiny swan
#

Set the editor to use the archive too, cleaned and rebuild (had to restart unity because the addressables failed with no meaningful error first though?), and getting this error:
Unable to open archive file: 5a3bf240d84f9364a8a6616e6c5e36cb/defaultlocalgroup_assets_all_3d2c948d167cbc5da585467b1e7606c2.bundle

But looking at the addressable report I can clearly see that it exists:

tiny swan
#

Oh, wow, the code for addressables are a mess

#

Why does it call GetResourceProvider a dozen times on the same locator

unreal delta
#

I am trying the addressable tutorial.
What I want to do, is to not have the "Gamma" group in the default profile. So the load asynch of the sprite underneath it will fail.
How can I have that group not be part of one profie but part of a different profile?

unreal delta
#

Ok, I think I learned how to properly use addressable, and I can now choose to not include an addressable based on profile.
I had to write a little custom addressable build script, but other than that, it's pretty simple

queen ridge
#

Hi, I'm struggling a little bit to get addressables working for the Meta Quest. They have some documentation on how to add Required Asset Files (https://developers.meta.com/horizon/documentation/unity/ps-assets/#required-asset-files). The way I read it here, the asset files will be uploaded to the /sdcard/Android/obb/[package-name] folder. Does that mean, on my addressable groups, I should set that as the load path? I've tried it, and its struggling to find anything.

Additionally, if I wanted to test it locally, would I be able to adb push my files to that directory?
Thanks for the help!

#

This is in 1.22 btw

buoyant scroll
#

My mesh and material are missing on android, working in editor...
Build > tried Play Asset Delivery and Default Build Script with no success

Also sending settings:

fickle rune
#

can we convert a game object to assetreferencegameobject through code.

teal mortar
fickle rune
low halo
fickle rune
teal mortar
fickle rune
#

I made it simonp.

frigid stag
#

What you are doing wont work in a build given that you are using AssetDatabase which is Editor code.

#

Oh, I think I misunderstood, you want to convert a gameobject to an asset reference. Are you really sure you want to make that ?

frigid stag
fickle rune
low fractal
#

Heyho 👋🏻 I am currently planning how to build my game world, it consists of many small islands that I would like to make all on a separate terrain and place each of these terrains in a separate scene. if you now travel between the islands with a boat I would like to load the scene with an island as addressable additive in or out depending on. How does it behave in unity 6 with lightmaps, can I dynamically load a scene with its baked lightmaps, AO and Adaptive Probe Volumes (APV) in and out in a main scene or can the light information not be loaded dynamically from an addressable?

next inlet
#

Did they get rid of the Editor Hosting service in Unity 6/Addressables package 2.2.2? I can't find it in Window/Asset Management/Addressables/Hosting

#

I'm guessing it's just a bug but want to be sure

next inlet
#

I also checked Tools > Window and it's not there either

#

seems like a strange move to remove this functionality, as it was super useful

frigid stag
next inlet
# low fractal Heyho 👋🏻 I am currently planning how to build my game world, it consists of ma...

I have experience with this prior to Unity 6. What @frigid stag said used to be correct, however in some version of Unity (I can't remember which) they changed this to make streaming scenes with lightmap data possible. The easiest way to do this is to just open all of your scenes in the editor and perform the bake, with your main scene (which will be loaded at all times in your game) set as the Active Scene.

If you game world is massive and loading all scenes into the editor at once is not possible, another workflow is possible, however it's very tricky. I can describe the way to go about it but would rather not unless you absolutely cannot use the other method.

The above should work for lgihtmaps (which should include AO), Reflection Probes, and possibly regular Light Probes (not positive on this). I have not worked with APV's so can't comment on that. I know before it was not possible to use them with streaming scenes, however I'm not sure if they have changed things in Unity 6 to allow it.

frigid stag
next inlet
# frigid stag Doing so would result in a 1 single bake data does not it ? Meaning that if you ...

Yes, sorry, what you said was technically correct. Only one lighting setup can be used unless you manually change the Active Scene (or there may be a way to change it via code without switching the Active Scene? I cannot remember now). However the user did not mention this, only whether it was possible to load lightmap data from different scenes additively, which is indeed possible and relatively easy to do assuming all of the scenes use the same lighting settings.

low fractal
# next inlet I have experience with this prior to Unity 6. What <@208422197348401152> said us...

Hey, thank you both for your answers. ( @frigid stag @next inlet )
That sounds promising in theory. I currently use Microverse to be able to edit several terrains at the same time, fortunately this also works across scenes, e.g. if you have a main scene and then you have one scene per terrain that is added additively in the editor. I'm going to try this out by performing a bake of the main scene while the additive scenes per terrain are loaded in the editor in the main scene. In general the light settings should not change per terrain, it is an island world similar to zelda windwaker, a simple grid of 6x6 terrains and on each terrain an island is displayed. They are all in the same ocean and have the same sun and therefore the same light properties I think.

next inlet
ivory crane
#

hey im using unity 6 and im also trying to use CCD/Addressables for the first time. I installed both of those packages in my project as well and configured CCD to have my prodBucket selected as the remote thing. in the production environment i made a bucked named "prodBucket" and i uploaded and promoted a file named "race_unknown.png".
heres my code:
https://pastebin.com/AA2ApUcu
Unity throws 2 errors saying it cant find the location for "race_unknown.png"

iron tundra
#

Anyone looked at a way to use addressables with strongly-typed keys (without using AssetReferences) ?

teal mortar
frozen quiver
#

For synchronously loading, say, 100 keys, is one call of LoadAssetsAsync() with MergeMode.Union faster than 100 calls to LoadAssetAsync()?

After writing a performance testing comparing the two, and the one call of LoadAssetsAsync() is actually slower!
Batched: median 19.36ms
Non-batched: median 12.46ms

I would have thought that it would be faster since all of the I/O calls would be executed a lot earlier

Does anyone have any thoughts?

frigid stag
frozen quiver
# frigid stag Not sure how much you can trust those tests of yours. I/O is can be pretty volat...

I'm running unit tests through several runs with Unity's performance measuring package, are there more reliable ways of testing I/O calls?
I'm using Merge.Union to get the resulting asset of every key, which I assume means that there would be an I/O call for each asset. Are there alternatives to that?

The theory is that the I/O calls is the bottleneck when called sequentially rather than in all at once. My results would show that this isn't the case for LoadAssetsAsync(), right?

Update: yeah, just looking at the profiler, it seems to be serial, (async call, wait for completeion, async call, wait for completion, etc.)

#

Got a median frametime of 11.34ms for just calling LoadAssetAsync() for every key and completing them afterwards. Guess I'll just do that

frigid stag
# frozen quiver I'm running unit tests through several runs with Unity's performance measuring p...

I personally, do a multiple loadasset and then create a Addressables.ResourceManager.CreateGenericGroupOperation.

List<AsyncOperationHandle> loadOps = new List<AsyncOperationHandle>();
foreach (IResourceLocation location in handleLocation.Result)
{
    AsyncOperationHandle<UnityEngine.Object> handle = Addressables.LoadAssetAsync<UnityEngine.Object>(location);
    assets.Add(location, handle);
    loadOps.Add(handle);
}

AsyncOperationHandle<IList<AsyncOperationHandle>> asyncOperationHandle = Addressables.ResourceManager.CreateGenericGroupOperation(loadOps, true);
while (!asyncOperationHandle.IsDone)
{
    Progress = asyncOperationHandle.PercentComplete;
    yield return null;
}
#

From what I have seen, it was the fastest.

#

However, I had some issue with a particular asset on Switch (loading one by one was solving the issue). So I believe it might not be 100% stable to do this.

frozen quiver
slate timber
#

my addressables return null

var handle = Addressables.LoadAssetsAsync<GameObject>("Assets/Prefabs/Trees");

whats wrong?

#

invalid key exception

novel aurora
#

And I am not sure, if you can use / inside that name. At least I would try to simplify it and test

slate timber
#

i want to load a FOLDER

#

it works with a LABEL

#

but i want an ADDRESS

#

is that not possible?

novel aurora
#

You are not understanding how addressables work. They are not based on your folder hierarchy but categorized by labels and groups. If you want to load them, you need to have the reference inside the package that gets build, not the folder structure your original prefab is lying

slate timber
novel aurora
slate timber
#

this works but i dont see why i have to cast

var handle = Addressables.LoadResourceLocationsAsync("Assets/Prefabs/Trees");
yield return handle;
GameObject[] treesPrefabs = handle.Result.Select(r => (GameObject)r.Data).ToArray();

When i load a folder via a label i dont have to cast & its faster & less code
Can i not do this with an asset path?

Addressables.LoadAssetsAsync<GameObject>("Assets/Prefabs/Trees");
novel aurora
unreal delta
#

I am confused about addressable... do I need to rebuild the addressable in order to have any change apply to prefabs? It makes sense, but that's a big disadvantage then just editing a prefab, and pressing play to immediately see the changes.

teal mortar
eternal river
#

How i can get an LocalizedAsset in a Specific Locale?
Right now im using AsyncOperationHandle<Texture> op = localizedTexture.LoadAssetAsync(); but that returns me back the asset in the default language

timber smelt
#

hi im new on unity i have installed the engine right now and i don't know how to fix this problem , i did what the error says but i already have all the system requirements so i dont understand where is the problem can someone help pls ?

tiny swan
spark robin
#

Hi, i'm testing something out with addressables to figure out some stuff...

Addressables.LoadAsset<TextAsset>().Completed += (var res) => this.Result = res.result; // Loads an 100 mb Test TextAsset
Addressables.Release(this.Result) // Should unload TextAsset and free 100mb of memory space

I'm testing this code inside my Update loop using some if key down logic. It loads the asset successfully, also release works without error but 100mb memory space remains allocated, it never de-allocates it automatically unless i do Resources.UnloadUnusedAssets() which is defined as performance heavy operation in the documentation.

Should i call Resources.UnloadUnusedAssets() when i release anything ? Or is there any better way to do this ?

If I should not release an loaded asset please give me an better approach, i'm just seeking for the best practice

peak kraken
#

the asset bundle is only unloaded when all assets in the addressable's asset bundle are released

tiny swan
#

Where did analyze go?

#

i guess I have to download 2.3 somehow?

#

it's back now, but the localization rules are not there :|

tiny swan
#

oh that's just great :) :) :)

naive harness
#

so never been able to reproduce, but got crashlytics logs where code doing something like this will null ref on the get component

var go = await _itemPrefab.InstantiateAsync().Task;
var cmp = go.GetComponent<SomeComponent>();

even know the addressable is there

#

so anyone know a case where i would get a null back from that instead of just a exception if it was not there

teal mortar
#

if you usually want exceptions to be thrown instead, it's fairly easy to write an extension method for the handle to wait and then throw if there was an exception

naive harness
#

like its for a asset i know always exists

#

also so does that mean the addressable operation handles never raise a exception when awaiting the task?

teal mortar
teal mortar
#

it's not great but that's how it works lol

naive harness
#

Yeah thanks for the info, made a experiment to test

#

Wish it was clearer in the docs since it really goes against assumptions anyone with C# experience would make

hallow sail
balmy robin
#

Hello, I want to know if I load many of same kind of assets, how addressable assets system handle its loading,

Let's say that I am going to load PrefabA

5 times immediately asynchronously, then it will load 5 instances or just 1

Thank you 🙂

teal mortar
balmy robin
#

Nice

#

Thank you 🙂

balmy robin
#

Hello, not sure that we should release instance like this, I am going to attach this component to the game object and let it release instance when it is being destroyed

using UnityEngine;
using UnityEngine.AddressableAssets;

    public class AssetReferenceReleaser : MonoBehaviour
    {
        private void OnDestroy()
        {
            Addressables.ReleaseInstance(gameObject);
        }
    }

#

Or just don't having this component?, will addressable asset release instance immediately without it?

kind depot
prime edge
#

Hi, My game is having a pink shader problem when a scene is loaded after downloading from Unity Cloud Content Delivery. Can someone help me to figure it out?

soft ledge
#

Does anyone know how to disable revalidation on webgl? what are the conditions that trigger the game to revalidate the bundle?

slate timber
#

my addressables are not in build

#

I clicked Build>New BUild

#

As in i built the addressables

full widget
#

Is there a way to dynamically set addressable LoadPath variables at runtime? (in my case RemoteServerURL)

teal mortar
next inlet
# slate timber my addressables are not in build

Are you using the Local build/load path? If so follow the Local Build path to find the assets (it should be in a sub folder within the output build folder if I remember correctly). If you are using Remote build/load path, it usually outputs the assets to RootProjectFolder/ServerData. Then you need to upload the folder in ServerData to your server or wherever you are loading from.

slate timber
#

fixed it

next inlet
#

I wanted to post something I discovered recently about Addressables, which particularly effects Shaders and Shader Variant Collections. I could only find vague hints around the internet about my problem, and although the end result of my findings may fall under the "common practice" umbrella, I think this will provide some additional information and hopefully help others understand Addressables/Asset Bundles a bit better.

Effectively, what you should know is that when you build your Addressables, Unity will automatically pull in references to assets that the assets in your Addressable Groups depend on. This is common knowledge. You can avoid this, of course, by adding the dependencies to Addressable Groups; then, instead of pulling in these assets, the original assets will just reference the asset bundles that the dependencies are in. Again, common knowledge.

Something that is less clear (but may be obvious to some), is that when pulling in dependencies, Unity will not be smart about it by pulling in the dependencies once, then having other assets that use the dependencies reference whatever bundle the dependencies were first pulled into. Instead, all assets that rely on the dependencies will pull in the dependencies to their own asset bundle, resulting in multiple copies! Most likely it is necessary to do things this way in order to not slog down the build process, so we just need to live with it.

Regarding Shaders and Shader Variant Collections, when you add a Shader Variant Collection to an Addressable Group, but do not have the actual shaders referenced by that Collection in an Addressable Group, Unity will pull in the shaders automatically to the bundle that the Collection is in. That's great, right? WRONG!? Other assets that make use of the variants do not know about these pulled in shaders! So, Unity ends up pulling in the shaders to those assets' bundles as well.

#

_ _
All of these different copies of the shader turn into the multiple copies of the exact same variants, at least in RAM (and probably on the GPU as well), which can cause you to run out of memory FAST.

In conclusion, it's not enough to just add the Shader Variant Collections to an Addressable Group. You must always ensure that your shaders are also added! This advice is scattered around the internet, but it was still hard to find a clear cut answer. on how shaders and Shader Variant Collections should work with Addressables. So hopefully someone comes across this and will be left with no doubts.

noble cedar
#

is there anyone from Unity team is here?

noble cedar
frigid stag
frigid stag
noble cedar
frigid stag
frigid stag
#

I usually only reference the ScriptableObject from the built in scene

rancid marten
#

Nice day, I'm not sure if this is the right place to ask. If not, please let me know.
Curently, I'm working with loading asset from other project via addressable strategy and facing some weird behavior. My setup:
Project A: Game portal, sure is contained all the codebase of other project
Project B: Minigame (most of this is asset and the game scene)

My 1st try flow:

  • From project A, Download catalog of project B.
  • Locate the scene of project B by using this var locations = locator.Locate(sceneName, typeof (SceneInstance), out var list); and use DownloadDependenciesAsyncto download the scene. At this point, I get error:
    UnityEngine.AddressableAssets.InvalidKeyException: Exception of type 'UnityEngine.AddressableAssets.InvalidKeyException' was thrown., Key=Assets/gameScenes/02_GameScene.unity, Type=System.Object

2nd try flow:

  • Instead of downloading, i'm using LoadSceneAsync() to load the scene by it location, at this time, the scene is loaded success. BUT, some sprite are missing. I try many way to figure it out but have no clue.

Please help me:

  1. Guide me how to download a scene and all it dependencies in the RIGHT way
  2. Does any one facing the same missing sprite / asset reference problem, and if you know how to resolve or how to investigate please guide me.

Thanks in advance.

solemn apex
#

Are addressables finicky around API's? have been wrestling around addressables failing to build because of a line that uses an API I got online. The scripts involved aren't even a dependency or an addressable. Man im comfused.

#

I even tried emptying out the adressables and just put an empty GameObject there, still the API script is being called out when building the Addressables fail

teal mortar
molten dirge
#

I want to make a prefab for a card of a cardgame which assigns the card art of a specific card once loaded into a scene. It's supposed get a card Id of a card in a deck from a Database and then assign an image from the project's assets with that name to the gameobject in the scene. I was told I could reference Assets using Addressables but what I found online about it didnt make it clear how to use addressables for what I want to achieve/ if it is even possible. Any advice on how to make this come true with addressables or not welcome, ty.

teal mortar
molten dirge
teal mortar
molten dirge
#

I see

teal mortar
#

addressables doesn't really affect the performance that much as far as i know, it's still got to load the assets one way or another, but it is async by default which makes a difference

molten dirge
#

well right now I'm using it to assign sprites from my assets to a new created card prefab

#

i'm making a card game and using it only in deckcreator right now

#

do you believe it will have a significant impact? @teal mortar

teal mortar
#

well most of the cost will be loading from disk so probably the first time you see each card, after that it should be cached

#

it depends how many cards there are really

molten dirge
#

different cards that is

#

it will probably be like half of the average loaded at the same time

#

given most of the cards come in multiples

shy panther
#

hey everyone, so i'm very very new to adressables, and i'm having a hard time understanding how it works, so i want to use unity cloud content delivery, because i have a game published to users in the store and i want to send them updates every now and then, i don't want to publish to app store and google play store everytime we do a small ui change or i like to add seasnal themes, so i heard cloud delivery is made for that, and i configured everything with adressables, now here is the thing i have a build on my app on my phone and when i push the changes to release nothing happens, does adressables work that way?? when releasing and every build gets the change ??? please help i need to understand more

next inlet
#

Let's say I have 10 prefabs marked as addressable. These prefabs are in the same group but packed seperately. So far I have been using Addressables.LoadAssetAsync to load each one individually. I queue up multiple calls, which creates some conflict between background/secondary threads and the main thread as they fight over file operations and the Persistent Manager.

Are these issues alleviated when using Addressables.LoadAssetsAsync? I.e., if I combine all the resource locations for all 10 prefab assets and just use that method to make one call, will it eliminate the thread conflicts? Or does this method just break down the 10 resource locations into 10 separate loading operations? I guess I'm just wondering if this method offers better performance vs the single asset loading method. I will run some tests but wanted to see if anyone had experience with this before wasting the time to make/run the test.

teal mortar
#

ymmv of course, profile it is the the only way to get the right answer!

#

i don't really know what you mean by the thread conflicts though, did you observe performance problems or something? most of the parts you interact with are happening on the main thread and multiple calls to LoadAssetAsync shouldn't cause problems

dusky saffron
# next inlet I wanted to post something I discovered recently about Addressables, which parti...

The shader dependencies work the same as any dependencies. In order to share an asset between multiple parent assets, you need to explicitely make that shader an addressable asset (included in a group). The shader variant collection is basically only needed to include shader variants that Unity does not have direct knowledge of (for example, if you use keywords, or have UI shaders with implicit keywords like UNITY_UI_CLIP_RECT).

There are cases where shaders (or other assets) do not get duplicated, but it's by concidence and should not be trusted. When all groups containing a dependency to the target group implicitely containing the shader, the shader does not get duplicated as it can be guaranteed to be found in the target group. However, if you change the target group so that the shader is no longer there, then all groups referencing that shader will either include a duplicate of the shader OR they omit it if another group they depend on, has it. It's complicated, and unpredictable.

TL;DR: Use shader variant collection to include shader variants you use dynamically and for shader warmup. Put shaders explicitely to a group to ensure they don't get duplicated.

EDIT: The implicit inclusion I talked above actually works in bundle level, not group level. So if your group is split into multiple bundles, only if your referencing asset references somethiing in the shader bundle, there's no duplication. But not only that, some of the Addressables settings might prevent referencing even the implicit assets if you don't include GUID's for the groups/bundles...

dusky saffron
next inlet
next inlet
dusky saffron
next inlet
dusky saffron
dusky saffron
next inlet
#

They must have removed this setting in the latest version, but I'm almost 100% confident only the individual dependencies from the bundle are loaded.

Also there is no chance that the dependencies are being unloaded and reloaded, as the tests loads all the Prefabs before unloading any of them, and the dependencies are stored in a separate bundle (and thus not duplicated).

next inlet
# dusky saffron No, if you need to load 10 prefabs at the same time, it will be more perfomant t...

I don't doubt that it is more performant, however I am especially interested in just how much more performant it is, because switching to the single operation method will require a lot of work to overhaul my current system.

So far I'm not seeing a major difference to warrant that extra work, and it seems like the single operation just mimics the multiple operation method under the hood, at least for the most part.

next inlet
#

I guess the concept is now you are only triggering one load, and the Prefabs are loaded as dependencies of the scriptable asset?

#

I wonder though, are you still limited to a max number of Prefabs with this technique? Because once a certain limit is reached, won't the cost of integrating all of those Prefabs into main memory be too high?

dusky saffron
# next inlet They must have removed this setting in the latest version, but I'm almost 100% c...

We're still in 1.22 and Asset Load Mode is there. Also it seems that 2.3 has it too (https://docs.unity3d.com/Packages/com.unity.addressables@2.3/manual/ContentPackingAndLoadingSchema.html)

The issue I described is one where your asset references single/few items in bigger "load all bundle" (usually by accident), and if that reference is not kept, then that "load all bundle" is immediately unloaded, just to be loaded again by the next operation.

But again, this is a fringe case and essentially asset configuration problem. Example is that you have an main menu UI bundle which contains some sprites and you make it "load all" to load the whole UI in one go. You then accidentally reference that sprite in your vfx asset, creating an unexpected dependency to the UI bundle. If that main menu UI bundle was no longer loaded (in combat etc), then loading those vfx asset will cause the whole bundle to be loaded into memory, and then unloaded if the reference to is dropped.

next inlet
dusky saffron
# next inlet I don't doubt that it is more performant, however I am especially interested in ...

indeed. It's basically a "asset pipeline paradigm shift" that makes you restructure your code, and can be hassle to do after-the-fact. But just wanted to say that it's a real problem.

For example, in one of our games, we had 100 UI views/panels that were loaded previously by spawning a single UI prefab nested with those said views. Worked pretty good, but was a monolith and took some time to load. We then changed it to loading 100 separate prefabs, and even when contained in the same bundle, initially this lead to insane load time. The biggest reason was how the asset integration in the mobile player builds works, and we were able to make it faster by setting Application.backgroundLoadingPriority to high. But even with that, it was nowhere near the same as before. We then ended up splitting UI prefabs into bigger chunks that load multple views in one go

next inlet
# teal mortar i don't really know what you mean by the thread conflicts though, did you observ...

What I mean is if you have some operation on the main thread, and other operations on the background loading thread or background jobs thread, Unity will lock certain data from one thread.

The other thread tries to lock this same data but has to wait until the first thread unlocks it. You will see Loading.LockPersistentManager or Semaphore.WaitForSignal when this occurs.

It is not a big deal if it stalls out a background thread, but if it stalls out the main thread then you are basically just wasting time, as there's no way to have Unity work on something else while it waits (at least AFAIK).

next inlet
dusky saffron
# next inlet What I mean is if you have some operation on the main thread, and other operatio...

I think the issue here is exactly what I described in the other message. Application.backgroundLoadingPriority is by default Normal, which means that asset loading can only use 10ms of time per frame. If you do everything in one chunk that takes 1000ms, the stall is inevitable (can't do partial asset loads). But if you split loading into multiple operations of 10 (100ms each), then it will mean that there will be multiple integrations happening over longer period of time. Not sure how the scheduling actually works, but if your framerate is 30 FPS (33 ms spent on doing other stuff), then that same load operation would take (33ms + 100ms) * 10 = 1.3 sec. Split to even more fine grained loads, and it actually just makes it even worse.

dusky saffron
subtle jacinth
#

has anyone faced an issue simialr to this? i download these assets from an addressables bundle, and they have these flashes and flickering in the material

subtle jacinth
peak kraken
# dusky saffron We're still in 1.22 and Asset Load Mode is there. Also it seems that 2.3 has it ...

You appear quite knowledgeable about addressables, I am wondering if we could get a sanity check for our method.

We converted our project to use addressables, so now we have one huge group with thousands of addressables, packed separately. We also ran the duplicate asset isolation script so that generated a group of the duplicate dependencies... So 2 groups in total both packed separately
Do you foresee issues with this? Our load mode is Requested Asset and Dependencies

frigid stag
buoyant scroll
#

When i want to make addresables for Play Asset Delivery are these settings okay? Because well, not working at all in PAD > Build > Play Asset Delivery (in Editor yes using Use Asset Database as Play Mode Script).
Should I check Build Remote Catalog?

peak kraken
novel aurora
#

Did you build the addressables before building the application?

#

I still would try to clean build the addressables in the group view and clean build the application to be sure, its not a caching issue

#

Well, thats a whole nother story 😄 But yeh, if your pc is faulty, anything can happen. I wonder where you get the null errors from, that you mentioned

#

But what is giving you the null error? A script? a debug line?

#

So your addressables async result is null?

#

can you show the code you are using?

#

rather the script itself. But the other statement is not correct 😄 Its either null or not. There is no close to null 😄

#

!code

robust elbowBOT
novel aurora
#
AsyncOperationHandle<GameObject> loadAddressable = Addressables.InstantiateAsync(reference);

        await loadAddressable.Task;

        if (loadAddressable.Status == AsyncOperationStatus.Succeeded)
        {
            GameObject newObject = loadAddressable.Result;
        }

Be sure to use something like this to check for the status and await the task to complete. Maybe your editor is just faster in loading it

#

Please send it here, I do not accept DMs

#

I like how you ignore the whole !code mention for large code blocks 😄

robust elbowBOT
novel aurora
#

Its just hard to read large code in discord 😄 thats why its good to paste it on one of those sides. all good 🙂

#

But from what I see, you are returning gameObject even if its null, so you just continue with a null object.

#

you never really wait for the task to complete

#

Yeh, was just reading the docs and the mention this example. but yield will just pause for one frame and continue, doesn it?

#

I rather would go with the callback or await approach

#

Ah right, its not the gameobject (the naming is confusing :D) its the asyncoperation.

#

and that Debug.Log of the Result is null in your logs on runtime, right?

#

What part gives the null error then?

#

So this line should check, if its null, right?
if (gameObject.Result ?? false)

#

but you are checking, is it null, if yes, return false into the if statement and pass that part

honest halo
#

I recommend not using Task but use UniTask. Second to better test you should build addressable content for the platform your editor is, change the "playmode script" to use existing bundles and then play.

#

also ?? cannot be safely used with unity objects as it bypasses the comparison override that makes a destroyed object == null.

#

There was also a bug that made URP shaders not be included in addressable builds even if needed in some older 2022 versions

honest halo
#

Probably not the problem then, i experienced an issue where meshes using urp shaders were not rendererd or were purple as all shader combos were stripped even if needed

#

im confused why you have this thing to load assets in such a way

#

i dont know how many assets you want to load but seems needless to have this complexity on top of AssetReference. I have never needed to do this and i work mostly on mobile.

#

why dont you test in editor with built bundles and debug to see the loaded result from the async op?

#

didnt know if that was asset database or real bundles

#

Build your bundles in editor (change to the platform that matches your pc), make sure it builds without any errors then change "Play mode script" to "Use existing bundles" so the editor actually tries to use those asset bundles and see what happens. Asset database mode wont let you find such problems.
[For me here, remaining on android will result in broken materials as it will try to use android shaders on windows]

#

I have never had simulate groups work so i dont use it

#

this is unity 2022 so perhaps they removed it 😆

#

but having it load real bundles lets you find whats wrong better as it will use the built local bundles and download remote ones too.
you can also use the profiler to see what addressable stuff is loaded/has references still.

honest halo
#

Oh if you are releasing the asset it will unload it if it then has 0 references

#

The docs are clear how this will break stuff if it's actually being used still.

next inlet
# dusky saffron indeed. It's basically a "asset pipeline paradigm shift" that makes you restruct...

Sorry for the delay in responding; I've been busy the last few days 😅 .

I think if it were purely a matter of the time it takes to load the assets, putting everything in one giant prefab/asset bundle and using a backgroundLoadingPriority of High would make sense; the issue is that we are doing runtime loading/unloading while the player is playing the game. Thus, while it's crucial to make the load times as fast as possible so that the World is not just sluggishly loading in/out assets, it's also necessary that the loading/unloading does not cause frame stuttering.

So unfortunately, for our game which is on mobile, using anything higher than Below Normal is just not possible (maybe Normal can be achieved by optimizing other 3rd party scripts).

Right now there seems to be no other choice but to split the prefabs up into multiple smaller prefabs/Asset Bundles, although I am intrigued by your idea with the Scriptable Assets. However, I do wonder if such a design would not lead to larger Asset Bundle file read times, which is a big issue for keeping gameplay smooth while loading asset bundles in the background. Have you used this design to load assets in/out while the player is playing the game, or only while loading screens are displayed?

dusky saffron
next inlet
balmy robin
#

do you guy having an issues with addressable assets loading with the changed codes rebuilt build?

#

i wish the old data can be used, if the codes changes have changes serialized fields, it still should work, for missing fields it can be ignored, but the problem i faced is it cannot be loaded

plain terrace
#

If you've changed how a class gets serialized, Unity will have no clue how to interpret the old data

balmy robin
#

if i don't change how any classes getting serialized, just change game logic then it will still working?, as i try sometime it is not 😦

honest halo
short dagger
#

Hello! I intend on using addressables and wanted to make sure of something before I start with it.

It's my understanding that it's not necessary to mark dependencies of an addressable asset as addressable themselves as they'll be picked up by the loading process when I load the root asset (Assuming, those dependencies are only referenced by that one "root" asset)

For me, that'd mean that in the cases of scene, I can just mark the scene as addressable and not mark any of the prefabs, textures, etc... in it as addressable. I like that since it'd mean I can keep the addressables list neat and tidy with only root assets

honest halo
balmy robin
#

@honest halo i think the report still not convinience to use yet, don't it have any tools to do it automatically?

honest halo
balmy robin
#

@honest halo No I am not intend to said that it is not make sense, I just looking for any better solution

#

Which tool?

#

Is it in the report dialog ?

short dagger
#

Thanks for the answer!

balmy robin
#

I try to find the tool to auto add as addressable to fix the dupes but not found, I might have to try a newer version of addressables assets, (my project still on unity 2022)

honest halo
#

The report should still list assets that got duplicated in that build so you can fix it manually (make it addressable)

balmy robin
#

Oh, I see, this is good

blissful dirge
#

Is it possible to limit an addressable group to only accept prefabs of a particular class?

#

And is it possible to determine load order of the prefabs?

fast musk
#

My studio has banned addressables since the last few projects using them all had issues. Biggest one being non-deterministic outputs which meant we would get different hashes depending on what PC builds them (and sometimes even getting different hashes from the same PC). We're talking about having to re-download 100s of MB of assets for a mobile game in some cases.

Does anyone know if Unity 6 addressed this in any way?

blissful dirge
#

When I try to build addressables I get the error: The type or namespace name 'SceneAsset' could not be found .. I am using it as a type in public async void LoadScene(SceneAsset sceneAsset) ... why would it not be able to use this?

#

Is it because of namespace UnityEditor?

opaque valley
hoary rampart
fast musk
#

Yeah, we're doing the same, we even purchased 2 new PCs with the exact same specs and OS just for addressables. Some of our projects are for big clients and tend to have hundreds of thousands of users, so the possibility of a PC breaking and causing everyone to download assets again due to different hashes being generated for the same content is 100% a deal breaker. I guess we're going to keep the addressable ban until that's addressed, I haven't seen any official response on this either. What a shame

spare sonnet
#

!code

robust elbowBOT
long dawn
#

I'm trying to work on a game with my friend, we have an organization already and I am in it. When I open "add repository" i get this error (we are using version control through unity, not through Git) also is this the right place to ask?

honest halo
real venture
# honest halo I think even the project name affects it, we used a separate job for building + ...

We recently did a big investigation into the Unity Accelerator and ended up also investigating sources of indeterminism in project builds.

The addressable system is pretty robust and is fully deterministic as long as the inputs do not change. However, its determinism relies on the determinism of all the inputs and that's the problem that most people run into.

For almost all assets here is the list of things which are considered:

[unity version, host OS version, host machine cpu architecture, source asset version, source asset guid, target platform, compression/import settings] and maybe one or two other items to make the asset key touple in the internal unity asset database (this is also the same key that is used when using the Unity accelerator) the value is then the imported asset.

In order to reduce the chance of asset re-imports between machines and therefore reduce the chance of addressable indeterminism, the recommendation is to have exactly the same hardware for your build machines and use a Unity accelerator. You might also get good results if you load a copy of previously built addressables onto the build machine before building the latest content (although I am not 100% sure this is required/useful. someone else will need to advise you on that)

honest halo
#

To be clear, the seperate addressable job was to build + upload remote ones and the catalog. This is why the local group hashes then caused an issue as they were then different (so disabling the crc check and having bundles be named after the group name only resolved this)

blissful dirge
#

@real ventureWhy is it done like this and not like md5sum or similar where it always the same?

real venture
# blissful dirge <@401697510151684096>Why is it done like this and not like md5sum or similar whe...

md5 or sha calculations only tell you that the content in the source asset has changed. But source assets are not the only input parameter when generating an in-engine asset. Usually an asset is imported for a specific target platform, on a specific cpu architecture, with some specific import settings such as texture compression or format. So all of that needs to be captured to capture the intermediary asset correctly. (Plus the other factors that I mentioned earlier)

For example, if you're building for iOS and android the same texture file would be imported twice for the different texture formats involved, if the android project was built on an Intel Mac, an apple silicon Mac, and an intel windows machine then it would need to be imported 3 times and generate 3 separate intermediary assets into the Library folder.

At some basic level, there is an md5/sha256 style checksum check which is what determines if the source asset contents have changed, but we need to also represent the import settings and some parts of the environment (like cpu architecture)

balmy robin
#

Hello, I try to create a build script, I got "Timeout after 300 seconds while waiting async operations to finish" message when build addressable assets, how to fix it ?

honest halo
dusty shuttle
#

Hi world, I have lsome questions about cloud addressables
I have a very surface level understanding of them, so please correct me if I'm wrong about my approach / understanding

I have an asset from the asset store (specifically Naninovel) that uses sound files
I want to pull these sound files from the cloud (currently UGS) only when they are needed, preferrably through some code so I can control when to get them

Is it possible to... call some magic code to download the files and make them "appear" in the right place, and importantly only download when this code is called, independent of my asset that uses it?

teal mortar
#

and all of that has to be code that works asynchronously of course, since it might be downloading from the web

dusty shuttle
#

naninovel does have addressable support, I was just wondering if this "lazy" method was possible

teal mortar
#

if you can give it addressables references for the sound that should be fine then, the asset will presumably request them to be loaded at some point and then unity will download them as part of that

dusty shuttle
#

I see, and it will only get downloaded at the time of request right?

teal mortar
#

yeah, there are ways to preload things if you would rather have a loading screen up front

#

i don't do a whole lot with remote addressables personally but this sounds like a good use case for it

dusty shuttle
#

okay, thank you

dark mica
#

Is there a way to temporarily restore addressable items so that I can bake lightmaps?

balmy robin
balmy robin
#

How can I change device to rebuild addressable assets properly?

balmy robin
#

How can I change adressable loading file path remotely?

honest halo
balmy robin
honest halo
balmy robin
#

It might be able to load remote catalog file, but it has monoscript cannot be loadded error message

#

That monoscript thing is included in build?

honest halo
#

Make sure in the addressable settings that "MonoScript Bundle Naming Prefix" is not disabled @balmy robin

honest halo
balmy robin
#

Monoscript is not disabled

Yep it is, then how can I avoid it?

honest halo
#

if this isnt your problem plz explain it again better

balmy robin
#

I actually don't know how to build addressable assets properly, when I have to do new build? when to do update build?

I think I have to do new build when it have codes changes

And to make update build works properly, I must have addressables_content_state.bin in the project, so this one shouldn't be deleted, am I right?

I still worrying about broken files, unloadable assets, if it have any way to modify catalog files to change bundle files crc it will better, not sure that can we do it?

uncut flame
#

This is simple demo, 2 dlc scenes, with one UI button each, and one main menu scene with 2 buttons to load each dlc scene, so clicking just loads single scene and unloads previous (According to documentation at least), but ref count keeps climbing exceeding 3 scenes count, and used assets window shows correct behavior of one scene loaded at a time, why does scene ref count keep climbing, any ideas?

honest halo
uncut flame
#

It does disappear in bottom left corner, but Im wondering why that scene count only increases

#

I do Addressables.LoadSceneAsync(scene, LoadSceneMode.Single, SceneReleaseMode.ReleaseSceneWhenSceneUnloaded);, so it should be released once unloaded

honest halo
#

huh didnt know it had this arg now but guess its not working as intended?

#

the old way works at least

paper frigate
#
int addressableAmount = bopsAddressables.Length;
List<Task> loadingTasks = new(addressableAmount);
float progressPerItem = ((0.98f - objectProgress) / addressableAmount);

foreach (string loadedObjectName in bopsAddressables)
{
    sb.Clear();
    sb.Append(buildablesAddress);
    sb.Append(loadedObjectName);
    sb.Append(".prefab");

    // Create a task for loading the addressable
    var handle = Addressables.LoadAssetAsync<GameObject>(sb.ToString());
    var task = handle.Task.ContinueWith(t =>
    {
        if (handle.Status == AsyncOperationStatus.Succeeded)
        {
            var result = handle.Result;

            catelogueItemsPool.Add(result);
            objectProgress += progressPerItem;
            return result;
        }
        else
        {
            Debug.LogError("Failed to load bops: " + handle.OperationException);
            Addressables.Release(handle);
            return null;
        }
    });

    loadingTasks.Add(task);
}

// Wait for all tasks to complete
await Task.WhenAll(loadingTasks);```

anyway to speed this up? I wanna load about 300 models. Any tips?
honest halo
honest halo
fickle spade
#

Pretty new to the addressables system and on a bit of a timeline, so I apologize if this is an obvious/common question:

I need to hold the player up in a loading screen until I can ensure they have the latest revision of addressables on remote. Presently I'm doing this by executing CheckCatalogForUpdates and then, on completion, running UpdateCatalogs if the list resulting from CheckCatalogForUpdates is > 0 in length. After that, if there were no updates (or when UpdateCatalogs completes, if there were) I run InitializeAsync.

Superficially this looks like it will work, but I'm finding it difficult to test. I have a temporary testing remote directory set up on another machine on a VPN, and I'm pointing my remote.loadpath there. Testing this in play mode (with the play mode script set to Existing Build), the script will spend a very long time on CheckCatalogForUpdates (about 21 seconds) but ultimately claim there are no updates to be had and advance to initialization. In a built client, the script hangs on CheckCatalogForUpdates infinitely and never advances.

I suspect I'm not getting through to LoadPath and the play mode version is simply timing out, but it doesn't say it is, and I haven't been able to narrow down the problem much. Any ideas?

#

I am open to testing remote from other places if there is an easier way to do it/one that would eliminate variables. The VPN solution is just what my team had set up ahead of time

#

As I understand I could simplify this whole operation by just waiting for InitializeAsync and letting it perform its own check (from the documentation it sounds like it does the same thing I do internally) but from my understanding what I've got here should work and it's strange to me that it doesn't.

honest halo
fickle spade
#

I definitely don't, functionally speaking. The reason I'm doing it now is the team wants some affirmative confirmation if an update is taking place (versus just a check for one), but I might be able to talk them out of it.

honest halo
#

I guess if you update or download and update the catalog yourself at the very start that works but you should disable the auto download then

fickle spade
#

Yeah. I am going to try to refactor to use Initialize anyway, but can anyone confirm a timeout is what's happening here? I really should be able to resolve that directory but I'm not sure what else could be causing it. I'm going to try with initialize only when I get back from lunch.

#

Is there a way to retrieve the version hash CheckForUpdates is using internally? The crux of my situation is I need to be able to prove to QA that Unity is actually retrieving the correct version and updating as necessary, and to my knowledge Initialize doesn't give me a way to differentiate between addressables already being up to date and an update taking place.

#

Also im going to have to implement CheckForUpdates in a heartbeat anyway, so I do need to get it working.

honest halo
#

the time out is for the web request

#

ive had it freeze for ever before so its my best guess

reef steeple
#

Hello, this isnt addressables but its related to memory/loading.

I know when you have a public variable containing an asset on an active gameobject, that asset will be loaded into memory. But what happens if its the same asset multiple times?

Lets say I have 3 enemy spawner gameobjects that all contain the "Spider" prefab. They havent been spawned into the world, they're just being referenced for later use. What exactly is being loaded into memory at this time?

uncut flame
#

Update on my matter, the only way I could get rid of "the stairs" is by using this piece of code, I don't know why but handle expires at the time of scene unload so I can't release it then, and when releasing it here, scene gets broken, so it's still not a solution

#

It looks like it works only when using LoadSceneMode.Additive... why Unity why???

honest halo
#

It surely cant be hard for them to make it release correctly when the scene is unloaded right?

#

I think if you use InstantiateAsync() you have to release instance when you destroy it... WHY tf can this not be done for me 😐

uncut flame
#

Scene indicator got higher and higher, and I was unable to unload each bundle on console, so I am sure it holds it loaded

#

while Additive scene load makes it go to 2 max concurrently

honest halo
uncut flame
#

I usually use it to, but I did more testing today only to find nothing new

#

first two flat regions are additive loads, and last one is errored because you can't reuse AssetReference's operation

honest halo
#

I unload my additive scenes using SceneInstance and Addressables.UnloadSceneAsync() and it seems to work correctly.
I load scenes via await Addressables.LoadSceneAsync(sceneAddress, LoadSceneMode.Additive) meaning i never interact with the async operation objects.

torn rivet
#

Does anyone know if its possible to reference my game's addressables in an external project? I was thinking on how i could let mod developers reference an AddressableAsset inside an AssetReference.

#

I'm wondering if it could be possible to have individual Addresses taken from an existing catalog.json be selectable inside an Assetreference

#

i know you can load an external catalog, but is it possible to load said catalog in the editor and have it show up in the AssetReference's options?

honest halo
torn rivet
#

aye, i do know AssetReference saves its data at a runtime level with storing the GUID of the asset, alongside it's Type and sub-asset (if one is selected). While at editor level it keeps a direct reference to the asset itself. Sounds like i may need to modify the AssetReference drawer to see if it allows me to set the GUID field to an Address

honest halo
#

if the catalog has the GUID then that may be sufficient. sub object name is just that if using a spritesheet for example.

#

you can have groups not even include addresses so it must work

torn rivet
#

The catalog itself doesnt seem to have the guids... that or theyre all just one massive string

honest halo
#

hmm let me check one

torn rivet
#

there is this entry called keyDataString but thats not hexadecimal values so i know that cant be the guids

honest halo
#

looks to be base64 encoded atleast for the start but not sure how to fully parse it.

torn rivet
#

technically speaking AssetReference does just call LoadAssetAsync using the RuntimeKey property, which itself is just the GUID (or some extra fluff for the sub-asset)

honest halo
#

its in there but im not sure how to cleanly read this tbh

torn rivet
#

yeah it doesnt look simple to say the least

#

since LoadAssetAsync in AssetReference just uses the Addressables.LoadAssetAsync. Setting the GUID to be an address instead of an actual GUID might work

#

tbh idk if i had a fever dream but i swear i once say an Address inside an asset reference field... idk if that was in a specific version or if i'm just silly

honest halo
#

you can get the runtime key but its not stored

torn rivet
#

wym?

honest halo
#

I presume GUID is valid to load the asset if thats what its doing. the address you can get with a function but thats editor only

torn rivet
#

i see

honest halo
#

im not 100% but you can always test it out

torn rivet
#

i know the people who mod my game utilize a system called ThunderKit which itself saves the catalog from my game inside an editor project and that way they have a way to load the assets asynchronously in-editor. i'm unsure how it works exactly but since they have the catalog of the game there they could create a custom property drawer for AssetReference that lets them use a base-game's asset's address... OFC they need a copy of the game to be able to import the game's catalog in the first place so isaac_shrug

honest halo
#

huh that is cool, i was hoping there was a way to parse a catalog in editor but seems not. not sure why they bother to use json when the main data is some binary format 😐

#

another amazing decision from unity

torn rivet
#

indeed, oh well. something something "we dont support modding"

#

a shame really, but i hope that approach works

honest halo
#

well you can load other catalogs at runtime and you basically have to have a separate project for this (unless you can have many catalogs in a project)
How they expect you to do it nicely is beyond me 😐
I've always wondered too why addressables doesn't integrate better, you have to have a non addressable scene as your initial scene for example.

torn rivet
#

its really funny how addressables is supposed to be the proper way but there's all these gotchas, which sucks

#

but yeah i reckon with some of that mod-developer brute-forcing they can get it to work

#

i've seen them do some crazy stuff

honest halo
#

I think because it uses asset bundles and they have the fatal flaw of not being able to reference into the game so addressables only work nice if EVERYTHING is in bundles.

#

if a bundle can depend on another which is not a guarantee then why cant it depend on assets in the proj already

torn rivet
#

yeah... oh well

#

lets hope this is fixed in unity 7 (unlikely)

honest halo
#

its doomed forever i think unless they decide to have some revision of asset bundles for newer unity versions that support such behaviour.

uncut flame
#

I believe this is due addressables being synctactic sugar over asset bundles which seem abandoned

uncut flame
honest halo
hot prawn
#

Unity has a gltf importer

honest halo
#

yea we know?

hot prawn
#

ah

#

well good, we all know

honest halo
#

yea i was complimenting unitys package on supporting runtime use.

dusky lion
#

Hello,

We are currently working on a Unity project with multiple sub-projects, and we are attempting to integrate addressables from these sub-projects into our main project. We're encountering challenges and would greatly appreciate any guidance or insights.

Our Setup
A main Unity project.
Several sub-projects.
The goal is to create addressables in the sub-projects and then integrate them into the main project's addressable folder.

Attempts Made
Moved addressable bundles to the required location.
Merged the catalog.json files (adjusting internal IDs).
Created a new hash.
Unfortunately, none of these approaches have worked as expected.

Question
Is there a proper or recommended way to achieve this kind of integration?

Any advice or suggestions would be highly appreciated!

Thank you!

novel aurora
dusky lion
#

for subproject we are using multiple git repo and we are connecting these sub repos into a single repo using git submodule concept.

honest halo
#

drag and drop an addressable group asset into the groups window and it will be added

honest halo
dusky lion
#

Let me tell you in brief. I have 2 projects "Project 1" and "Project 2" and created addressable builds in both of them . SO i got "Addressable 1" and "Addressable 2", "Catalog.json 1" and "Catalog.json 2". Now i have put all addressables in one folder and merged "Catalog.json" files (Added "Internal id" of both together). Now i tried to run the build where i have all addressables in same build folder but I am getting "InvalidKeyException".

honest halo
#

the catalogues have binary data so i presume you did not "merge" it properly

dusky lion
honest halo
dusky lion
honest halo
dusky lion
#

Let me clarify one thing. Our build runs entirely offline. So using "remote" addressables does not mean I have to upload them to a server?

honest halo
#

Yea i think if its a path to a file it will still load the bundle

warped tree
#

This is minor, but I was wondering if there is a way to apply the SearchContext attribute to an AssetReference?

I know there's the AssetReferenceUIRestriction and AssetReferenceUILabelRestriction attributes, but I don't want to restrict to labels.

With GameObjects I can tell Search to exclude Prefabs inside of models like so:
[SearchContext(query: "p: prefab:any -prefab:nonasset -prefab:model")]
But that attribute can't be applied to AssetReferences as far as I can tell.

https://docs.unity3d.com/Packages/com.unity.quicksearch@2.0/api/Unity.QuickSearch.SearchContext.html
https://docs.unity3d.com/Packages/com.unity.addressables@2.3/manual/asset-reference-intro.html

rapid void
#

Hi, has anyone here worked with AssetBundle encryption (including Addressables) before? If so, would you be available for a chat? Preferably in German, as my English isn’t very good.

honest halo
# rapid void Hi, has anyone here worked with AssetBundle encryption (including Addressables) ...

Loading asset bundles manually will make decrypting them simple but ofc you need to then load from memory/ a stream. For addressables Im not fully sure but i think you would need a custom provider to implement decrpyting of bundles.
https://docs.unity3d.com/Packages/com.unity.addressables@2.3/api/UnityEngine.ResourceManagement.ResourceProviders.AssetBundleProvider.html

But if you are doing this to stop asset ripping its not worth it, it can only slow someone down. You cant fully prevent it.

rapid void
#

This is my current attempt: https://pastie.io/rzianf.cs, but it's still untested because I'm not entirely sure how it works with the catalog.json.

torn rivet
#

inside the editor, is it a common practice to load assets using Addressables.LoadAssetAsync() on a valid runtime key instead of accessing "editorAsset"?

mellow root
honest halo
fickle spade
#

Not 100% sure this is an addressables specific problem, but it seems to be. I've been troubleshooting for the past weekand am at the end of my rope, here:

The other day, the team updated the project I'm working on to Unity 6000.0.34 from 6000.0.23, and it broke addressables building for me. This is a problem only I have, but it affects both of my machines: Any attempt to build addressables results in an immediate failure with the error-
Internal build system error. read the full binlog without getting a BuildFinishedMessage, while the backend process is still running
This occurs whether I build the project normally or build addressables specifically from the Addressables Groups window. When it fails during a full project build, it fails during the portion that processes addressables.

I have been able to find very little on this subject, and I'm running out of ideas. I've:
-Reinstalled the editor
-Removed and Redownloaded the project
-Repeated the above, but on another hard drive
-Launched in administrator
-Completely removed Unity and Hub from my system, restarted, and started from scratch
-Regenerated library folders
-redownloaded packages
-Copied library folders from healthy versions of the project (residing on my laptop)
-disabling burst

This problem does not occur to other teammates, nor does it occur in other projects.

Has anyone seen this before? I'm stumped, and I've got a lot of people waiting on me.

fickle spade
#

Because of some intermittent success getting my laptop at to at least start building addressables (it doesn't have the RAM for the job and inevitably crashes) I have come to suspect the problem comes from an interaction with riderflow, but that is all I have been able to put together

fickle spade
honest halo
# fickle spade The relevant parts of the editor log

I think once before i had a very generic error like this. Check if a group is added more than once in the settings asset (via debug inspector view) and also check if a recent merge/commit duplicated an entry.

torn rivet
#

Something that just came up in my mind... I know that AssetReferenceT's RuntimeKey expects a GUID.

Currently i'm thinking about some mod development scenarios for people using my game, If an AssetReference<T> uses the GUIDS of my game to load the asset. What would happen in a scenario where a secondary catalog is loaded that has the same GUID?

#

Something along the lines of:

Main game project has asset A with its GUID.

Mod Developer adds a new catalog to the Addressables Catalog, which has asset B that ends up with the same GUID as A

#

How does addressables' AssetReference handles this discrepency?

honest halo
# torn rivet How does addressables' AssetReference handles this discrepency?

I think if you try to load a single asset it gets just one. If you try to load multiple it should return them all. Someone i work with was doing something with loading another catalog and had duplicate addresses.
How you will pick the correct one im not sure (perhaps by looking at the resource locations instead?)

torn rivet
#

I could theoretically make a helper class that lets you choose from which resource location to load from instead of letting addressables figure it out

#

thats nice

fickle spade
#

Not seeing any double-adds

honest halo
#

did you re clone the project?

#

oh derp i guess copying it did that

fickle spade
#

I've re-cloned the project a couple of times trying different hard drives etc

#

the weirdest part about this is that my laptop originally presented with the same error, but started compiling addressables properly after some background process finished

#

I was sure I had found the problem when it failed while riderflow was trying to work, but succeeded after it finished

#

but the more time I sink into this the more that's looking like happenstance

#

But yeah, in this case this is file-for-file the version on my laptop, just physically moved to my desktop and opened there

honest halo
#

then does it change if you remove riderflow?

fickle spade
#

I'm almost suspicious of some kind of .net problem

#

let me try

honest halo
#

unity should only be using mono included with the editor anyway unless something is using a system lib thats fucking it

fickle spade
#

part of what makes me think it is I had a very similar error from not having windows il2ccp installed awhile back

#

And at this point I've reinstalled Unity entirely several times

#

Starting to think it has to be system configuration somehow

fickle spade
#

In any case I don't think it could be the problem given my laptop doesn't seem to mind

honest halo
#

Perhaps you need to see what is at AddressableAssetSettings.cs:3042 yourself (you can find the file in package cache) @fickle spade

fickle spade
#

it's just the error handler line

#

frustratingly

honest halo
#

then next option is to enable generation of sln stuff for packages too and put a breakpoint

mellow root
honest halo
mellow root
honest halo
mellow root
#

indeed

fickle spade
#

Given up on trying to get main project addressables to build on my primary machine for the time being since I have them working on my laptop. Facing a new problem: I cannot get content updates to apply to built clients. They work fine in editor, and built clients don't report HTTP errors, but they will only ever use the first version they cache

#

Trying to test from localhost

#

any ideas?

honest halo
#

hosted the new catalog + hash?

fickle spade
# honest halo hosted the new catalog + hash?

Yeah. Got it into a position where the editor in play mode will fail to an HTTP error unless I have the new ones pasted onto the localhost server, so some part of that is working

#

and the editor responds as expected to content updates

honest halo
#

make sure you have a time out time set for the downloads and what platform is this?

fickle spade
#

but, while a built client will to load addressables if the server is empty when it is first launched, once it has loaded succesfully once it always loads from cache

#

StandaloneWindows64

#

No timeout set right now, although I've tried with one in the past. I'll put one back on

#

Should I have a custom download certificate handler?

fickle spade
#

Of note, the built client will report HTTP errors if remote is empty or has been replaced with a new build (as opposed to an update) only if "Use Bundle Cache" is disabled.

#

otherwise the built client behaves exactly as if it is using local assets

#

even if nothing ever resides on remote

#

With bundle cache disabled, it will HTTP error on a totally new addressables build, but will use the old addressables version if given an update

fickle spade
#

Could my method of testing be invalid somehow? I've been loading a texture2d into a rawimage and editing that texture2d between builds of addressables

#

Since the built client will 404 (presuming I have caching off) if I include nothing even after a successful load, that tells me the client must not be loading from a cache, but rather somehow retrieving the old file despite the presence of the new one and an updated catalog.

#

I think it must be a problem with my addressables_content_state.bin somehow

fickle spade
#

Looks like a bug with 2.2.2 with a workaround in editing a conditional in source code? Not sure if I'm missing osmething; been a long day. In any case not sure how to go about it.

rapid void
#

Hey everyone, I’m trying again since I didn’t really get any helpful answers last time.

I have a project where the client always has different content. Depending on which server the client connects to, different mods (AssetBundles) are loaded. The main issue isn’t encryption but rather how to properly load these assets.

I’d still like to use Addressables, but how should I handle the Catalog.json (including the idea of using a CustomAssetBundleProvider), or are there better approaches?

The bundles can come from completely random users. Similar to GTA, anyone can add content and use it in-game. These bundles are always created externally from the main game. Later on, I might develop a separate tool to simplify the process for users.

I’d appreciate any tips or ideas!

honest halo
# rapid void Hey everyone, I’m trying again since I didn’t really get any helpful answers las...

To add the content at runtime you can load in the catalogue at runtime. As long as the load paths are correct for where the bundles are it should work: https://docs.unity3d.com/Packages/com.unity.addressables@1.14/manual/LoadContentCatalogAsync.html

The next issue however is how to remove this later... I wonder if you can load the same one again later with different content and it will change 🤔

rapid void
honest halo
#

Why addressables doesn't support this better I don't know, dumb decisions once again

rapid void
#

Okay, thank you. I'll try messing around with it. If anyone else has smart ideas on how to solve this, feel free to share 🙂

honest halo
#

Id try to see what loading runtime catalogues does for you. I've not needed to remove them so it's been fine for us (we had a separate project for handling these different assets)

rapid void
#

Okay, I'll give it a try. Thanks.

steady snow
#

Hey, im having trouble with a UI element using addressables. I have an addressable scene with a button that I attached an onclick event to, but the onclick function i attached in the editor seems to disappear when i go into play mode and load the addressable scene. anyone having similar issues?

#

when I go into play mode from the scene with the button the onclick function i added (without loading the scene through addressables), the function stays attached

steady snow
#

ok, clearing cache from the groups menu then rebuilding fixed it, nvm

novel aurora
tawdry egret
#

Anyone using 2022.3.41f1 or have experience this problem with loading addressables and the script doesn't get bundled? When I load it into my project, says that script it missing. If I manually copy that script over into my loading projects script folder, then it works. It'ls like the bundle is looking locally in the loading project instead of the .bundle file.

wraith edge
#

I don't believe this is supported since the usual consumer is a build which doesn't have the whole compiler toolchain shipped with it. It sounds like you have a project to project thing going on, in which case unitypackages might work better? Transferring them as text assets and doing some import processing to turn them into script files could also be an option.

tawdry egret
# wraith edge Are you trying to store actual scripts in bundles instead of references to scrip...

Well, I was testing out a widget loading style framework: a Portal project and a widget. Both two completely separate projects and the Portal dynamically loads the widget through addressable. All works except the scripts not being captured in the bundle. The whole point of addressable’s is that, to create a dynamic loading framework where projects can be kept smaller and modularized… but don’t include scripts? Hu?

wraith edge
tawdry egret
honest halo
#

If you want components that work in 1 project but you build addressables in another then use a package to share these

tawdry egret
#

Which I could download and load at runtime, like addressables?

#

I thought packages were more static, in that it's only used in design time.

wraith edge
honest halo
#

its funny how mod frameworks can do all of the things you want but unity provide no such way 😐

tawdry egret
#

It's like I invite you over for a beautiful steak dinner, pick ya up in a limo, bring ya to my mansion, sit you down to eat...and no steak for you!

wraith edge
teal mortar
#

i also probably don't want a game i'm playing to download and execute arbitrary native code from the internet 😨

frigid stag
plain terrace
plain terrace
#

downloading 3000 copies of Code Red directly into the kernel

mossy vale
#

Hey, I did my research and frow what I understand it is impossible (in a built in way) to load external code (assemblies) for modding support in a IL2CPP game. Definetly not with AssetBundles and maybe with Addressables, but they can only load assemblies that are already in the project and not external in any way.

Is this true or is there also a hidden way to do this?

wraith edge
mossy vale
#

event based scrippting it is then

teal mortar
#

yeah you can embed a scripting language or use visual scripting

mossy vale
teal mortar
#

sure i'm just saying there's some very existing solid options for doing that kind of thing

mossy vale
#

like a package for lua?

honest halo
teal mortar
#

lua will never go out of fashion 😎

honest halo
#

or research modding frameworks and see if you can do something to make it easier as some are quite powerful

mossy vale
#

in a quick search it doesnt look like these support IL2CPP

#

im guessing they use reflection

honest halo
#

what boneworks uses should support il2cpp 🍈

coral iron
#

does anyone know which addressable api does this compression format conversion ?

#

coz our project uses custom downloading script to download asset bundle, not sure if the format will be converted successfully

frail lynx
#

Hey, how do get the remoteLoadPath of my current profile in the code?
And how do I overwrite it?
🙏🏼

honest halo
#

You can do most stuff via AddressableAssetSettingsDefaultObject.Settings

#

if you want to check if a group uses a remote path now that sucks ass (how I did it before is by checking all schemas in a group until their build path id matches the remote id but you have to extract this yourself from the settings asset)

frail lynx
frail lynx
honest halo
#

active profile id? the remote path?

frail lynx
#

oh activeProfile

honest halo
#

hopefully you can just check all profiles or hard code the ids

#

oh shit i forgot, you have to get the fucking profile id with its name

frail lynx
#

but i looked at one and didnt see any field that have something like this, and i only have 1 profile

honest halo
#

so you actually do settings.profileSettings.GetValueByName(profileId, valueName); and to get the id you do settings.profileSettings.GetProfileId("myProfile");

#

so active profile id is already usable to GetValueByName

#

my bad

#

i confused the ID of a profile vs its name

frail lynx
#

i can get see the profile but no url is there

honest halo
#

yea its stored elsewhere cus addressable bullshit

frail lynx
#

wait maybe i didnt make my self clear before haha,
I want to read the url of the remote load path, that I put on my addressable profile, so I can add "/platform" path to it on runtime, and get the correct bundle for each platform im using.

honest halo
#

Ah, you can modify a path at runtime by specifying a function to transform it.
But that's not a good way, you should use [] and {} to have the platform in the paths at build time

#

i can give an example when a proj opens...

frail lynx
#

what do you mean by [] and {} ?
im new to game dev
i thought i need different path for every platform since the game would run couple.

honest halo
#

in the url/paths in the addressable profiles, [] and {} let you "insert" variables.
[] gets resolved at build time, e.g. bundles/[BuildTarget] becomes bundles/Android

frail lynx
#

ohhh brilliant

honest halo
#

{} gets resolved at runtime so it can be a static property such as bundles/{Helper.path}
I use this for the platform to make it be lowercase cus unity in their great wisdom doesnt do this for build target 😐

#
public static string Platform
{
    get 
    {
        string platformName = "android";
    #if !UNITY_EDITOR && UNITY_ANDROID
        platformName = "android";
    #elif !UNITY_EDITOR && UNITY_IOS
        platformName = "ios";
    #endif
        return platformName;
    }
}
frail lynx
#

i have [] on the build path but the remote is url to unity CCD bucket

honest halo
#

Here are my remote paths for example:

#

the build path is to output em in a folder in the root of the project for a script to then upload to s3

frail lynx
#

is the AddressableHelper a custom class you made?

honest halo
#

yes

frail lynx
#

but how does unity know to read the values from there?

honest halo
frail lynx
#

so just by creating this class in spesific path, unity will read from it?

honest halo
#

yea, read the doc page to understand better. If you had a class Foo with public static string Bar = "example.com" then you put {Foo.Bar}

#

Or [Foo.Bar] , again read doc page

frail lynx
#

yeah im familier

#

aright! thanks!

#

it's 1:55AM here so ill get to it tomorrow

honest halo
#

11:55 pm here 🇬🇧

frail lynx
#

oh, and does that mean i should keep path in env out of the git repo?

honest halo
#

er yea i would ignore where remote bundles are output to cus you dont need to keep em (post upload)

frail lynx
#

are you taking about the upload? i meant the path where i get the assets from

honest halo
#

what does "path in env" mean. use the default paths for the local groups

frail lynx
#

since i will need to write the path for my bucket in the AddressableHelper class it will be exposed
so it may be better to use enviorment variables

honest halo
#

well i guess an env var is fine for how you upload but its up to you. The build needs the remote url.

frail lynx
#

i dont mind it being in the built game, just not in the code in the repo

honest halo
#

something for you to decide i guess 🤷‍♂️

frail lynx
#

its not an issue usually in games?

#

i have fullstack background and there it's a no no

honest halo
#

anything in the client should be presumed to be readable by a user. The remote url has to be given to the client at some point so someone can read it.
This is why important services that need keys cant just be used in client (safely anyway)

#

i guess if you want the remote url to never be exposed then you would need a proxy server that is exposed blah blah

frail lynx
#

or secrets, but it's more about the urls in the repo rather than in the build
well ill go to sleep now, thanks a lot for the help!

frail lynx
honest halo
frail lynx
#

ok so first, im not sure i understand how to edit the remoteloadpath. i updated it on the addressable profile but when i ran the game i get an error (on purpose) and in it i see the old url

#

i tried to Build from addressable groups -> build -> new build -> default build script
but still it uses the old url

#

i had some other issues but its a followup haha

honest halo
# frail lynx

Did you set this path on the groups properly? The path should update in the catalog to my knowledge if you rebuilt the content

frail lynx
#

I updated it on the profile, in the group im using that profile

frail lynx
honest halo
honest halo
#

Perhaps the catalog being served was cached and its the old one still

frail lynx
#

i burned an entire day on this 🥲

honest halo
#

check what path your catalog is using too

frail lynx
#

i cant find the catalog anywhere in the files of my project

#

this is all i can see

#

none ^

honest halo
frail lynx
#

i have just reseted everything related to addressables
ill check

#

its not enables atm. but tbh im not even sure whats happening, i deleted the ServerData folder which is the remove.buildpath and i can still load things...
i think im gonna give up on this... it's too unintuitive for me ):

#

nothing make sense to me here... things dont work when they should, and they do when they dont.. and cant find any good documentation for any of this

honest halo
#

the build path is where they are output, load path is where they get loaded from (local or some url)
If you have remote catalog enabled it will get that and use that if possible

frail lynx
#

should..

#

im still not even sure when the editor is using the local and when it uses the remote
atm. i have a remote.buildpath = ServerData/[BuildTarget] and this folder doesnt exist but still after im doing a build the editor manage to load'

frail lynx
#

yeah but like i said, i still dont understnd when it uses any of them (remote, local)

honest halo
#

Click an addressable group and check there...

frail lynx
#

in my case it seem to never use the remote values i guess

#

I know where it is, I updated it constantly, im saying its being ignored

#

maybe my english is not clear, ill try to explain again,
I updated the value Remote.LoadPath in the Addressable Profiles -> default (profile)
but even after i go to
Addressable Groups -> Build -> New Build it still not using the new value i put there

#

it seem like its using the local paths when i use the editor

#

ok i figured out its not using the remote paths when you are on the editor

honest halo
#

did you check this?

#

(i have an editor profile that loads remote stuff from the build path for easier testing)

frail lynx
#

oh let me see

#

ok so now it will ask for the remote path on the editor!
works

#

but i cant seem to load from unity CCD bucket correctly
i used this url:
https://b2f379ed-3701-4dd0-8f41-5f1fcf1d4c69.client-api.unity3dusercontent.com/client_api/v1/environments/production/buckets/4b5408e9-47bd-4381-9177-0269bdb95d32/release_by_badge/latest/entry_by_path/content/?path=/[BuildTarget]

and i got the StandaloneWindows64 at the end of the url successfully, but i still cant find/access the assets and getting 404

#

even though there are there

honest halo
#

i dont have any clue how the unity hosted stuff works, that surely cannot be the correct url to use...
What my work uses is s3

frail lynx
#

well, it works just fine if i dont include the [BuildTarget]

#

because i added the files to the root also

#

ok so i guess ill have to figure out how to access them correctly, and worst case just have different bucket for each platfrom (and different profile)

#

everytime i feel like i get whats going on it keep surprise me...
are you sure that i get the assets from the remote repo?
i think its getting it elsewhere

#

i just replaced the url with nonesense and did a new build and it still got the assets

honest halo
#

if the load path is say https://example.com/bundles it will load from there
the catalog matters though, its where the addresses and paths are stored

frail lynx
#

i dont understand

#

is it loading it from the url or caching it?

#

because the url right now is not real yet the game loads them correctly

honest halo
#

show me the path its using for your remote catalog

frail lynx
#

for the remote catalog or in the remote catalog?

honest halo
#

in the inspector for addressable settings

frail lynx
honest halo
#

set player version override to a value so your catalog names are consistent

frail lynx
#

done

#

ok its consistent now!

#

thanks a lot!

honest halo
#

It helps when you want to update an existing builds catalog and bundles later
otherwise it will give the catalog a new name and it wont work

#

but ofc remember if you want different game versions to use different bundles you need to change this version or change the path somehow

frail lynx
#

but if i want to build for WebGL, i cant really load it since im on windows.. is there a way around?

honest halo
#

if you change platforms in editor it will try to load em but shaders and some textures will be broken

frail lynx
#

i only have a gameobject with list of scriptable objects on it

#

i switched to web (before build)

#

and after i build its actually working now 😮

#

ill try to run it from browser

#

but i wonder if it will work.. because [TargetBuild] is determined on build time by UnityEditory bla bla application something, but it will show windows because thats the current platform no?

#

i cant check anything now because it takes 10 minutes to build for web 😶

#

damn Brotli Web.wasm... take ages..

#

its working!!!

honest halo
#

yay glad its good now

frail lynx
#

thanks a lot!!! i feel a little more confident now in addressables hahah

#

couldnt have done it without you 🙏 🙏 🙏

honest halo
#

i've battled with addressables a lot so glad i could help

frail lynx
honest halo
#

the assets get processed for that platform (e.g. build the shader for android so it doesn't work on windows)

frail lynx
#

so ill develop on windows and when its time to release ill switch and build

honest halo
#

you can be on the webgl plat but change addressables back to "use asset database"

frail lynx
#

brilliant!

#

and one more question if you will my good sir, about the correct way to use the addressable

#

im making a small match-3 game and wanted to have the tile variants as addressables so i can update it on the fly, i created a scriptable object that hold the data of the tile (sprite, audioclip, color, and logic and vector list for the matching and poping logic)
and i wonderd how to wrap it for adressable

#

ATM i make a new prefab of game object with a script that gets SerializeField of List<MySO>

#

is it a good approach?

honest halo
#

er well ofc you can load the asset with the address or use AssetReference to not serialize a ref directly (and thus make a dependency)
I guess it depends how you want to be able to change this data later. If you use unity remote config for example an address there is easy to change any time

frail lynx
#

i dont think i understood half the terms 😅
i just have list of SO

so if i want to update the list i just add the new SO there and build and upload to the bucket

#

and in the game i set a reference for it on my gameManager

#

[SerializeField] private AssetReferenceGameObject tilesList;

honest halo
#

eh why not have the list on Gamemanager

#

why do you need a prefab to then have a list

frail lynx
#

because this prefab is the addressable

honest halo
#

its referenced directly by game manager... is game manager in an addressable scene/prefab?

frail lynx
#

you ask why not make a list of addresable references in the gameManager?

honest halo
#

The data in the "game build" and "addressables" cannot mix with direct references

frail lynx
#

im not sure i understand

#

why is it mixed here?

honest halo
#

If your start up scene is "Main" and Main has a ref to an asset, that asset is included in the game build (fully seperate from addressables)

#

If i put this asset also in addressables, its duplicated! Its in the addressable bundle AND in the game build

frail lynx
#

ohhh i think i undestand. well i thought that because i dragged it to the addressable group it excluded it from the build

#

and i never use it directly, i dragged the "prefab" to the game manager from the addressable group

honest halo
#

no. If you remove the field "Tiles List" and instead use AssetReference<GameObject> then its okay as this references the addressable indirectly

#

or doing Addressables.LoadAssetAsync<GameObject>("myAddress")

frail lynx
honest halo
#

HA you are right my mistake ignore me 😐

frail lynx
#
[SerializeField] private AssetReferenceGameObject tilesList;

private void Awake()
{
    tilesList.LoadAssetAsync().Completed += LoadAddressables;
}

private void LoadAddressables(AsyncOperationHandle<GameObject> handle)
{
    if (handle.Status == AsyncOperationStatus.Succeeded)
    {
        List<TileSO> tiles = handle.Result.GetComponent<AddressableTilesList>().TilesList;
        Initialize(tiles);
    }
    else
    {
        Debug.LogError($"Failed to load asset: {nameof(LoadAddressables)}");
    }
}```
honest halo
#

Then back to my original point, why not use 1 scriptable object to reference all the others instead of miss using a prefab?

#

you can also use tags to load many assets at once with the same tag (labels? i forget)

frail lynx
#

so creatre a new scriptable object that have a list of scriptable objects inside?

#

and i thought about labels but wasnt sure how to sync it all and call the Initialize(tiles); only after all the assets were loaded

#

im sure there are solutions i just didnt go deep into it, is it better to do it like that?

honest halo
#

up to you i guess. labels can be useful sometimes but dont bother if you dont really need to rn

frail lynx
#

atm i see 3 ways
gameobject (mine)
SO with list of TileSO
and seperatly (with label) and await with the Initialize(tiles);

frail lynx
honest halo
#

ive used them in the past only to help pre ~~load ~~ download assets ahead of time for stuff

frail lynx
#

yeah, here its not to help the load, its just to enable dynamic updates

honest halo
#

then maybe change it to 1 so with the list and call it a day

frail lynx
#

is it better than gameobject with a list?

honest halo
#

yea it better fits what you want to do, reference a thing that holds a list

unreal delta
#

If a shadergraph reference a subgraph somewhere else, addressables do not know to find that reference?

#

I think it's even the material, it always takes the older material version somehow

unreal delta
#

The material isn't being updated in the addressables, no matter what. When I click it on run time, it doesn't ping the real source of the material.