#📦┃addressables

1 messages · Page 5 of 1

unreal delta
#

Ok, I think the issue is with the subshaders.

next cairn
#

Are addressable catalogs only compatible with the Unity version they were generated in? Figuring out because I'm getting an error while reading the catalog, and I don't want to redo and reupload all the catalogs unless I really have to

formal arch
#

Hi all, I'm working on moving away from Resources and towards addressables, for now I just want to check if I can load a prefab in the same way as I was doing before synchronously however I am only getting a null error when attempting to read it.

Below is the code I am using to read the asset, and attached is a screenshot of the Addressibles window itself, I have already clicked default build too. Is their anything I could be missing that would still be not allowing Addressibles to find the asset or throw a NullReferenceException when trying to do so?

AsyncOperationHandle<GameObject> handle = Addressables.LoadAssetAsync<GameObject>("Grasslands: Tree");
GameObject prefab = handle.WaitForCompletion(); // <--- This is the line that throws the NullReferenceException 
#

A bit more info:
If I use the "Asset Database" as the "Play Mode Script" it throws the null error:

NullReferenceException: Object reference not set to an instance of an object

However if I use the "Existing Build (Windows)" I get a different error

System.Exception: Unable to load asset of type UnityEngine.GameObject from location Assets/[ Assets ]/[ Prefab ]/[ Biome Entities ]/[ Grasslands Biome ]/Tree.prefab.
UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1<UnityEngine.GameObject>:WaitForCompletion ()
#

-> Sorry everyone, I found the issue. Seems like the problem is that Addressibles doesn't support paths using '[' or ']' braces

#

Quite anoying as Resources works fine with those kind of paths, but not the end of the world.

honest halo
#

though actually this doesn't explain it breaking with the file path but its still weird 🤔

teal mortar
#

i'm guessing it's because the default key of any asset is its file path, if you give it a different key the file path might not need to change?

formal arch
#

Yeah, I get alot of strange comments about the use of special characters in paths. Its mainly a formatting thing, special characters are always ordered at the top of any directory in windows and it makes it a lot easier to visually see the differences between files and folders.

But yeah I'll change this now to remove the special characters. Thanks for the proper explination though on why this is a problem! Its good to know for future reference!

formal arch
#

Second question sorry, does Addressables.InstantiateAsync Automatically clean realease the prefab? My previous code used Addressables.LoadAssetAsync then instantiated manually, and after then called Addressables.Release on the prefab handle. But using the instantiate function seems to kill the object almost imidiatly making me think its doing something simular to Destroy()?

teal mortar
#

yeah, destroying an instance should release the handle if it was spawned with InstantiateAsync

#

well, decrement the ref count, rather

honest halo
#

why? unity dumb

formal arch
#

xD

honest halo
#

They could have easily added an event or something for addressables to release the instance for you i guess not

teal mortar
formal arch
#

Tbh, its quite confusing as I figured once the object was spawned in the world Addressable would have done its job and would not need to be involved anymore, however from reading it seems like it still holds onto the object for its full lifetime.

Does this not create a problem with addressables needing to hold references to every single copy of an instanced object in the scene? Say 1000 trees? What benefit does it have to keep hold of these references?

honest halo
#

In that case i would just load the prefab and release the prefab when you know all the trees are gone

formal arch
#

Ah, is the InstantiateAsync mainly designed for single use gameobjects then?

honest halo
#

It could be because if you use an asset from an instance but the instances all get released, it will unload stuff you are actually still using (as it cant know)
Still dont agree with it and think an auto release should be done for instance creation.

formal arch
#

Gotcha!

#

Yeah Ill most likely just go with the prefab loading option then, and then instantiate manually again from that.

#

Thank you ^-^

formal arch
#

Hiya, I am going to be loading in some scriptable objects using addressables, these contain biome generation information for procedural generation so will most likely be sticking around for a while in memory. Is it fine to release the operationHandle once this has been loaded in?

honest halo
#

you can use the profiler to debug loaded assets that dont get released btw

formal arch
#

Right so even if I store the result as a seperate variable Addressables will still delete the memory?

AsyncOperationHandle<SurfaceBiomeScriptableObject> operationHandle = Addressables.LoadAssetAsync<SurfaceBiomeScriptableObject>("Surface Biome: Grasslands");
_surfaceBiomeScriptableObject = operationHandle.WaitForCompletion();

operationHandle.Release();

So that I am using this stuff correctly then, is the idea with addressables to always keep the item in memory unless their is 100% no chance it is being used?

#

For example, say I need to load an image, just to display to the screen in a menu, I have to keep the link with Addressables open until I close the UI again?

honest halo
#

the managed object is fine that wont vanish

#

but if say you load a scriptable object instance to get an texture reference but release the scriptable object, the texture will get unloaded causing graphical issues

#

You should release these assets when you dont need them anymore, so when what ever is showing them is destroyed/closed

formal arch
#

Right! Thanks!

#

So just to confirm then sorry, is the problem with the managed object loosing the reference due to nesting? As since a Texture2D is a class should it not also be a managed type?

honest halo
#

I gave the texture example because the managed Texture2D object would still exist, but its native counterpart + the actual texture on the gpu would be deleted.
Any managed object wont magically vanish untill its garbage collected.

#

Unity calls these "managed shells" as there is a managed object linked to something else (Texture, audio clip ect...)

#

You may be aware that gameObject == null is true when the gameobject has been destroyed. But actually the managed object is still there, unity just override the comparison to make it equal null when destroyed.

formal arch
#

Ah okay, thats fine! That makes sense then, sorry I just wanted to confirm I understood you correctly. In that case I keep things open until they need to fully be destroyed and then release them at the end of the program (for the biome generation data) or when they are unneeded sooner.

#

Thank you ^-^

honest halo
#

Hope i didn't confuse you with the managed <-> native stuff but something good to understand in relation to how unity works

formal arch
#

No no, that was great. I knew about the null example before but it makes sense in regards to this too. My confusion was mainly coming from some post online saying its fine to do it and others not, but you explained why perfectly! Thank you xD

slate timber
#

I just updated to unity 6 and I have been trying to import one of my terrain generation scripts into it and I get mesh glitches, it is only wanting to show from the backside even though it gets generated facing up?

slate timber
#

nvm, found out it was sky and fog volume that caused the issue 😦

next cairn
#

How would you go about copying an addressable profile from one project to another? I figured it'd be a scriptable object but I'm not sure where to find the ones Unity generates, and it's not part of the addressable asset settings either.

next cairn
#

I'm getting a bunch of errors when trying to load my addressable assets from a remote source. I'm sure the solution is obvious but I'm tired as hell and googling isn't working for me

balmy robin
#

Which group should store shader files? I've experienced missing shaders when store it to remote group, can't it be stored in remote groups?

onyx shadow
#

For the love of god I need some help. When I switch my build to Android, the loaded addressable's materials do not load. SOMEONE PLEASE HELP ME I AM LOSING MY FRIGGING MIND

verbal vessel
#

Can I rely on Addressables.LoadAssetAsync.Completed callbacks to be called on the main thread? The documentation is vague on this. In practice it seems to be the case, but will it always be the case, or will I get some rare crash months down the line because it isn't always so?

teal mortar
verbal vessel
#

I believe so too. The documentation doesn't mention threads at all, only that the callback occurs in LateUpdate of the same frame if the asset is already loaded.

honest halo
coral iron
#

does anyone have any idea on how to pass in this build asset bundle option ? i have looked into the addressable code and it appears addressable 1.19.19 is using ContentPipeline.BuildAssetBundle which gives me no place to pass in this option

#

custom build script did not provide any option either

onyx shadow
paper frigate
#

Addressables.UnloadSceneAsync(currentScene); //Why does this crash on some computers? I suspect weaker computers (windows)

#

and how do I resolve this

#

it just crashes

honest halo
paper frigate
#

Addressables.UnloadSceneAsync(currentScene); so this line causes the crash specifically

honest halo
#

and a big warning: If you do not await and fail to .Forget() an async function and it throws an exception, the unity console WILL NOT PRINT THE EXCEPTION.
Only a debugger can catch it then or if you catch + log another way

paper frigate
honest halo
#

well yea its why i just said all this stuff 😐

paper frigate
#

okay thanks for the advice! I tried all I could think of. I will keep you updated 😄

#

it's great you gave me some options to try

#

really big thank youuuuu

honest halo
#

Id recommend using UniTask and reading the read me for how to use it

teal mortar
#

i don't disagree it's not a great idea to use them, but Task.Delay and async void are in no way fundamentally broken on Unity

#

an exception thrown in an async void method gets printed to the console like any other exception

honest halo
#

If the task is not awaited then its quite possible for an exception thrown to not be logged in the console. UniTask solves this specifically with its Forget() function as it will log uncaught exceptions.

Task.Delay() is not wise to use as you could then be executing at some point during a frame that is no longer suitable. Awaitable and UniTask delays complete at the normal update cycle events (Update/LateUpdate etc).

#

Similarly, if you run code in other threads then these exceptions also will not be logged in the editor console unless you make an effort to do so

teal mortar
#

async void methods obviously can't be awaited haha, Unity just prints the message itself

#

that's only on the unity thread of course, but that's true in this case and 99% of cases you want async void in Unity in my experience!

honest halo
#

Maybe because i use UniTask soo much i forgot, unitask provide UniTaskVoid to replace async void.

teal mortar
#

Task.Delay() is not wise to use as you could then be executing at some point during a frame that is no longer suitable
that's not really how it works, it'll run during the next synchronization context update like normal awaits

teal mortar
honest halo
#

When does the unity main thread syncronisation then resolve a task delay?

teal mortar
#

after Update

honest halo
#

then yea its at some point during the frame you cannot customise

#

Is there somewhere with info on how unity handle theirs?

#

nvm found it

teal mortar
#

well if you want precise control over when something executes in the update loop there's the Awaitable methods now, Task.Delay is kind of only useful for long delays anyway where you don't really care about that 😄 my problem with it is just that it's expensive and uses thread stuff so breaks on webGL lol

honest halo
#

UniTask delays work with the update loop so perhaps they would still work as i believe they get "checked" each time if the time has passed or not.

teal mortar
#

that's more or less how Task.Delay works in this context too, it's just implemented in a way that's not particularly suitable for Unity

honest halo
#

Yea. Dunno why I had the impression that unity didnt handle Task well but maybe that was back on like 2019 or somethin

coral iron
# coral iron

in the end i figured it out myself, it is not opened by default, have to use addressable as embeded package and modify the source code to add this option

strange shuttle
#

Hello, I'm working on my project to bundle scene (level 1 and level 2) using asset bundle. When load scene 1 and 2 seems fine and work, but when I reopen scene 1 it gave me this error

The AssetBundle 'Memory' can't be loaded because another AssetBundle with the same files is already loaded.
UnityEngine.WWW:get_assetBundle ()

does anyone know how to resolve it?

IEnumerator LoadSceneFromBundle(string bundleUrl, string sceneName)
    {
        if (!remoteAssetBundle)
        {
            using (WWW web = new WWW(bundleUrl))
            {

                yield return web;

                if (!string.IsNullOrEmpty(web.error))
                {
                    Debug.LogError("Failed to download AssetBundle from " + bundleUrl + "! Error: " + web.error);
                    yield break;
                }

                remoteAssetBundle = web.assetBundle;
            }


            string[] scenePaths = remoteAssetBundle.GetAllScenePaths();

            if (scenePaths.Length > 0)
            {
                // Load the first scene in the bundle or find one matching sceneName
                string sceneToLoad = scenePaths[0];
                foreach (var path in scenePaths)
                {
                    if (path.Contains(sceneName))
                    {
                        sceneToLoad = path;
                        break;
                    }
                }

                // Extract just the scene name from the path
                string sceneNameOnly = System.IO.Path.GetFileNameWithoutExtension(sceneToLoad);
                LoadAssetBundleScene(sceneName);
            }
        }
    }

    public void LoadAssetBundleScene(string sceneName)
    {
        SceneManager.LoadScene(sceneName);
    }
honest halo
#

also WWW is deprecated and has been for ages so stop using it 😆

strange shuttle
honest halo
#

No because it will exist twice otherwise

strange shuttle
#

Thank you for your suggestion

fickle spade
#

Finally got a chance to get back to trying to straighten out Addressables. Since last time I posted looking for answers, I've gotten addressables to work as expected in a clean project on the same versions, and worked at considerable length with a teammate who hosts our build servers to set up build and update workflows and temporarily host addressables on the local network.

Our efforts have been enough to get addressables in the primary project to load correctly for the first player and full addressables build pair (we're building separately in all cases), but addressables updates are never received by built clients.

Earlier today I lucked out on some google-fu and discovered that built projects receiving remote addressables cache them in locallow/unity/[company]_[project]/, and separately cache a copy of the catalog in locallow/company/project/com.unity.addressables, next to the log files. I then noticed that my clean testing project (in which addressables update correctly) is successfully saving this copy of the catalog, but the main project is not. Despite successfully loading the first full addressables build and saving it to to the company/project directory, no copy of the catalog can be found.

I assume this discrepancy is responsible for the main project not detecting new addressables and updating, but so far have not had any luck determining why it might be happening. The main project and empty testing project are configured identically as far as I can tell, with the only differences being more asset groups in the main project, and the fact that my testing project is built locally, and main project is being built remotely on my coworker's build server and pushed to steam by command line.

Any guesses as to why this might be? Could we be missing a step in the command line part of the process?

#

I can find no exceptions in the build logs or player logs, and have verified through said logs that the RemoteResourceLocator for the main project is coming back with CanUpdate true, which was a pain point in the past.

next cairn
#

alright so I'm getting a RemoteProviderException : Invalid path in AssetBundleProvider error when trying to load remote addressable assets. I've looked at other forum posts and the errors seem to be related to stuff like getting the paths wrong, but I know the load paths are correct because I'm loading from the same location, and I know the assets are there

honest halo
fickle spade
#

Unfortunately the server side of this is going down across the country from me

fickle spade
#

I've left the argument blank there, so it's a date stamp at the moment

honest halo
fickle spade
#

Left default, content update builds introduce new catalogs with the new timestamp

#

which I verified to work alright on my default testing project

#

My running theory is that our content_state_bin is getting improperly replaced between new addressables builds and content update builds. Hopefully about to confirm or exclude that theory.

fickle spade
#

We tried deleting that file and running an update build to see if it would fail, but it didn't, and the build log claims to have accessed the file in the usual location. Trying to determine if it's a version control problem

honest halo
fickle spade
#

Interesting. Were you doing full addressables builds every time and just overwriting then?

honest halo
#

we rarely needed to update content for a released version but when we did we built it the same (mobile platforms)
worked fine. and seeing as we used jenkins jobs this seemed the best way

fickle spade
#

Seems to work fine

#

I'm 99% sure the problem was with the state.bin getting lost somehow between builds on the build server, but this is definitely the simpler move

honest halo
#

Glad you got something working, dont think they designed it with people automating builds in mind

paper frigate
#

@honest halo I did some testing. The problem is using the additive scene mode

if (safeMode)
currentScene = Addressables.LoadSceneAsync(sceneIndex.ToString());
else
currentScene = Addressables.LoadSceneAsync(sceneIndex.ToString(), LoadSceneMode.Additive); //this doesnt work on some devices and idk why

honest halo
paper frigate
honest halo
paper frigate
paper frigate
# honest halo Post it if you can

The thread tried to execute an invalid instruction. Thats the exception. 0xc000001d. I will post the full crash log in the coming days when I reproduce it again on the older devices!

honest halo
#

Hmm wont open this dump but an invalid instruction error sounds like something really went wrong. I presume this is using il2cpp?

fickle spade
# honest halo Glad you got something working, dont think they designed it with people automati...

Do you know if there's a trick to live-updating addressables bundles? We've got my test case (A little sprite I change the color of) working for all restarts of the game, but not bundle updates taking place while the game is loaded. I'm a bit confused as to why not. I've verified through debug prints that the update is detected, downloads, loads in LoadAssetAsync, and gets applied to the texture with rawImage.texture = obj.Result;, where Result is the result of LoadAssetAsync.

#

Off the top of my head, I'm guessing it has to do with releasing

honest halo
#

Well are you releasing the asset when its not used anymore? you can use the profiler on dev builds to better see (if you have the build report)

fickle spade
#

So far I haven't been releasing at all just in interest of getting everything working. It does make some sense to me that I would have to here, though. Can assets be released as soon as they're loaded, or do I have to keep them around until they aren't being displayed?

honest halo
#

if you release when its in use you would probably see the texture break. you should release when that asset is not in use anymore. It lets unity unload assets and whole bundles

fickle spade
#

Hmm, any way to force everything to release when an update is executed?

#

I apologize for not just testing this stuff, but I'm in a somewhat unfortunate testing position because I can't run play mode with existing build, in turn because I can't build addressables locally. I get a completely unresolvable SBP error for some reason, so I'm reliant on the build server's twenty minute turn-around

honest halo
#

I think this stuff is tracked in the profiler even when using asset data base mode. i've had vague errors before when i had assets duplicated in groups (due to bad merges)

#

but id get on keeping an asset ref and trying to release when you can

fickle spade
#

hm, alright. I'll poke around and update with whatever I learn. Our situation is tough to handle discreetly because we have a bunch of menu overlays that are alive all the time, so some things we need to be able to swap to new versions in-place

honest halo
#

you would need to have more bundles then (either more groups or split up more) to have the chance

next inlet
#

Does anyone know why Unity might be stripping all URP Terrain lit shader variants that include the INSTANCING_ON keyword?

Terrains that use Draw Instanced are included in my Addressable groups. I've added all terrain related shaders/files to addressable groups. I have even created a Shader Variant Collection that includes the correct variants and put that in a group.

Nothing works except to set Instance stripping to keep all, however I'd rather not do that because it increases build times.

Instancing works fine on everything else, including on terrain that I add to regular build setting scenes. Why doesn't it work for the Terrain in addressable groups!?

I am using Unity 6000.0.24f1.

next inlet
#

I think I found the fix for this issue in case anyone stumbles across this problem. The material you are using the URP/Terrain/Lit shader with does not appear to be correctly configured by Unity when you enable Draw Instanced on the Terrain.

For this reason, I find it strange that it works correctly when building the Player and the terrain is inside a Build Player scene. I assume there must be some sort of scene processing code that detects that Draw Instanced is enabled and configures the material correctly, which doesn't happen when building Addressables.

To fix this, you can click on your terrain material and set the inspector to debug mode, then enable the Enable Instancing Variants setting:

#

If you are using the built in TerrainLit Material from the URP package, note that you won't be able to do this. You will need to create a new Material in your project that uses URP/Terrain/Lit.

mellow nymph
#

Hello, i think i might have ran into a bug. but i wanted to confirm first.
My editor crashes whenever i build adressables, after checking all the groups i found the infected scene, then after examining the all objects i fount out that the culprit is the PanelSettings asset of the ui document. without it everything builds just fine. with it in scene or in group it causes a crash. is it a bug?
also how are you guys using addressables with ui toolkit then?
the log is attached, thx

honest halo
mellow nymph
honest halo
mellow nymph
rigid shadow
#

Hey, is there a known issue with Addressables which causes sprite files to be loaded twice?

In the editor, everything works fine and my sprite asset that gets loaded by label is only treated as one file.

But in the final exported IL2CPP build, it looks like the same file is loaded TWICE. Is it possible that this is because it's type is 2D/Sprite, and Unity internally generates a "Sprite" class for it?

honest halo
rigid shadow
#

I am loading the assets in by label

#

If you think it's helpful, I can paste the code

#

This "3_whisper_wagon_logo" is the problematic asset, it's a .png file that is marked as 2D/Sprite (Single mode) in editor

#

This issue doesn't happen for the other .png file which is left as default (Texture)

honest halo
#

yea id be interested to see what this is coming from.
you can use the addressables profiler module to actually see whats loaded and how many users it has

#

requires the addressable build report and 2022+

rigid shadow
#

image on the left has the "arrow" next to it

#

that's what gets generated when you change pivot or something similar with the 2D Sprite Editor plugin

#

the image to the right doesn't have it and therefore doesn't have this problem

#

so when you expand it, there's technically "2" images:

honest halo
#

Yea, a sprite will always have either a single sprite inside it OR multiple. A texture is just itself, a texture.

rigid shadow
#

do you think this is an addressables bug?

#

especially since I can't reproduce it in editor

#

or maybe it has something to do with IL2CPP

honest halo
#

i dont know cus you havent shown what you are using to log this info

#

Sprites are technically sub assets of the main asset too. you access them usually by doing address[sub_asset_name]

#

if you check in the inspector it will show this sub asset address

rigid shadow
#

this is the entire code for the asset loader if you find it interesting

honest halo
#

you shouldnt need to do .Task.AsUniTask(), should be able to await it directly.
secondly, you should specify a merge mode when loading many asset locations (may solve this problem)

rigid shadow
#

how can I specify this merge mode?

honest halo
#

huh, I can await these and i use UniTask with addressables

#

it may be an extension method in another asmdef

rigid shadow
#

Yup, so found the issue. In editor, only one instance of this .png is loaded of type UnityEngine.Texture2D.

But, in the standalone build, there is an extra one with type UnityEngine.Sprite

#

I was hoping a Unity staff member might see this and explain what I'm missing

#

Still not sure how to fix this other than remove duplicates, or save them by type, idk

honest halo
#

If you use a merge mode to combine and specify Sprite as the type it should be fine...

main solar
#

I'm encountering a pretty weird issue; when I build for a certain profile, my Addressables come in at 1.76gb. If I switch profile, its 2.88gb, sometimes as much as 3.6gb. Nothing is different between these profiles, aside from their build and load paths, and even they are almost identical. Any thoughts?

next cairn
#

UnityEngine.AddressableAssets.InvalidKeyException: Exception of type 'UnityEngine.AddressableAssets.InvalidKeyException' was thrown. No Asset found with for Key=Academy. Burgundy. Key exists as Type=System.Object, which is not assignable from the requested Type=GarmentDesign.Fabric
So does this mean I need to modify the entry itself to be a different value type, or does it mean I need to change the retrieval operation to return a generic object, then use an as keyword to get the correct class type?

honest halo
#

then you can do if(thing is Sprite sprite) or whatever your asset types are

next cairn
#

GarmentDesign is just the namespace for the Fabric class

honest halo
#

what does Fabric inherit from?

next cairn
#

I know that's the type of the original object being saved, so it's not like I'm trying to return the wrong thing

honest halo
#

huh that is strange then. is monoscript enabled in the addressable settings?

next cairn
honest halo
#

helps will bullshit like this 😆

next cairn
#

well I'm building the addressables in one project, uploading to a server, then retrieving them remotely in a different project

#

keeps the repo size down by having two different repos

honest halo
#

set "MonoScript Bundle Naming Prefix" in settings to something to see if it helps. ive had issues before were certain monobehaviours failed to load

#

could be your classes are different in some way? how do you sync the scriptable object types?

#

id have a package as a git repo and build from the main project

next cairn
#

That might work but it'll be a pain in the arse, I'll try setting the monoscript stuff and see what that does first

#

thanks

honest halo
#

well im not sure how you are maintaining consistency with your types then atm

#

a package is the best bet, you can add a copy in Packages/ to make it editable

next cairn
#

I just copied the script from one project to another, and then deleted any code that was causing errors (obviously keeping the fields intact)

#

it worked before

#

I wonder if the meta class needs to be the same

#

or the asset filepath

honest halo
#

seems quite un reliable to me.
yea they do, the meta files for all cs scripts contain the GUID which is whats used

#

soo yea, use a package 😐

next cairn
#

huh so I just realised that when I build the addressables, it's not actually building new bundle files to match the catalog

next cairn
#

So I've set the build path to the following for my addressable group. When actually built the catalog file ends up here, but it generates two new folders to put the bundle files in. Any idea what's causing these new folders to be created?

Based on the folder names specific to this project, it must be something that was set up before I started working on this part of the project, but I've already checked everywhere I can think of for assigning build paths.

honest halo
fickle spade
#

Has anyone had trouble with addressables failing to load after LoadAssetAsync comes back successfully?

#

I've been putting together a nice general system for progress bars on downloading and loading operations, and deliberately bogged down the download process with a few extremely large image files

#

I'm using this pattern to launch the loading tasks:

public async Start() {
    AsyncOperationHandle<Texture2D> handle = Addressables.LoadAssetAsync<Texture2D>("mytexture");
    await handle.Task;
    // do stuff
}

and a separate coroutine that accepts the task as an argument for updating progress bars. The coroutines themselves do nothing except update progress bars (so they can be optional) so I don't think they're relevant here.

#

This works great for "normally sized" files, but I noticed the giant test images I introduced to slow the download process won't populate after the await the way small ones do. I've got a debug print in there confirming the operation has succeeded, but when I go to place the images, I get nothing the first time.

#

It happens that I also introduced an update heartbeat though, and that re-fires the load operations. It shouldn't, but I haven't disabled that part of it yet. The important thing there is when the heartbeat re-launches the load operations, the giant images load instantly.

#

The test images are like a quarter gig each so not exactly the sort of thing you would use in production, but it worries me that they aren't reliable.

teal mortar
#

the Task of a handle won't throw an exception if one happens, you'll have to check the Status or OperationException properties of the handle

fickle spade
#

apologies; that was an appreciated example because Unity had just hit me with a total system lock

#

I'll try and spare you Discord code formatting, but the deal is I've got an async function that wraps LoadAssetAsync so the results can be tracked for later release, among other things. Within that wrapper function, I run LoadAssetAsync, start the coroutine for monitoring its progress, and then await the AsyncOperationHandle.Task from LoadAssetAsync

#

Once the await is concluded, I test if the task has been completed successfully. If it has, I populate the addressable asset (in this case an image) and write some stuff to the console

#

That task does complete succesfully, and for reasonably sized images it will go on to populate them just fine. But for very large ones it will complete succesfully (debug printing from Task.IsCompletedSuccesfully), but the actual result will silently fail to populate

teal mortar
honest halo
next cairn
honest halo
strange shuttle
#

Hello, I have a question about cloud content delivery. Can anyone suggest alternatives to Unity Cloud for this purpose? I want to be able to update content (such as adding scenes, prefabs, etc.) so that users can download the addressable assets online and keep them updated. Thank you!

honest halo
real venture
# honest halo you can serve the assets from any web host such (e.g. aws s3)

On S3 you need to pay for storage ($0.023/gb) and for bandwidth ($0.09/GB after the first 100GB/month), and both are more expensive than going with CCD where the storage is free and we charge $0.08/GB for bandwidth after the first 50GB/month

https://unity.com/products/gaming-services/pricing
https://aws.amazon.com/s3/pricing/

Unity

Everything you need to launch, manage, and operate your game – at a fair price. Our products are designed to work for AAA studios, indie developers, and everyone in between.

honest halo
#

hey im just saying what ive worked with before 🤷‍♂️

real venture
#

Oh yeah, it's definitely a valid option

grim rain
#

I'm forwarding my question here in case somebody knows 🙂

honest halo
# grim rain

if its making web requests and getting 404 then the url must be incorrect

grim rain
honest halo
#

could be for security reasons that some files cannot be served but it 404's anyway to not reveal the file structure

grim rain
#

yeah possibly 🤔 ok thanks for your help!

#

Indeed, the same addressable settings but deployed to CCD seems to fix it 👍

honest halo
#

np, its confusing when the response code is 404 but its a common practice for this kind of stuff (e.g. private github repos)

wet steeple
#

This might be a potentially dumb question. Right now we are building our game with jenkins and that uploads the addressables to our cdn, after that they are downloaded to the client running on the devices. How can I do a local build that will not rely on having the addressables be uploaded to the cloud ?

honest halo
wet steeple
wet steeple
#

@honest halo sorry but I’m still confused would the addressables live on my pc or the phone ?

honest halo
#

Er be embedded in the build. Local would be the same and remote will also be local

wet steeple
#

So when building the addressables as part of the local build step I need to use the profile where remote and local point to the same thing right ?

indigo onyx
#

hey fellas, hope youre all doing good! I have a question related to LoadResourceLocationsAsync:

I am making my own wrapper class around the addressables system, and i am met with a problem where i dont know if what i want is possible. i have a Dictionary<object, object> where i store all the results from my load operations, meaning i cache the loaded assets to have better manipulation around them. My Dictionary<object, object> values are (key = either the runtimekey or assetreference, whatever i used to load the asset) and (value = the resulting object) I need to obtain all the results of a load operation when using a label, but that offers a problem where i do not have unique keys for each value. Is there any way i can use the label to target at the runtimekeys and use them to individually load the assets?

I took a look at LoadResourceLocationsAsync, and thought i could use the resulting list of locations to load the assets, but it results in multiple errors. If you guys need any more info let me know!

honest halo
indigo onyx
#

through rigorous testing i have found that addressables' internal caching is (not by much, but it is) slower that just me manually caching assets in a dictionary and just returning them. On top of this, since i have the object (as well as the handles) i can release the objects without making a big mess in whatever other project i work with that uses this wrapper. I do agree that it might be a bit overkill, but i have been able to increase performance with this implementation in every other case, its just the labels that offer this impediment i am at

novel basin
#

Whats the “right” way to use addressables? Meaning organizing and loading them

wet steeple
#

I’m still completely lost as to how fully embedded the addressables in my dev build

wet steeple
#

the code seems to be always be calling Addressables.LoadContentCatalogAsync but reading the docs this seems to be for additional cataogs, unless this is also used to override the main catalog

#

I'm just hella confused

wet steeple
#

Ok it seems the content is split into multiple catalogs I found the code that builds them. I’m trying to build them with a profile that has remote be the same as local and BuildRemoteCatalog to false

wet steeple
#

so unity builds local addressables to the Library folder and then it somehow knows to transfer them to the streaming assets folder when doing a buld. Is this assumption correct ?

honest halo
wet steeple
honest halo
#

I can only really confirm for android/ios but yea those always work in my experience. I presume for other platforms like win it will copy the assets to be where streaming assets work from 🤔

wet steeple
#

Ok cool, so now if I side step some logic in the client that pulls in remote catalogs it should just work

#

Since the catalog I build is around 22mb while the catalog in library from the CI is around 0.9 i presume mine holds all the assets and the additional remote catalogs are not needed

honest halo
#

Yea as long as the load path goes to the correct bundle its gonna work

wet steeple
#

The load path from the profile ?

honest halo
#

yea, whatever the active profile was when it was built

wet steeple
#

I created a new one where the remote paths are the same as the local paths

#

I believe in the prod profile the remote paths point to the cdn

honest halo
#

yea should be fine. id use a prod and dev profile too to seperate stuff and also an "editor" one that i used to make it all local (when i wanted to test using "existing bundles" and not upload anything)

formal arch
#

Hi everyone, I'm working on a bit of terrain generation and am loading in some game objects (like trees and such) to fill the terrain.
Right now I am currently reading the spawn requirement information and the gameobject through scriptable objects. These are then converted into a form to spawn and respawn based on whether the player is loading the specific chunks.

I was wondering, would it be better / more memory efficient for the prefab objects as the string address of the addressable, or just stick with the reference to the game object.
Would it be worth using addressables for this or not?

honest halo
#

If spawned a lot its probably better to fully load the prefab/asset in once then use that. Does mean however you need to not release it too early.

formal arch
#

Gotcha will do

honest halo
#

I suggest this so you can avoid the cost of "finding" the asset each time when really it only needs to be retrieved once. I'm sure its cached but it will be faster this way.
Im not sure if AssetReference<> will directly cache its asset but if so thats probably a good choice too.

formal arch
#

Would AsserRefernce be used for when I am directly referencing it with the GameObject prefab?

#

I'll do some reading into it, just want to make sure I understand what you mean. ^-^

unreal ibex
#

Help request:
I'm using addressables in a project where I have a group containing about 40,000 tile assets, and it's causing me serious load time issues - whilst all of the project's assets only take about 250mb on disk, a call to LoadAssetsAsync for all of the tile assets in that group takes 3-4 minutes and pushes the memory usage up to 5gb. (This is for the built project - in the editor things are much faster as I rely on AssetDatabase - I had to as addressables was causing my times to enter play mode to exceed a minute)

It seems that addressables simply can't handle that large an asset group very well. However for my use case it's by far the most convenient arrangement - I need all tile assets at all times (it's an open world 2d game), and in total they shouldn't take up that much memory anyway.

I've tried a few things like making the group uncompressed and turning on the UnityWebRequest option, but neither helped.

I'm considering just ditching addressables entirely for the old school Resources.Load approach, as it feels like it's doing more to get in my way than to add value.

Assuming I can't or don't want to change the way I'm managing tile assets, what options do I have to get addressables to play nice with this situation?

honest halo
unreal ibex
#

Seems to be a bit of an ongoing issue with addressables, I've seen forum discussions by others noticing LoadAssetsAsync being very slow. Not sure what it does under the hood to make it so.

honest halo
#

I'll never get over bundles being unable to ref assets in a build/resources

unreal ibex
#

It does all feel a bit clunky. Thankfully I only plan to release on PC so I'm not super stressed about fine grained control over assets, otherwise it could be quite the headache

honest halo
#

The fact that if you want to use addressables 100% that you need a scene to then load another scene is crazy.
It's half baked and not properly integrated into the engine core

unreal ibex
#

TBH all the new packages feel like that to some degree. The project's pretty dots/ECS based, and whilst that actually works pretty well and is a great package, you can still feel the friction between it and the old interfaces

#

Can't entirely blame them, it would be a ballsy and costly move to gut things to adapt to the new requirements

teal mortar
honest halo
#

They didnt clarify but 40K file open/closes could be an issue

unreal ibex
#

That said are there circumstances under which a single group would splinter into many bundles like that? And would they end up in the same file on disk? I could have been misreading the situation

#

(All I ever did was mark the root folder as addressable and give it a name, never tweaked much beyond that)

teal mortar
#

it's an option in the group's schema settings, if you aren't sure best double check what's in your output folder because 40,000 bundles would be bad lol

unreal ibex
#

Looks like they were set to pack together so unfortunately can't isolate it to that one.

honest halo
#

Then its either decompression or some dumb thing

unreal ibex
#

(Going to test it and see)

unreal ibex
#

Alright so the outcome is better but not optimal:

  • With uncompressed, pack together, CRC disabled, and use unity webrequest, it takes 15 seconds from launching the exe to seeing the window, and peaks at 2gb memory usage.
  • By contrast Resources.Load takes 3-5 seconds and peaks around 600mb.
  • The original addressables launch time without those settings was minutes and peaking at 5gb.
    (P.S. At the moment I'm immediately loading the assets on launch)
#

As a fun kicker using addressables roughly doubles the build time as well, from 3ish minutes to 6ish.

wet steeple
#

I'm trying to do content update builds in order to reduce iteration time, but the content update build takes roughly the same time as the full build. making a change in a prefab that is part of a group for example, does not show up in the Content Update tool, using this piece of code ``` string contentStatePath = Path.GetFullPath($"Assets/AddressableAssetsData/{EditorUserBuildSettings.activeBuildTarget}/addressables_content_state.bin");
AddressablesPlayerBuildResult result = ContentUpdateScript.BuildContentUpdate(addressableAssetSettings, contentStatePath);
if (!result.Error.IsNullOrEmpty())
{
Debug.LogError($"Failed to update Addressable Assets because {result.Error}");
}

    foreach (var t in result.AssetBundleBuildResults)
    {
        Debug.Log($"Successfully made bundle {t.InternalBundleName} at {t.FilePath}");
    }``` I'm calling the content update, the output of the build result is essentially every bundle in the project.
peak kraken
formal arch
#

Hi everyone, I'm using some code to draw a preview of a gameobject ion the inspector using DrawStaticPreview, to do so I need to breifly load in the object using its addressables key (this is what is serialised in my scriptable object to use at runtime).

My problem is that as I type the key i get errors as Addressables.LoadAssetAsync does not contain an object for the given partial part of the address key. This is to be expected, but I was wondering, is their a way to stop it throwing errors. Like a TryGet or a contains function within Addressables. That can be checked before loading the asset?

I could just use a try catch, but I would rather do this correctly then brute force it and just ignore the error.

#
AsyncOperationHandle<GameObject> operationHandle = Addressables.LoadAssetAsync<GameObject>(_addressablesKeyTextField.value);
if (operationHandle.WaitForCompletion() is not { } gameObject) return;

RegeneratePrefabPreview(gameObject, width, height); // This calls RenderStaticPreview

operationHandle.Release();
#

This is the code I am using. The error occurs on the Addressables.LoadAssetAsync line

#
string key = _addressablesKeyTextField.value;
    
AsyncOperationHandle<IList<IResourceLocation>> resourceLocationOperationHandle= Addressables.LoadResourceLocationsAsync(key);
if (resourceLocationOperationHandle.WaitForCompletion().Count > 0)
{
    AsyncOperationHandle<GameObject> operationHandle = Addressables.LoadAssetAsync<GameObject>(key);
    
    if (operationHandle.WaitForCompletion() is not { } gameObject) return;
    RenderStaticPreview(gameObject, width, height); // This calls RenderStaticPreview

    operationHandle.Release();
}
else
{
    ClearStaticPreview(); 
}
#

This seems to work!

lusty fox
#

Hello, im using asset bundles in my pc,xbox and ps builds. The problem occurs on xbox because of the file from streaming assets folder is not included in the final build what is weird considering the fact that its meta file is there. This happenes only on xbox tho

honest halo
lusty fox
#

Yeah

honest halo
# lusty fox Yeah

Do the bundles exist in Library\com.unity.addressables\aa\ + your platform after the build is complete?

frigid stag
lusty fox
#

so there was an asset called map and map.maifest in streaming assets

#

and this asset would only load on ps5,PC but on xbox it wasnt even there

#

like it was somehow erased during the build proces

#

soe we changed the name to map1 and then to our suprise it worked

#

but when we changed it back to map it was again gone

#

basically every oother name that isnt "map" works fine

#

no idea why this happenes only on xbox tho

#

we are using the og asset bundles and unity 2022.3.52f1

#

its like literally during copying the files into the build package, it was somehow removed along the way

strange shuttle
#

Hello everyone, I like to ask regarding addressable asset with unity cloud. I try to add skyboxes on level 1 scene but after I created release, I can't open my scene. Does anyone know how to resolve it? Do I have to delete level 1 scene bundle from bucket?

honest halo
strange shuttle
strange shuttle
#

I got 2 addressable scene. then I want to update first scene by adding skyboxes. after I change the skyboxes then I want to Update a previoud build without rebuild the app. Then upload the new server data to unity cloud content delivery. after I try open scene that I've updated with previous build I got error "Chain Operation Failed because dependent operation failed". I try it before on editor and the update it's changes. I already did toggle off the prevent update on Addressable Asset group.

slate timber
#

I appreciate any help

#

Addressable props have broken light/shader/colors/material/AO

#

This value is not missing though: Shader shader = mr.sharedMaterial.shader;

honest halo
slate timber
#

Ah yeah i forgot to mention this happens only in build

#

Editor and build respectively

#

I dont use baked lights

#

Everything is spawned runtime

honest halo
#

you can try using the frame debugger and if its URP the urp debugging shaders

honest halo
#

Usually its due to reflection probes not being used so they reflect a bright sky but other objects would do the same in this case 🤔

#

if your scene sky is black or a dark colour then this probably is not it. try to investigate with the 2 tools i mentioned

slate timber
#

It seems to be my camera script. After i disabled it, the editor and build look the same

#

Oh i change ambient light in that script
Well it wasnt ambient light it was the fog. Fog influences prefab-spawned props, but it doesnt influence addressable-spawned props, in build

slate timber
#

I think that fixed it

#

<>_<>

honest halo
#

Ah yea that sucks but a good reason why 99% of stuff should then be addressable

#

This would be solved if asset bundle -> in proj referencing worked but somehow no

elfin ermine
#

Hey y'all!
I'm currently in a situation where I would like to, at runtime, iterate over every environmental texture I use in my project, to change a setting in it.
Are there counter-indications to using addressables for this?
I'd have an asset group containing all environmental textures

honest halo
elfin ermine
#

So I'd be loading them all when I start the game once and then never unload them? Is this not going to have a performance impact?

honest halo
#

Addressables is better than normal unity and will unload assets when released with 0 users remaining

elfin ermine
#

Thank you very much for the info!

slow jolt
#

hi hi, i'm currently looking into porting a project to WebGL that is already on standalone platforms. i know there's no way to do WaitForLoad()s on webgl right now, but im looking for workarounds / how to integrate this without having a metric ton of work rewriting asset loading.

so far the easiest (and only) solution i've found is to rewrite loading functions to use coroutines instead of regular function calls. is that the only way to do this?

#

and also, will that actually fix the issue or would it cause other problems / still complain

peak kraken
#

looks like trying to load one asset bundle is also calling something for every asset bundle in our addressables build... is there a way to avoid that?

honest halo
slow jolt
honest halo
slow jolt
#

seems like awaitable is a fairly new API so i'm not entirely sure if it's just documentation hasn't been updated well or if it actually just wont work

teal mortar
honest halo
slow jolt
teal mortar
#

you should be able to write an equivalent extension method which just waits until the handle completes using Awaitable.NextFrameAsync afaik

slow jolt
#

that's true

teal mortar
#

tasks do work fine in webGL, it's just that some APIs touch threading stuff which doesn't work and it's hard to tell which ones that affects sometimes, but once you know it's totally safe

honest halo
#

Unity has its own custom scheduler for tasks anyway so it should work but trying to use other threads won't

teal mortar
#

it's stuff like you can use Task.Yield fine but Task.Delay will break, Awaitables is designed for Unity so it's clearer which ones actually involve separate threads

honest halo
#

Why a normal task was added for use was dumb. Classic unity moment taking too long to do it properly

#

This is why UniTask exists and is better

slow jolt
#

im looking to be more futureproof, seems like awaitable is probably the better choice here if it works for me, right? since that's the supported solution now

#

obviously hard to predict the future, just asking based on my initial judgement

honest halo
#

Tbh UniTask has more features and implements more features that Task provides such as UniTask.WhenAll()

slow jolt
#

maybe i dont even need either? i assumed i needed some wrapper but if it lets me get the underlying task, and i can await it, that should just work, i think

honest halo
#

no you want to avoid .net Tasks and use the other solutions as they prevent garbage creation as much as possible

#
public async UniTask LoadThing()
{
//UniTask extension lets us await directly!
  Sprite s = await Addressables.LoadAssetAsync<Sprite>("my[sprite]");
}
#

the take away is Task bad, Awaitable better and UniTask best (im my opinion)

teal mortar
#

or wait in a loop until it's done

#

the Task property doesn't really do anything that special

honest halo
#

its probably that the task completes using another thread or some shit

#

anyway i said enough just dont use .net Tasks

teal mortar
#

it might do but you don't care about that for webgl haha

slow jolt
#

though im curious now if that woujld work lol

teal mortar
slow jolt
#

oh i thought you were talking about without awaitable

#

yeah ill probably just do that

#

it's just gonna be a pain in the ass to propogate async/await up through this giant fucking call stack

teal mortar
#

yeah, iirc you can wait for some types of operations in a blocking fashion when they run on background threads, but in webgl that's not possible so it'll have to all be async

slow jolt
#

yeah which is tough because none of this code was written with that in mind

#

so it's all gonna be fake async anyways because the code is all just gonna await for it anyways

teal mortar
#

if you're awaiting it, it's not fake 😛

#

if you need to avoid making everything async, adding C# events can be a useful way to deal with async stuff from non-async code, letting you still write the complicated async bits as async then hook into them from outside

honest halo
#

The past 5+ projects ive worked on all use unitask with addressables and with our major systems converted its much nicer
its worth taking the step to integrate async more where it helps

#

And you can use .ContinueWith() to execute a delegate when a Task completes which means you dont need to await it:
e.g.
cs DoAsyncThing().ContinueWith(() => Debug.Log("Done!"));

slow jolt
#

yeah th emain issue is that the entire crux of this system is that everything boils down to a LoadAsset(...) which returns the asset. and internally it was doing WaitForCompletion, which works fine on non-webgl builds

so i either need to (a) turn the entire call stack async & await it or (b) rewrite the entire thing to use callbacks / delegates / events instead

#

because what i'm doing is so simple (in terms of async needs) i'll probably just do (A) with awaitables

honest halo
#

yea you should just convert things to be async or use the async operation .Completed event to then do stuff but tbh that will be more pain than async.
Either of these solutions work as they execute code in the future vs you making the main thread wait for the load to complete.

slow jolt
#

@honest halo does UniTask let you change from doing await task to yield return task in a doable way? it would SEVERELY reduce the number of changes i need to make, because i'm going to get to a coroutine far before i get to a unity event function

honest halo
slow jolt
#

i looked it up and it seems like theres a UniTask.ToCoroutine() which would be what i need

honest halo
#

oh yea and that, so it helps you go both ways

slow jolt
#

cause instead of needing to refactor until i reach an event function i can go until i get to a coroutine

honest halo
#

Yea makes sense. UniTask is just better (and existed before awaitable)

slow jolt
#

alright, i've now found out that since i'm resolving to coroutines, i can instead just do

while (!task.IsComplete)
    yield return null;

because that's what i actually need to avoid a huge rewrite, and avoids libraries alltogether (i think)

honest halo
#

yes that works, async awaiting will be technically better as we dont have to have something checking state every Update()

#

at this point do whatever 😆

slow jolt
#

yeah it would be better, the issue is that in order to do that i would need to rewrite our whole internal system for running stuff, since i would need to convert all of that to async as well until it propogates to a unity function

slow jolt
rocky folio
#

anyone able to get addressables to work on 6.0.45f? tried for days but it wont build them out for me

rocky folio
#

i always get this

honest halo
rocky folio
#

new build->default build script

#

missed a pretty important deadline because i cant build lol.

honest halo
rocky folio
#

nope

rocky folio
#

i do have aosme shader errors when i build but if i try again they go away, and the game built out fine a few versions of unity ago

rocky folio
#

which version of unity do u use @honest halo ? have u tried 6.0.45?

honest halo
rocky folio
#

looks like .47 is available now

#

yeh 2022 was stable and awesome

#

ill upgrade tonight but i guess it wont help, might end up going back a few versions

silver atlas
#

Hi, I have a small/big issue, when I move item/UI element over a empty space (there is no panel / UI element under it) it will leave afterimage like on the ss. I am working in Unity 6.0

rocky folio
#

wow my bundles are buidling finally, i just ticked and unticked tons of stuff for days lol

rocky folio
#

argh i still get errors in the build

#

Unable to open archive file: f0f4e673107fe35459efc8037aaed4ac/50a60aa227fdcf1ac7cba35abfb60fda.bundle
RemoteProviderException : Invalid path in AssetBundleProvider: 'f0f4e673107fe35459efc8037aaed4ac\50a60aa227fdcf1ac7cba35abfb60fda.bundle'.

rocky folio
#

damn, addressables really wrecking my life

#

invalid path in textDataProvider, then points to a json path that doesnt exist

rocky folio
#

got them built, no idea how, just random clicking 🙂

honest halo
#

If you are using source control can you check the group setting changes?

rocky folio
#

oh yeh, im not though

#

never got it to work with unity properly (and without huge cost)

#

i could diff them tho, i do zip every night

#

would be nice to host it in source control, but never works lol

honest halo
#

private git repos with github are free but lfs space is not fully free

rocky folio
#

yeh my projects are always huge...

honest halo
#

yea mine too but they are all on github

rocky folio
#

i already pay for github but i think its only £10/month

honest halo
rocky folio
#

haha

#

maybe i will try again but i can be sure it wont work for whatever reason

#

thanks for the file

honest halo
#

An average old work unity project

#

10GB of this is the Library folder (which we do not commit and the git ignore will already exclude)

rocky folio
#

hahai consider that a very small proj 🙂

#

but yeh its mostly waste in my pprojs, thousand sof assets that arent neccessarily in use

#

thats just 3 current projects sitting on my ssd 🙂

#

but yeh without lib folder much smaller, ill maybe try commit to github again,

#

think when u get too large u need to pay more

honest halo
#

Good lord, i work on mobile games so their size is naturally smaller.
if you are already paying or have a company acc then it shouldn't be an issue

rocky folio
#

nice, yeh i used to make mobile games for long time, long before unity even 🙂

#

we had to make them under 64k lolz

#

right now im trying pc/console

#

tho this build is dog slow, trying to profile it, runs faste rin editor

#

will github desktop be ok or do i need whatever unity uses these days?

#

hmm its slow in the editor actually, since the upgrade maybe

rocky folio
#

nice all builds now and runs faster, after degrading, thank god

rough narwhal
#

So what is the purpose of addressable API?

#

What is a real life use of it?

rocky folio
#

its supposedly better than using resources for many reasons you can read up on, though it is quite a nightmare imho.. BUT things like consoles wont let u publish without actually using it. i think the main rationale is that its far easier to patch game content this way, rather than resources where u need to replace the entire thing every time... so it makes patches for games smaller.. and i think its faster/easier to load things from wherever..

#

and delivery over the air for webgl is nice.. game can run and wait for the bundles to come down etc

#

tho i get confused between addressables and bundles 😉

honest halo
#

Addressables uses asset bundles by default for holding assets. It means then it has the fatal flaw of not being able to reference assets in the build.
And platforms like steam already handle diff patching on large assets well but the tech on consoles has never caught up somehow
e.g. fo76 update size differences

#

I presume it does help having many asset bundles and better control of how much assets are split up (and as you say, patching assets any time)

rough narwhal
#

How does that work

rocky folio
#

lol we just explained all that, time for u to google..

restive sparrow
#

Is there a way to enable the CustomPropertyDrawer in the BundleNamingStyle script that comes with the Addressable system package?

In my project's BundledAssetGroupSchema option for "Bundle Naming", my options are:

- Append Hash
- No Hash
- Only Hash
- File Name Hash

However in the Framework that I'm using as a reference for my project, despite being on the same Unity version and Addressables Package version as my project - they have these options instead:

- Filename
- Append Hash to Filename
- Use Hash of Asset Bundle
- Use Hash of Filename

I'm aware that they're technically corresponding to the same enum value, but I like the other one better since it provides more clarity

peak kraken
#

where is Send Profiler Events serialized? Or is this something that is only set in code? Where should we set it to ensure it's profiler events wont be sent in a build

hazy spruce
#

Hey everyone,

I have a scene that includes a terrain, and I've marked this scene as addressable. However, when I run the APK, the terrain shader doesn't appear (it's missing or turns pink).
Does anyone know why this is happening?

honest halo
#

older unity versions have a bug where 100% of shaders are stripped (even if used)

hazy spruce
honest halo
hazy spruce
honest halo
#

then you can inspect and see what its doing

hazy spruce
#

Yes I am testing with the same settings and working with the editor.

hazy spruce
honest halo
rocky folio
#

@honest halo haha yeh so tried git again, no where near usable to store my project as usual, not quite sure why people advise using it

honest halo
#

perhaps something like svn will work better if you have loads of large assets?

rocky folio
#

it just consumed 150 gig and filled the drive

#

ill stick to zipping and drop boxing every night

honest halo
#

to be fair, git lfs exists for this reason as at its core its made for text assets

rocky folio
#

yeh think someone needs to be invent something better

#

git has and always will suck

honest halo
#

svn, plastic scm (bought by unity to become unity svn)

Git is well respected and well used for source code management

#

like I JUST said its not good for tracking many big binary files hence lfs existing as an extension

rocky folio
#

yeh git kind of works for normal code projs for sure

#

i been in this since before CVS

#

at rockstar we used "sourcesafe" but i dont see it mentioned anymore

#

dc we used cvs was hell

#

git never been good for anything but text and small projs

honest halo
#

I used svn with large unreal projects so try that or go do some googling yourself

rocky folio
#

yeh my back ups are horribly clunky, but zero hassle

#

every single day im faced with this git argument

#

and after trying for like 20 yrs, never works

honest halo
#

Ha okay make a duplicate of everything everyday instead of a real solution 🔫

rocky folio
#

yep

#

only way iot works unfortunately

honest halo
#

t'was a joke

rocky folio
#

i know 😉

#

gits fine for code..

#

and thats it

#

wiped, that experiment wont take place again for another decade. maybe i can use a combo of ftp for files and git for code.

#

i will be retired before theres a working solution lol.

#

zip+dropbox, still good..

cerulean basalt
#

Hello, I have a question regarding addressables and Ui Toolkit. When I have data binding set in UI Builder to SOs that are addressable do I need to set binding to them again via code after I load them through code?

cerulean basalt
#

Answer that I found is: Yes.

fickle spade
#

Any reason why I might be able to load addressables by label in editor, but not in builds?

#

In this case we're talking local path addressables

honest halo
fickle spade
#

Are included in builds. What do you mean by out of data catalog?

honest halo
#

sorry, out of date 😆

fickle spade
#

ah, lol. This test is being run with a new build (and addressables build). I have a remote catalog floating around (you helped me a lot with that one, I'm sure you recall) but this specifically is being done with a local catalog

#

shouldn't be possible for a local group to be out of date, right?

honest halo
#

if remote catalog is disabled then im not sure how. this data is stored in there. asset bundles just have the assets in them

fickle spade
#

interesting

#

Have a theory that it's about how the label I'm trying to load from is getting passed to the loader

#

Hopefully I shall know for sure soon

fickle spade
#

Presently trying loading from a list rather than a label in case that's faster

#

The extreme slowness seems to be unique to playstation builds

floral flint
#

hi
I have a panel in Unity that I load and display using Addressables. Everything displays correctly in the Unity Editor, but when I build for Android, the Images appear completely black and the texts either turn pink or black.
My project uses URP in Unity 6.0.

wet steeple
#

Can someone explain how bundles work. Lets say I’m loading a ui prefab with a AssetReference. If all the ui is in a single bundle would everything be downloaded in order to Instantiate the single prefab ? Right now for example my UI group is set to pack separately but what I am trying to do is optimise the catalog size since that is a big chunk of our initial load time

#

Also if we load assets by asset reference I obviously do not need labels in catalog but what about include addresses ?

frigid stag
# wet steeple Can someone explain how bundles work. Lets say I’m loading a ui prefab with a As...

If you pack your UI into a single bundle and have the Asset Load Mode set to "All Packed Assets And Dependencies", it would load every asset in the pack and their dependencies.

If not, it will only load the given asset and their dependencies. However, you will not be able to release any asset loaded as long as one asset remained "used" in the bundle.

For download, I have no idea as I never used addressable in such context.

wet steeple
#

Pretty sure that when they are in the same bundle you have to download the whole bundle

#

I’m mainly looking into decreasing the catalog size

frigid stag
#

The first things I did was bundle scriptable object together. They were bundled seperatly for some reason.

honest halo
#

i have noticed scenes always get their own bundle

verbal harness
#

i agree Gaz git is not good version control, was partial to the pay content unity gave 8+ yrs ago.

#

i nearly wrote my own version control about 6yrs ago.

cyan holly
#

Hi I'm using the latest version of addressables. After loading the addressable into memory and storing the assetReference and the assetReferenceHandle. I attempt to spawn the asset using the assetReferenceHandle from another script. The thing is the assetReferenceHandle.IsValid() return false from that script.
The script that does the actual loading of the asset returns IsValid() true.

#

I'm definitely references the same assetReferenceHandle, but I've no clue why referencing it from another script returns isValid() False

#

I'm storing the AssetReferenceHandle in a scriptableobject.

#

Both scripts access / load the AssetReferenceHandle from that scriptbleobject

honest halo
cyan holly
honest halo
#

no the ACTUAL asset

#

so GameObject in this case

#

If you want to instantate it from AssetReference then do this, otherwise get the gameobject and instantate from this

cyan holly
#

Script A: LevelAssetsManager (This loads the asset into the scriptableobject above)

#

Script B: Weapon (This access that same scriptableobject above) and attempts to spawn the asset (bullet) that was loaded previously in Script A

teal mortar
cyan holly
#

The issue is Script A can access that asset Reference handle while Script B when it tries to access it, it says the handle is not loaded

honest halo
#

and if you use unitask you can await the load and ignore the async operation

teal mortar
honest halo
#

oh dear

cyan holly
#

Both ways doesn't work though

teal mortar
#

i'm just pointing that out because not waiting for the handle to complete seems like it could be related so best to rule that out by either fixing it or removing it!

cyan holly
#

Oh AND BTW

#

This issue only occurs in my Build version of the game

#

In Editor, both Script A and Script B can access the handle

#

So I'm really confused as to why the Windows Build is giving issue

#

AND 1 more thing

#

As shown in the above sample script, it is loading muiltiple assetReference in that list. NOT just the bullet. BUT only thaat bullet assetReference returns invalid from the weapon script.

#

The rest of the assets like the Player Prefab and Level Prefab assetReference works fine and they spawn into the game no issues in the Windows Build

teal mortar
#

are you sure both scripts are looking at the same instance of the SpawnableData?

cyan holly
#

I'm not sure why it is only that Bullet Prefab that is having the issue

teal mortar
#

in a build, if you have duplicates in your addressables setup, you might get duplicates from different bundles

#

you might be able to see that in editor if you turn on the Use Existing Bundles setting

cyan holly
teal mortar
#

it works on other platforms?

cyan holly
#

Oh nope, i don't have other platforms

#

It's just editor and windows build

teal mortar
#

well, in editor the default is to fake all the addressables loading and load straight from the editor asset database, so it doesn't behave the same

#

so it's probably worth testing with the existing bundles option

cyan holly
teal mortar
#

it's a dropdown in the groups window if you haven't used it before

#

it does require you to have run a build previously (files must still be in the library folder iirc)

cyan holly
#

Ok now the error is occurring in editor as well! I'm not sure why it is doing that since I'm referencing the bullet Scriptableobject.

The weapon script B is accessing the Bullet ScriptableObject from this Database scriptableobject

#

And than script A is referencing the Bullet scriptableobject from this scriptableobject Level 1 Asset

#

Both are pointing towards the same Bullet Scriptableobject which contains the assetReferenceHandle

teal mortar
#

are the level asset and the database asset in the same bundle?

cyan holly
#

Oh could that be the issue let me check

teal mortar
#

oh right no, level 1 isn't even addressable 😄 so that's probably it

#

you have a copy of "Bullet" baked into the base game, and one in the bundle that the database asset is in

#

so two different instances at runtime

cyan holly
teal mortar
#

scenes in the build list are baked into the game along with everything they have a hard reference to, so it sounds like you'd still get a duplicate that way, you'd need to make the reference to Level 1 an AssetReference too

#

there should be an analyze rule you can run in the Addressables anaylze window to point out any cases of this

#

(my project is a few versions of addressables back and they keep changing stuff so idk if it's still there lol)

cyan holly
cyan holly
cyan holly
teal mortar
#

just something extra you have to be thinking about all the time unfortunately...

honest halo
#

Due to the flaws of asset bundles you are basically forced to move everything to addressables

#

e.g. initial scene loads into an addressable scene as soon as possible and then addressables only!

cyan holly
cyan holly
honest halo
#

its just an example, projects I work on basically only use addressable scenes and assets

#

If you know when you can cause duplication then you can avoid it but its easy to do accidently

cyan holly
#

If i have more than 1 scene I'll definitely look into making those addressables. But then in this case do you include the scene in the build "scene list" if they are addressables?

honest halo
#

I personally think assetbundles are flawed that there is no way for them to reference into the build (but they can depend on other bundles?)

cyan holly
#

Btw I'm actually only using just 1 bundle for the entire game at the moment. Am I right to assume as long as I don't load the specific asset, it won't be loaded into memory?

#

Asset Bundles are only used to control the game storage size correct?

#

not to control the memory consumption of each level

honest halo
#

asset bundles are where the assets are stored, and they should support partial loading to not require opening the whole thing 🤔
Ofc splitting up groups and/or bundles helps with downloads

teal mortar
#

presumably meaning uncompressed ones can be loaded from disk as needed

cyan holly
#

This means that 1 assetbundle which I'm using and all the gameobjects in that assetbundle is always on the device memory

teal mortar
#

yeah potentially, although of course the compressed form of those assets in the bundle is still smaller than having them fully loaded as objects

cyan holly
#

Actually when I did some profiling, using Addressable alone (without loading/unloading the bundles) already reduced memory quite abit

teal mortar
#

it depends a lot on what kind of assets you've got, if you have lots of large textures or audio it might be worth putting those in bundles that can be unloaded as needed

cyan holly
teal mortar
#

the tradeoff is loading time because putting everything in separate bundles means lots of disk operations unloading and loading stuff

#

but using addressables does give you the choice at least 😄

honest halo
cyan holly
cyan holly
#

Do you mean if I release all assets from a specific bundle, addressables will automatically unload the bundle as well?

honest halo
#

Its better than normal as assets like textures will be unloaded sooner vs needing to call Resources.UnloadUnused

peak kraken
#

Question: what is the behaviour of "pack together by label" for addressables that dont have labels

peak kraken
#

Answer: all in the same bundle

north thistle
#

I have been stuck at this problem for a few days, please send help

honest halo
#

last post is saying its fixed soooo

north thistle
north thistle
#

How do you guys manage the addressables in your project ?

#

I'm new to this (and gamedev in general) so i searched around and whipped up this manager

#

can someone please give me a quick code review or just tell me if this direction is horrible from the start ?

#

Tysm

wet steeple
#

Does LoadContentCatalogAsync use gzip compression for downloading the catalog?

robust elbowBOT
north thistle
honest halo
#

I think making an "addressables manager" is a waste and will cause more problems down the line. If an asset needs to be loaded and used a lot then yes load and keep it somewhere, otherwise you dont want to "cache" an asset as we want to release stuff later and make use of auto unloading

#

If i have something that uses addressable assets, it usually handles loading + releasing per instance of as a whole depending on the situation (e.g. ui element view vs world/level manager)

wet steeple
honest halo
#

Binding to a game object is a good idea actually, should be added to addressables

rugged yoke
#

So I'm getting headaches with the player now that I'm using addressables. Everything works fine in the editor but the player build is getting hung on WaitForCompletion, which I call from Start() - I guess I should just not do that? But I don't want to have my scene loading be async, various code needing to wait for addressables to load before doing anything -- so now I'm about to make GameObject with a few public objects that I'll connect in the edtior, and then Unity will load them with the scene. And this won't work at all because at some point I want to load things by filename. I'm thinking I'll just go back to using Resources even though that's supposedly outdated - but at least it worked

rugged yoke
#

And I also looked at having a loading scene load in the addressable assets before the main scene, but I put those in static fields and were apparently set to null when a new scene loaded, even with DontDestroyOnLoad. So I'm confused if addressables is really supposed to be used for things all that widely

honest halo
untold jewel
#

So what is the real difference between AssetReference.LoadAsset... and AssetReference.Instantiate.... The docs don't really make it clear. The only difference I can think of is that LoadAsset loads it into memory but doesn't create, like in the case of ScriptableObjects?

teal mortar
#

yeah, imagine for example loading a bullet prefab ahead of time so you can instantiate it immediately later rather than using the async instantiate method

#

and of course LoadAsset is needed for anything that isn't a prefab as you said

untold jewel
#

Alright I think I get it, thanks. Trial and error ahead.

honest halo
untold jewel
#

Is it also an acceptable model to use Addressables with regards to certain aspects of the game? Like for instance, non UI stuff would just be normal assets where more game specific prefabs likes buildings, characters, etc would be addressables? Or is it intended to be a project-wholistic thing?

#

I have a pretty good UI system right now and using addressables would make it not so feasable.

honest halo
#

its fine but you have to be careful about asset duplication then as if its used in both addressable and non addressable things it will exist twice

#

Its why projects I work on are 100% addressable, intro scene loads into an addressable scene very quickly

untold jewel
#

well I would have something that is like an AssetManager that would be count references and release on scene offlloading and stuff

honest halo
#

addressables does this for you when you release assets (e.g. unload a texture)

untold jewel
#

oh I see what you are saying, addressable will create an instance of a non-addressable when used by an addressable.

#

So keeping to ScriptableObjects, if I LoadAsset on one, and that instance is used by several other game objects, would releasing the asset once cause null references in the game objects that had one?

#

I think I'm also realizing I will have to create an entry scene that loads the addressable entry scene...yeesh, good thing im early in the project lol

honest halo
#

This issue is a lot clearer when the texture or asset is used and you can see visually that it was unloaded (e.g. turns white/pink)

untold jewel
#

So in reality I shouldn't have to worry about AssetReferences if everything is an addressable ya?

honest halo
#

AssetReference is just a nicer way to load an addressable asset without giving the address so its no different

untold jewel
#

It's only when a non addressable needs to manage loading/creating of an addressable

honest halo
#

I dont want to confuse you. If you load an addressable asset, release only when its not used/needed anymore so the asset + dependencies dont unload at a bad time.
The profiler can show asset usage which can be useful to find times you forget to release something

untold jewel
#

And that's where I think I am confused. Everything in addressable space can still hold typical serializable references to other addressable without having to manage anything. It's when you get down to stuff like bullets or spawning that you need to manage using asset references. Otherwise, UI or scriptable object serializable references can be used the same?

honest halo
#

If I have an addressable prefab but in the prefab my script has public Texture2D myTex; then this is just treated as a dependency. This gets loaded in memory when my addressable prefab is loaded. AssetReference is not a hard dependency as is basically the same as doing LoadAssetAsync()

brittle galleon
#

hey guys, does anyone have any documentations or example codes or projects for unity google play asset delivery on demand ? i am already using install time delivery type but i want to change some of the delivery types of certain things to on demand so the initial download size is lower. i probably should have a button and when they press it it should bring up a loading bar that shows the download go up, is it something like this ? m_SceneHandle = Addressables.DownloadDependenciesAsync("Assets/Scenes/exampleScene"); and i link the m_SceneHandle with a slider that shows the progress and when its done i load it using : Addressables.LoadSceneAsync("Assets/Scenes/exampleScene"); ?

brittle galleon
#

hey guys, i have a question about on demand play asset delivery, i am trying to use it but when i install the application from the playstore it just starts downloading the on deman assets immediatly and whenever i try to check if its downloaded or not even if i cancel the download of the on deman assets it tells me that its downloaded, i am using this method to check if its downloaded or not: long downloadSize = await Addressables.GetDownloadSizeAsync("Example").Task; and it always returns 0, what should i do ?

north thistle
#

Is it normal to just...not use labels at all?

#

I haven't found a need to bulk load assets yet

#

Since most of my code up to now only deal with singular asset

#

Can I just group the assets in a smart way and load them by address for the full project?

#

Chatgpt says yes but I don't trust it

#

(I'm using Haruma K's Addler)

honest halo
# north thistle Is it normal to just...not use labels at all?

I can give an example of when i used tags. I gave assets used by a certain level a tag so I could prompt the download size required and then also pre download them all at once. Instead of configuring a list of addresses using a configued tag is simpler.

north thistle
#

How do the subsequent loads work then? I find it difficult to find a singular asset with just labels

#

I'm new, I'm genuinely asking UnityChanwow

north thistle
honest halo
north thistle
#

the address of the highlighted asset would be CGs/Scene_Prologue/Base/Back ?

teal mortar
#

is that just missing the file extension?

north thistle
#

i set the type as gameobject when searching already

teal mortar
#

you can see it in the screenshot

north thistle
#

im new to this

teal mortar
#

if you mark the assets individually you can put in whatever you want there

north thistle
#

so if i dont mark them individually i must include the extension ?

#

the group name is also included in the address right ?

teal mortar
#

no, addresses are per asset only

#

you're marking the folder right now, which means they only have automatic addresses

#

if you don't want to type in specific addresses for everything, consider using AssetReference properties instead of loading by string keys

#

then it's just referenced by GUID and you don't need to care about the key

north thistle
#

AssetReference, from my very limited pool of knowledge, is just like a serializefield?

#

or is there any other way to use it ?

teal mortar
#

yes, make a field of that type and in the inspector it becomes an object picker for addressable assets

#

internally it just stores the GUID

north thistle
#

my code requires me to work with strings to dynamically load it XD

#

so to sum up

honest halo
#

Assets in a folder thats addressable annoyingly get the file extension in their address. You do need to include it as that is its address

#

ofc you can override this and give it any address you want

north thistle
#

the address is this line right ?

honest halo
#

ALL of that is yes

north thistle
#

thanks !

honest halo
#

its address is Scene_prologue/Base/Back.prefab

north thistle
#

the group name doesnt matter at all right ?

honest halo
#

nope does nothing

north thistle
#

unless my packing strat uses group ?

honest halo
#

still no. The address is not affected by the group (unless you disable including addresses in the group)

north thistle
#

no i mean group only matters when you use the pack by group?

teal mortar
#

the packing mode affects bundle filenames, but one of the big features of addressables is game code generally doesn't need to care about the bundle files, it handles that for you

honest halo
#

Ah well yes its group will specify what asset bundle it goes in and how its loaded (local or remote)

#

Yea addressables handles finding and loading the file for you which is what makes it soo great

north thistle
#

so i kinda need to repeat the CGs to get it in ?

honest halo
#

you can simplify the folder address so it makes the paths of stuff inside shorter too

#

R click -> Simplify address

#

or change to whatever you want

north thistle
#

should i even categorize them by file type like that ?

honest halo
#

dunno its up to you

#

Games I work on usually has configuration for things and i add addresses for stuff in that (so it requires no special format)

north thistle
#

thanks again

final sorrel
#

Is there a way to have it so that the hashes added to the filenames of the outputted bundles stay consistent between two different machines that build?

brittle galleon
#

hey guys, does anyone have any example codes or documentation for addressables for android google play asset delivery on demand delivery mode ? or if anyone have worked with it before i need some help

honest halo
final sorrel
honest halo
#

Remote no but you may need to disable CRC checks for local ones as the hash will change in catalogues built elsewhere sometimes

wet steeple
#

How do I explain to addressables to load my custom ResourceProvider ?

#

It’s from the schema nevermind

raw seal
#

How do I address more than one prefab with a tag or layer? I have approximately 150 prefabs and I need to be able to instantiate enemies inside these 150 randomly (I'm not gonna instantiate all of them at the same time)

#

Here is my current code

#

I have given "enemy" tag to all of my prefabs

#

However the first Debug gives me 0 as an output

honest halo
# raw seal Here is my current code

Set the merge mode to Union and check the label is correct. Im confused why you put the locations into a list of object (probably going to make things worse)

#

It should give a List of IResourceLocation and these can be used to load the assets later

#

lastly, making a list copy is wasteful and not needed

wet steeple
#

Ok I’m failing hard on this. I want to encrypt and decrypt the default local group bundle. It’s set to pack together so there is only one bundle to handle. The encryption/decryption works fine in my custom provider that extends ResourceProviderBasr but when I complete the ProvideHandle with the asset bundle I got from AssetBundle.LoadFromMemeryAsync it says it can not load the dependant bundle for the Cube.prefab that’s in the default local group. The group itself has two items a cube prefab and a material for it. It also pulls in some urp shaders.

sinful siren
#

hi

#

where can I find the addressables build report?

#

how is it called?

#

which gets generated near the build

sinful siren
honest halo
#

you should be able to see groups and infer bundles from that

#

You can also add debug code to print loaded asset bundles but depending on group settings their names may be un readable

sinful siren
#

I can only see 22 assetbundles are loaded

#

86 assets

#

1 catalog

#

and that's all

sinful siren
#

so I guess I should just unload every assetbundles

honest halo
#

my final advice is dont unload bundles handled by addressables or you will probably break many things...

#

addressables will do this itself if you release things correctly

sinful siren
honest halo
# sinful siren okay, and how to "release things correctly"?

If you load anything with LoadAssetAsync(), it needs to be released when you are done with it.
If you use InstantiateAsync() then you need to use ReleaseInstance() when done with it (or when it will be destroyed)

If you forget to do this then the asset and its dependencies will never be unloaded as it still has users.

https://docs.unity3d.com/Packages/com.unity.addressables@2.5/api/UnityEngine.AddressableAssets.Addressables.Release.html
https://docs.unity3d.com/Packages/com.unity.addressables@2.5/api/UnityEngine.AddressableAssets.Addressables.ReleaseInstance.html

sinful siren
honest halo
honest halo
#

What unity version is this?

sinful siren
honest halo
#

When this works properly for me I see info about what is loaded at the bottom correctly
I presume its broken cus the report is wrong or it doesnt work fully on a build

#

try in editor with existing bundles (change platform to your desktop platform) to see if that gives the correct detail

sinful siren
#

experimental profiler module

#

I could install a newer unity, but then that would take a whole day, and I wouldn't be able to make a build to NDA platforms anyway

#

because that would take like a week at least to install every necessary stuff for that

north thistle
#

it says this char01 assetReference is invalid

#

i cant figure out why

#

i only ticked the addressable checkbox and its supposed to be done ?

#
        {
            if (assetReference == null || !assetReference.IsValid())
            {
                Debug.LogError("Invalid AssetReference provided.");
                return null;
            }
            var handle = assetReference.LoadAssetAsync<GameObject>();
            await handle.Task;
            if (handle.Status != AsyncOperationStatus.Succeeded) return null;

            var prefab = handle.Result;
            var instance = Instantiate(prefab);
            handle.BindTo(instance);
            return instance;
        }```
honest halo
#

you can also get the runtime key to help with debugging

#

btw its possible for an asset to no longer be addressable but still be in the asset reference

north thistle
#

AssetReference: [e18510a9eeb760e4583a435e068f9ec2]Char01 (UnityEngine.GameObject), RuntimeKey: e18510a9eeb760e4583a435e068f9ec2

#

it logged this out

honest halo
#

used a debugger?

north thistle
#

yeah, just debug.log

honest halo
#

haha no

#

a debugger with your IDE

north thistle
#

oh, thanks !

north thistle
honest halo
#

maybe before trying to use the asset reference? If you use a debugger you can inspect the object and view these things

north thistle
#

ah i thought you mean theres a button for that

north thistle
#

what are the common reasons for this ?

honest halo
#

is it actually addressable still? clear and re set the asset reference in inspector

#

it wont remove it if it isnt anymore its dumb

sinful siren
#

@honest halo should I rebuild addressables to make profiler work?

#

play mode script was in "use asset database (fastest)"

north thistle
#

even dragged straight from the addressable window

honest halo
#

then it actually uses those bundles you just built (and report)

honest halo
# north thistle i re set it

yea i dont really get what im seeing tbh. I dont know why its invalid for you but you must be doing something funky with it

north thistle
#

have cases like this happened before ?

honest halo
#

😆 not to me

north thistle
#

am i supposed to make the SO addressable too ?

honest halo
#

you can use InstantiateAsync() from asset reference btw, you dont have to load the gameobject then instantiate

honest halo
#

asset reference just keeps the address and uses that to load for you so there is no direct dependency

north thistle
#

ill try loading directly

north thistle
#

okay it works perfectly fine if i just instantiate the prefab directly

#

F me

#

WHAT IS THIS

#

the other addressables load just fine

sinful siren
#

but if I set the addressables window to "use existing build", then I can't build the addressables

honest halo
#

that setting should not change how they get built in any way

sinful siren
#

in this context

honest halo
#

addressable building is not related to the addressable editor mode

#

did you get an error? compile error?

sinful siren
#

when I tried to build addressables with that "use existing build" setting enabled, I got errors, yeah

#

@honest halo

honest halo
#

thats nice, if only i could see them

honest halo
#

It needs to compile scripts for the platform, is something breaking that?

#

whats the stack for the first error

sinful siren
#

InvalidOperationException: Unable to build with the current configuration, please check the Build Settings.
UnityEditor.GenericMenu:CatchMenu(Object, String[], Int32)

#

this is all

#

second and third is also the same

honest halo
#

what platform is currently active? win?

sinful siren
#

win

#

PC

#

fun thing is that on this computer (my home notebook, not the workplace machine) I can't even find the Addressable Profiler

#

same Unity version though

#

2022.3.61f1

honest halo
#

Its not getting far enough to make it it seems

teal mortar
#

you may or may not get some more details if you open the full log file

honest halo
#

good idea, something is wrong meaning it cannot get far enough

sinful siren
#

I mean we should also somehow magically make the Addressables profiler appear on this computer

honest halo
#

are you sure your home pc is setup to build this project?

sinful siren
#

because somehow its missing from here

sinful siren
#

but anyway

#

I have never selected that addressable build option yet

#

I always made addressable builds differently

#

with selecting the top option

#

the fastest

honest halo
#

that is changing how the editor handles addressables, not related to building them

sinful siren
#

"use asset database (fastest)"

#

I always made builds with that

honest halo
#

read what i said

sinful siren
#

I read that

#

but building with that always worked

teal mortar
#

it doesn't affect builds at all lol

honest halo
#

that affects the EDITOR ONLY and does nothing to builds

#

fuckin hell

sinful siren
#

then how is that addressable building always worked with that?

teal mortar
#

you probably have the setting turned on to do addressable build automatically when you build

honest halo
sinful siren
#

and deadlines are coming

honest halo
#

If you have not set up anything to release then its gonna suck adding it all in later but its the solution to reduce memory load

teal mortar
#

a bit of reading the docs up front can save a lot of time later 😉

sinful siren
#

I can't make build, because Perforce is locking everything even outside of the project folder

#

even the log files make io exceptions

#

Work offline is active in Unity though...

#

somehow Perforce behaves well, when I'm connecting to it

#

but currently I can't connect to that

sinful siren
#

the Unity 2022.3.61f1 apparently using an experimental profiler

#

and I think I won't be able to see the addressable asset bundles loaded

honest halo
#

I have used the profiler correctly in 2022 but i usually only do it in edit mode with existing bundles

#

it does work and can be used to track things you forgot to release

#

Try to figure out why it cant build. Sometimes addressable builds fail with no clear error because you have an asset in multiple groups by accident or some other odd problem.

#

If you can, update to the latest 2022.3 editor ver

#

e.g im on 2022.3.51

sinful siren
#

I mean the module

#

because for me its invisible now

honest halo
#

yea it works for me, did you hide it by mistake?

sinful siren
teal mortar
#

if you're on an old enough version there's a separate addressables profiling window in the addressables menu, the profiler module is new

#

no idea what version of addressables was used in 2022 though

#

i did prefer the old window though lol

honest halo
#

2022 has the profiler module

sinful siren
#

this is all I can see

#

and "asset loading" is not the addressables stuff

#

I'm going crazy

sinful siren
teal mortar
#

it was somewhere under window>asset management>addressables

sinful siren
teal mortar
#

yes, but that's the submenu it was in

sinful siren
#

I thought you know the old profiler

teal mortar
#

there's like 5 things in there, it was one of those

sinful siren
#

well, if its there, its renamed to something chinese I bet

#

because its not straightforward where is it

teal mortar
#

okay well i googled it for you lol, it was called the event viewer and if it's not there i guess it's gone in whatever version you're on

sinful siren
#

ohhhh

#

so there's a package called "profiling core"

#

nice

#

I tried to check for profiler million times

honest halo
#

how tf was that even gone

#

A small demo of what you should see when it works:

#

you can see it shows the group, the bundle name and the actual asset and its active handles

sinful siren
#

cool

#

now I figured out I didn't have IL2CPP installed

#

so now addressable bundles gets building

#

I afraid this struggle will be for nothing, since I should sleep in 1 hour

honest halo
#

Ahh nice catch. That example above was just me changing to windows platform, building bundles, "Use existing build" setting and entering play mode.

sinful siren
teal mortar
#

GC won't release them for you

sinful siren
#

cool

sinful siren
#

after the handle.complete got called?

teal mortar
#

when you don't need the asset any more usually

sinful siren
#

we are talking about multiple thousand textures

teal mortar
#

well it's reference counted, so if it's easier you can let every user of it call LoadAssetAsync and Release individually and Addressables will only free it when the last one releases

sinful siren
#

way

#

because release is not get called

honest halo
#

I use UniTask with addressables and release the loaded asset instead

teal mortar
#

yes, you can release either the handle or the asset itself, Addressables keeps track of both

sinful siren
#

so I will centralize the addressable asset loading and handle releasing

teal mortar
#

as long as you do it somehow

sinful siren
#

because otherwise not all of them will be released correctly

honest halo
#

If you remember this requirement in future you can keep it in mind. If a component loads an sprite or texture to show then it can release OnDestroy for example

sinful siren
#

@teal mortar so somehow I can't see addressable bundle names in the profiler again...

#

but I can see that the count has been decreased

#

but the texture memory was not released

honest halo
#

Releasing things correctly will then allow textures to unload

sinful siren
honest halo
#

Whoever is in charge then needs to be told this is the fix for memory issues

sinful siren
#

because this needs for me more

sinful siren
#

even for the Unity 6

#

like 1 out of 10 times it shows me the addressable bundles

#

all other times it doesn't

#

and I have zero idea why

honest halo
#

it is experimental but its been reliable for me and ive used it quite a few times

sinful siren
#

sometimes it shows me zero addressable bundles, sometimes it shows me 3, and very rarely it also prints their names

sinful siren
#

I guess

honest halo
#

but if you only use it in editor that no longer matters (unless there are platform only settings or changes to addressalbe groups i am not aware of)

sinful siren
#

I have no time to convert the whole project back and forth between PC and NDA platforms

#

because it takes 2 hours until it finishes

#

with the conversion

#

and for the NDA platforms, the editor doesn't work, I can't play the game in editor

#

only for PC

#

why, I don't know

honest halo
#

it should only be slow on the first platform switch and after it should be faster

sinful siren
#

it crashes out

#

and I have no time to figure out what makes it crash the whole editor while I use NDA platform

sinful siren
#

to the project

honest halo
#

Do you not have resources or help within your team if its updated soo much?

sinful siren
#

I could solve this on my own as well, if I would be able to see the addressable bundles

#

but I can't see it

honest halo
#

at this point no one here can help you anymore, i told you already a method i use to do this profiling in editor

sinful siren
#

in the morning the profiler worked

#

since then it doesn't

honest halo
#

goodluck

sinful siren
#

the profiler I mean

#

I did nothing, I just restarted the profiling and the unity editor and the build a few times

#

@honest halo is unitybuiltinshaders some kind of basic addressable bundle, which can't be disabled?

#

or released or whatever

honest halo
#

you dont need to ping me anymore i dont have anything else to add
yes its auto managed by addressables so its not something you can manage

sinful siren
#

then you had things to add....

honest halo
#

the solution is to release things properly, thats it

#

plz dont ping me more

sinful siren
#

-.-

sinful siren
#

can someone check this pls?

#

what you can see is that I unload some addressable bundles

#

and I have less than before