#📦┃addressables

1 messages · Page 6 of 1

sinful siren
#

but the texture memory doesn't get decreased

#

so the measurement left area is "in main menu, before gameplay"

#

right area is "in main menu, after gameplay"

#

texture memory is leaking, but I have actually less addressable bundles than before

#

any idea what can cause this?

north thistle
#

Maybe this is late but you can use Haruma K's addler

#

automate the process

#

It's been super helpful to me

sinful siren
north thistle
sinful siren
#

I gave up this task for now, because it took me a whole week to figure out basically nothing

#

"based on the two profilers, there are unexisting assetbundles referring to some textures (addressable asset profiler doesn't show me those at all, memory profiler still referring to some weird blablah named addressable bundles)

  • there are other references as well
    like memory profiler tells me that there are gameobjects actively holding those materials inside ParticleSystemRenderers
    but I manually cleared those, nullified those materials, called Resources.UnloadUnusedAssets, and still nothing was freed up"
slate timber
#

I've run into a problem for which I'm searching for solutions for days now, and I hope you guys know one. I have a LoadableScriptableObject type, and the goal is to run a Load() method on each of them on game startup using addressables. For this, I marked every single one with a LoadableSO tag, and run LoadAssetsAsync to handle the loading, and this works so far. The problems is that these Scriptable Objects are sometimes nested under other scriptable objects, and the nested ones dont load. I need a way to make the nested assets unique addressables, or at least when loading a root object, checking each of its sub object if they match the type as well, but I didnt figure out so far how can you load a sub asset of an addressable.

slate timber
#

From this image, I want to call a Load() method on all 4 of the assets individualy.

teal mortar
slate timber
honest halo
#

Sub assets don't always work well so perhaps not doing this is also a solution

slate timber
#

So, long version:
I work on a Unity framework.
I have an entirely separate system, that makes it so that you can mark scriptable objects with an [AssetExtension(typeof(T))] attribute and it will make it so that any time you crate an instance of T, it automaticaly creates an instance of the class with the attribute nested under it. Furthermore, I have a custom inspector that merges their inspectors into one, so when you inspect the main object, you see all of the nested object's fields as if they were part of the original script. This is visual only, the modified data is still stored in the scriptable object that declares it, and from a scripting view they behave like two entirely different object, it's just there to make the project less cluttered, and the values easier to find by being in a centralized place, so in short, to make the designer's life easier. This is very handy for creating config files for example, where you can install or remove modules and the config fields change accordingly. Because it is made so other packages can 'modify' each other non-invasevely, and because there isn't any code relation between them, I don't know anything about their type, structure, count, and things like that.

honest halo
slate timber
#

Thank you, I'll try it out

peak kraken
#

getting lots of memory overhead from strings referenced by UnityEngine.AddressableAssets.ResourceLocators.ContentCatalogData.ResourcesLocator , is there any way to reduce that?

peak kraken
#

Hmm maybe it’s because loading location data and not unloading it

peak kraken
#

No, still so much data

trail river
#

Anyone know how to preload scenes with Addressables.LoadSceneAsync(..., activateOnLoad: false) without running into the problem (mentioned in the docs) that unloading another scene is blocked now until all scenes are activated?

#

Like, can I unload with a higher priority and still keep the preloaded scenes not activated?

honest halo
trail river
honest halo
#

hopefully you can delay initializing components yourself or something similar. Shame we don't get the same control as you get in unreal when spawning in scene content 😦

drowsy yew
#

still hate how its almost impossible to access scene objects before they get awoken

peak kraken
#

question: is some duplication as assetbundles fine if it reduces complex dependencies between assets in bundles, thus reducing the size of the preload tables

teal mortar
#

it's not inherently evil, but of course it increases build/download size and can cause some weird issues due to multiple copies of the same asset being loaded

peak kraken
#

Hmm yeah that’s worrying, it would increase runtime memory usage too right, because of multiple copies of the same asset loaded

teal mortar
#

yeah, usually you'd want this only if you knew the two versions wouldn't be loaded at once

#

for example, bundles for two different levels that share a few assets

peak kraken
#

thank you

#

Does anyone know how one would get the asset bundle dependencies of an AssetBundle generated by addressables? AssetDatabase.GetAssetBundleDependencies doesnt seem to work (running it in a BundleRule)

honest halo
#

i forget if its just group or the actual bundles

peak kraken
honest halo
#

at runtime this isnt going to fly so id then suggest parsing the data from a build report and then store it somewhere for use

#

but ofc with addressables the point is to not think about asset bundles anymore

peak kraken
#

hmm yeah we're just having some issues with loadig times so im hpeing this will help. (And yes that is the plan, storing that text file and including it in the build)

honest halo
#

You can add tags to things you want to make sure can be loaded early and do a pre download with that tag

#

then you can be sure they do not require a download to be used later

#

same for "loading" but may not be great as you would need to release things not needed

peak kraken
#

all our addressables are local so this would be purely for load time performance

honest halo
#

then maybe tags to load important things early will work but make sure they are released later

peak kraken
#

Is there a way to control how spearate asset bundles are packed together on disk? Ive heard that loading is faster on hdd if data is closer together

honest halo
#

you can control if 2 bundles (all assets and all scenes) are made or one for each label or one for each asset.
how the files are stored on disk is up to the OS and platform

peak kraken
#

dang, thanks

#

word of warning to everyone: try to architect your project with addressables in mind from the beginning rather than adding them after

#

otherwise you run into lots of trouble

zenith verge
#

@honest halo hmm i I don't see anything in the reference to and reference by section.\

honest halo
#

check the group itself

#

because if the asset bundle its in has a dep, it will need to get that dependency

#

If you split things into more groups or have groups split in to more asset bundles it will help but identifying the rogue dependency is probably best.

honest halo
honest halo
#

Its the group + bundle thats the problem, if an asset in that same group has a dependency to a remote group, then the whole group/bundle does

#

It sucks but making more smaller groups OR changing the bundle mode to be split by label can help as there will then be more bundles and less chance for a bad dep to affect you

honest halo
#

You can also write some editor code to get an assets dependencies and also check the groups of those dependencies (if addressable)

AddressableAssetSettings settings = AddressableAssetSettingsDefaultObject.Settings;
string assetPath = AssetDatabase.GetAssetPath(asset);
string[] dependencies = AssetDatabase.GetDependencies(assetPath, true);
foreach (var dependency in dependencies)
{
    var depEntry = settings.FindAssetEntry(AssetDatabase.AssetPathToGUID(dependency), true);
    if (depEntry != null)
    {
        //Do thing
    }
}
#

On a past game I wrote quite a few things to help me detect bad group dependencies automatically

zenith verge
honest halo
#

e.g. find group, get all entries, loop over them all and collect their dependant groups in a HashSet and Log at end.

jolly hatch
#

Hey hey everyone, does anyone konw what the recommended approach is in regards to addressables generated files and source control?

#

I was expecting to see some documentation about this on the package website or at least in the Unity manual but I can't seem to find anything.

#

My gut would say to not include them, but after working with addressables it looks like this might be an issue later on if I don't.

peak kraken
#

Like the files that define the asset group?

warm meteor
#

Okay, this is annoying

#
using UnityEngine;

namespace TRV.ScriptableObjects
{
    [CreateAssetMenu(fileName = "PoolConfig", menuName = "Scriptable Objects/PoolConfig")]
    public class PoolConfig : ScriptableObject
    {
        public PoolType poolType;
        public GameObject prefab;
        public int initialCapacity = 10;
        public int maxCapacity = 100;
    }
}```
#

if it is marked as addressable and pushed into CCD then prefab and poolType(Scriptable Object) will be null in build if both are not marked as Addressable?

#

In editor it works fine but in android build it doesnt work

honest halo
#

If something else happens then it's bugged or something else is wrong

warm meteor
#

It's because I have been comparing two SO (PoolTypes) and in build it doesn't work

#

But thanks for the help

honest halo
#

Should they be the same asset these two you compare?

vague karma
#

I started to yelling about why Addressables tried to solve various problems into one at the moment...

warm meteor
honest halo
#

If they should be the same but are not, make sure the asset is marked as addressable so its not duplicated in multiple asset bundles.

#

use the analysis tool to find + fix duplicates easier

proven nacelle
#

anyone know about this

honest halo
proven nacelle
#

🤓

formal spear
#

Hi everyone, im getting a problem with build size.
My project using Addressable.
Last build, size is fine (~50mb), but now size increased too large (~100mb). Although i just changed and added some scripts, and i deleted some files unused.
Anyone can help me, pls? 😰

#

here is my newest build report

Uncompressed usage by category (Percentages based on user generated assets only):
Textures               17.3 mb     51.2% 
Meshes                 655.5 kb     1.9% 
Animations             1.5 mb     4.4% 
Sounds                 1.5 mb     4.5% 
Shaders                4.8 mb     14.3% 
Other Assets           7.5 mb     22.3% 
Levels                 0.0 kb     0.0% 
File headers           185.9 kb     0.5% 
Total User Assets      33.8 mb     100.0% 
Complete build size    1.2 gb```
steady mica
#

Hello, so I was wondering if unity addressables had an auto group/reference feature, for example I have this scriptable object that references every main thing, it references assets and scriptable object, references prefabs and scenes without having to manually put them in a group?

teal mortar
steady mica
novel basin
#

How do y’all manage the addressables organization since they dont keep directory metadata

tulip dagger
#

Did any one using "Addressables for Android". When I uploaded the .aab to play store, It shows the update size smaller. But when I update it on the device it download the entire game again. Any Idea?
Tested with internal test build.

frail axle
#

It has been 5 years or more, and Unity hasn't implemented a simple multi-drag functionality for asset references. I even tried creating an editor script to add all of my asset references to a list like with other non addressable assets I have, but it is impossible to do. I guess I will either have to add a whole 1110 assets to my asset reference list one by one or just move away from addressables altogether until some other time.

honest halo
frail axle
frail axle
# honest halo You could use tags instead but I also don't see why setting the asset ref in edi...

Ok so it worked. It is crazy to me that there is no answer to this issue anywhere, even though so many people have asked about it. How I got it to work was that I noticed that when after I created a new asset reference for my Item class, I noticed that the base functions use a Guid. So I figured, if I could get my item Guid, this should solve my problem. I used the AssetDatabase.GetAssetPath to get the path for my asset, then used AssetDatabase.PathToGuid to get the guid from the asset at that path, and then create a new asset reference, gave it the guid, and added it to my asset reference list

honest halo
#

you do have to be careful as both methods allow non addressable assets to be used without an exception

frail axle
#

Oh, that one is better. Maybe a check to see if it is a valid addressable asset would help to stop non addressable assets from being added

lunar shard
#

I don't know what it is about VisualEffect Graph assets in Unity, but I had to open up the editor and manually open the VisualEffect Graph UI panel to peek at its graph before Unity would import it fully and produce a non-garbage Addressable when I asked it to build one from my headless commandline script

#

Anyone else have grief with VFX assets and Addressables?

#

When they work, they work, but I've always had more problems with them than any other asset. They seem very temperamental.

#

Mostly because you almost always have to rebuild them anytime the package upgrades, but also for reasons like this

hallow turtle
#

Hey, guys! Which Asset Management approach should I use? Do I really have to learn Addressables Asset System or maybe Asset Bundles or Direct References or anything else? What do you recommend?

#

Am I using direct references?

#

I think yes because I have never used the other approaches

honest halo
#

Addressables should probably be used over manually using asset bundles, its much easier to manage.
In projects I work on, everything uses addressables (scene loading, other asset loading)

#

Is easier when everything does due to the flaws of asset bundles

clear cedar
#

I'm trying to get a build with localization and unity stores them as addressables.
I've tried a bunch of things but I'm not sure how I'm supposed to do this.
I've run the Build -> New Build -> Default Build Script
But I don't think it's properly exporting these tables
Any advice would be appreciated

honest halo
frail axle
#

After loading an asset, if multiple objects point to that handle of the loaded asset, will they all be released at once when you use Addressables.Release(handle), or do I have to release the objects one at a time like through a for loop to clear them out at once?

honest halo
clear cedar
frail axle
# honest halo dependencies are handled automatically, if A depends on B + C, when all instance...

Ok one last question. When you create a new object from an object that is from a scriptableobject, you can make changes to the new object without it affecting the actual scriptable object itself. Now, if that scriptableobject is an addressable, you load it into memory, create a new object from the handle, and make changes to that new object, will it also affect the result from the handle?

honest halo
#

If you have a scriptable object instance loaded from addressables then you make a copy, that copy ofc does not mutate the original.
However if you then release the original, assets may be unloaded that the copy now needs.

frail axle
#

Ah ok

#

I have been messing around and doing some testing and I pretty much got the hang of a lot of stuff

#

But there is one problem I have. I use scriptable objects to hold data on my in-game items, and whenever I use direct references to an item scriptable object and make changes, it doesn't affect the scriptable object itself. Which is good and useless for when you have references all over with some having modified stats and others having gems, etc. But when testing how addressables work with my scriptable objects items, it modifies the scriptableobject directly, which isn't something I want. I am wondering if there is a way to work around this

honest halo
frail axle
honest halo
#

If it references things like textures or audio you need to not release the original when the copies are in use still but yes a copy is the best solution.
If you need to modify it, it may be better to have another object to do this role instead.

honest halo
#

<@&502884371011731486> ^ scam

warm meteor
#

Anyone having problems with CCD download right now?

#

It does download but then it stuck at 99.2%

warm meteor
#

Nah it's just me being stupid

#

Whatever

#

Addressables work perfectly

steady mica
#

So I saw the load path thing in my addressables group settings and I was wondering if doing something like {UnityEngine.Application.persitentDataPath}/Mods would work

steady mica
honest halo
lyric scroll
#

Any idea what the highlighted test is?
Appeared suddenly and it just contains an empty test

using NUnit.Framework;

namespace AddressableAssets.DocExampleCode
{
    // Exists to so that the files in this folder can exist in Tests
    internal class TestStub
    {
        // A Test behaves as an ordinary method
        [Test]
        public void RequiredTest()
        {
            // Use the Assert class to test conditions
        }
    }
}

Is it safe to remove?
Doesn't seem like any class has a reference to this, at least none that VS is warning me about

#

From the README inside the directory (DocExampleCode), it looks like the whole folder can be deleted

in the documentation. They are included in this format so that the
code is compiled and checked before every release. The code is not
created for the purpose of stand-alone use and is not part of the
supported, public API of the Addressables package. In most cases,
you must make changes before the example code can be used in a project.```
orchid cargo
#

I’m working on a system that serves 3D content to a Unity app at runtime, and I’m trying to understand the best format for remote delivery. Specifically, I’m looking at AssetBundles, Prefabs, and UnityPackages, and wondering which of these (if any) Unity can import dynamically during runtime. From what I gather, AssetBundles seem to be the standard approach for streaming content into a live app, but I’m not sure if Prefabs or UnityPackages offer any similar runtime capabilities or unique advantages. Would appreciate any guidance on which format is best suited for this kind of on-demand loading architecture.

honest halo
orchid cargo
#

Thank you @honest halo !

formal arch
#

Hi everyone, I've been working on a project involving procedural generation. I've started moving the "world gen" code part of this project to an external package that could hopefully be reused.

The issue thats not popped up is that the original code used Addressables to access the assets during runtime, this means that now that I am setting up the Samples~ directory with examples of how to use the package I cannot reference anything directly as addressables are project exclusive.

I was wondering, is their a correct way of dealing with this? For example having package specific addressables that can be imported along with the package or will I just need to use gameobject references?

lost wind
#

Hey, I'm having a problem on Meta Quest / Android with Addressables and split application binary. This generates the .obb file with my Addressables, but when I use AssetReference to load a scene that I have as Addressable, it throws Null Ref. It can't find the AssetReference. However if I put a label on it and load via label string, it does correctly find the scene and it loads. What do I need to do so I can still use AssetReferences?

honest halo
lost wind
#

that's why the label worked, because I hardcoded it, and did not get it from the scriptable object

honest halo
#

How is the scriptable object loaded? Should still work as all it does is hold the address/guid and loads the asset like normal

lost wind
#

I have a singleton dont destroy on load object with game setup that holds

        public LocationSo SelectedLocation
        {
            get => selectedLocation;
            set => selectedLocation = value;
        }

it is being set in the menu (first scene that loads)

        {
            _gameSetup.SelectedLocation = locationSo;
        }```

Then I load a level scene (single), which has its own initialization script and gets the game setup in Start

```    private async void Start()
    {
        _gameSetup = GameData.Instance.GetGameSetup();
        await SpawnEnvironmentAsync();

    }```

And the SpawnEnvironment is

```    private async UniTask SpawnEnvironmentAsync()
    {
        var selectedEnvironment = _gameSetup.SelectedLocation;

        if (_gameSetup == null)
        {
            Debug.LogError("GameSetup is null. Please check your game data initialization.");
            return;
        }
        if (_gameSetup.SelectedLocation == null)
        {
            Debug.LogError("Selected environment is null. Please check your game setup.");
            return;
        }

        var handle = Addressables.LoadSceneAsync(_gameSetup.SelectedLocation, LoadSceneMode.Additive, false);
        await handle.ToUniTask();

        if (handle.Status == AsyncOperationStatus.Succeeded)
        {
            await handle.Result.ActivateAsync().ToUniTask();
        }
    }```
#

which throws null at second check for SelectedLocation

#

On Quest

#

Editor is fine

#

And the location scriptable is assigned as a serialized field in the menu scene to the location button

#

so it just gets passed in onClick

grave timber
#

anyone know if its possible to make an asset bundle for an png? its not working for me no matter what i do. im just getting a bunch of null rectangles in my assetbundle file.

honest halo
lost wind
honest halo
#

Additionally, if scene A and B both reference it it should work just fine but don't expect changes made to the asset to be kept between scenes

#

As it could be unloaded then loaded again as a new instance

lost wind
#

okay so the scriptable is on a "GameCore" object (which is addressable), assigned as a serialized field. The Game Core is also marked as don't destroy on load, and is loaded in a Menu scene. The menu scene gets unloaded after I switch to next scene where I want to use the data. The Game Core persists because it's in the dont destroy scene. Would the data assigned to scriptable in Menu not persist in this case?

#

the Game Core is loaded in Menu, but then is taken outside of it technically, so unloading Menu will somehow clear it?

#

You should load the scriptable object yourself explicitly so it won't be released too early.

So I should have the SO marked as Addressable and load it independently of the GameCore object which uses it and then it would keep the data between scenes?

lost wind
#

But this wouldn't work anyway, it's no different if I load the SO as a separate Addressable since if I will load it in Menu scene, it will also get unloaded during scene change. So it would be best to keep the SO in its own scene?

honest halo
#

If you loaded the SO via LoadAssetAsync() and never released it then it would be fine and great

#

The documentation explains this concept of dependencies.
If you load scene "Foo" and it depends on asset "bar", addressables also loads "bar".
When you release scene "Foo" it checks if we can also release "bar" because its user count 0

lost wind
#

okay, but I moved the bar to dont destroy on load scene

honest halo
#

doesnt matter

#

Addressables loaded some assets, it will unload those same assets later

#

If you load the asset yourself with its address you avoid this problem because its then YOUR job to release it

#

Please re read the documentation as this concept of dependencies and asset loading/unloading is explained by unity

lost wind
#

will do

#

thanks, you are gold

neon kraken
#

I'm just porting over a project to using addressables, I added some prefabs to a group, ran the build script, and it works great in editor.

When I build to iOS though, it gives me this error which makes absolutely no sense. It's saying the key is expecting a gameobject, but its actually a gameobject, so it can't be assigned to a gameobject.....????

UnityEngine.AddressableAssets.InvalidKeyException: Exception of type 'UnityEngine.AddressableAssets.InvalidKeyException' was thrown. No Asset found for Key=zipperBoxingGlove with Type=UnityEngine.GameObject. Key exists as Type=UnityEngine.GameObject, which is not assignable from the requested Type=UnityEngine.GameObject

#

maybe one of the most unhelpful logs I've seen in a while lol...

honest halo
neon kraken
#

yeah they are prefabs, its working fine in editor. they do appear to be in my default group, and I see that bundle being made

honest halo
#

well that is what that error means. did you change the local load path for the default group by accident?

neon kraken
#

not that I can tell

#

and i do see the bundle in the built xcode project

#

the log says it found the key, but that the key type of GameObject was incorrect for assigning to a GameObject

#

which is.....interesting

#

LOGGING - [Error] UnityEngine.AddressableAssets.InvalidKeyException: Exception of type 'UnityEngine.AddressableAssets.InvalidKeyException' was thrown. No Asset found for Key=zipperBoxingGlove with Type=UnityEngine.GameObject. Key exists as Type=UnityEngine.GameObject, which is not assignable from the requested Type=UnityEngine.GameObject

#

right there its saying it does see that the key exists, just a type incompatability that is completely bogus

honest halo
#

huh yea that makes no sense wut 😆

#

what unity version?

#

il2cpp?

neon kraken
#

my usage of Addressables seems like the most basic lol

Unity 6.1.5

#

I have one call to LoadAssyAsync in my script, and just a handful of prefabs I'm trying to load from the default group

#

editor the call gives no errors of course, and the error on device is just driving me mad

#

Can't imagine a non-engineer trying to utilize this yeepsob

#

yes il2cpp as is required for iOS

#

@honest halo

#

out of desparation, trying to disable engine code stripping to see if that makes a difference

honest halo
#

id try doing a clean build too, delete any old build files

neon kraken
#

but I'm about half an hour away from just making my own addressables alternative. hate black boxes

honest halo
#

well the src is readable and if it happens in editor you can even debug it

neon kraken
#

its only on device

#

I'll try cleaning my library and doing a full project reimport, then build

#

its slightly making me feel better that I don't see this issue being reported all over the place, but then also, what am I doing wrong

honest halo
#

It looks like some strange bug either potentially with il2cpp compilation as it makes no sense for the actual type to not be assignable to itself

neon kraken
#

right

#

the log is completely bogus

#

ill report back if the project reimport helped

ruby depot
#

Hello, I am trying to setup addressables for our mobile game but I am having some strange bugs with it so I'm wondering if the way I am using it is incorrect.

We want to be able to download the addressables and catalog from S3 in any of our builds. (Assuming same platform) I have turned on "Only update catalogs manually" and during the game initialization I call UpdateCatalogs() and pass the URL to the catalog. Addressables.InitializeAsync().WaitForCompletion(); is called before any of this as well.

var catalogs = new string[] { catalogURL };
Addressables.UpdateCatalogs(autoCleanBundleCache: true, catalogs, autoReleaseHandle: true);

I've also tried using Addressables.LoadContentCatalogAsync() but the documentation says that's only for more than 1 catalog?

I've attached my addressable group settings as well as my addressable settings.

When we build, all load and build paths are set to remote. The com.unity.addressables folder in the library is cleared before the build. Anything in ServerData is also cleared.

In the build we see missing assets but 99% of the assets/prefabs are loading fine.

I'm thinking I am maybe doing something out of the norm.

#

Oh, and CRC is disabled because we want to be able to use addressables accross multiple builds and it was preventing us from doing so. So maybe the problem is long those lines?

honest halo
#

(this is because its not safe to change/load new catalog data when things have already been loaded)
you should probably change it back so the catalog is updated during addressables init

ruby depot
#

Isn't that the point of "Only update catalogs manually" though?

ruby depot
honest halo
#

then why not let it download the latest for you?

#

its needed so addressables knows if a bundle has changed and needs to be re downloaded

#

its all in the catalog

ruby depot
#

Hmm. Well because the URL for the catalog can change.

honest halo
#

then have the url be a static var and have it be runtime resolved

ruby depot
#

I can try that

honest halo
#

or have the path be something that makes sense at build time such as bucket/version/platform

#

What I do:

#

docs explain the differences of {} and []

ruby depot
honest halo
#

its the directory its all in

ruby depot
#

ok

honest halo
#

you can see on mine it inputs the path automatically but has a helper property for runtime to ensure the path is lower case

ruby depot
#

I think that did help thanks

ruby depot
#

@honest halo So the bug with the game randomly breaking seems to be due to me disabling CRC. With that enabled I cannot use the same addressables for multiple builds anymore.

I am required to do a lot more work to make sure every build has it's own addressables build. Not to mention the amount of storage required will increase substantially. We make like 20 builds a day.

Do you know of a better way to make it so mutliple builds can use the same addressables without disabling CRC?

#

Like maybe I have to cache the addressable library data for each git branch on the build machine and make sure to use the correct one when building?

#

I could try content updates I suppose as well. Though that will require more work as well as I wouldn't want git branches to use the same content update path.

ruby depot
#

Found a different way to do it.

honest halo
fathom compass
#

hello, i am a beginner so maybe it is an stupid question but i don't know how to make it. I am trying to make a small rpg game with narrative dialogue system like arknights and other 2d LN game. Then i met a problem, usually, i just add animator on the sprite with ink file tags system to make the dialogue but as I moved to addressable, I need to make the animation myself. So the Question is :

  • Can I use animation of unity to make the sprite move ?
  • Should I use inks file tag + self function.
  • Or both ideas is bad ?

Also , about the syntax of label and group. Is it a good ideas using syntax
group:

  • Character_name
  • SharedObject
    mixed with
    Label :
  • [Character unique Id]
  • [Character facial expression]
  • [Character unique id outfit]
honest halo
fathom compass
#

oh

fathom compass
#

not exactly, what i want is if I can load a sprite from de adressable then applying an animation on it zerotwo_wha

#

but thx you, i find Sprite Resolver as I am using Sprite Renderer before, you saved me so much time pika_mdr

honest halo
#

You could also load a unity animation clip or your own way to do sprite animation but the 2d animation stuff should be better suited.

fathom compass
#

Isn’t it using unity animator with clip?

honest halo
#

you cannot modify an animator controller at runtime so it would kinda suck to use

fathom compass
#

Do you mean by 2d animation stuff = Sprite Library Assets and Animation Clips

#

And using psd for sprite ?

honest halo
#

I believed 2d animation had something to do sprite animation easier but looks like thats not the case. Meaning if its done with animation clips in an animator you probably dont need to load anything (as you would just change animation in the animator).

#

any a sprite can be many formats outside of unity, once imported its not important anymore

steady mica
steady mica
#

so i found the error

#

i had some broken scripts

mild junco
#

Hey 🙂

Just curious, I want to download a single scene. I don't want to load it (open it) just download it so it's stored locally. When calling Addressables.DownloadDependenciesAsync(SceneKey) I get an error:
OperationException : GroupOperation failed because one of its dependencies failed

I am testing with an empty scene. I have done some research and can't find any viable solutions. Is there a way around this?

honest halo
fathom compass
#

wait, we can't preload a scene ???

honest halo
#

you can make addressables download any assets inc scenes

#

you cant "load" a scene asset as thats not a thing at runtime so yea with scenes you begin loading it or nothing

fathom compass
#

wait I mispelled

#

I mean you can preload a Scene blurry_eyes

honest halo
#

pre load is vague in this context

fathom compass
#

yeah predownload

mild junco
honest halo
mild junco
#

New question regarding an issue, I am attempting to back addressables serpeatly using CCD, although when I build to CCD, the addressables aren't uploaded 😅

Anyone have any idea around this? I found a forum from 2 years ago where a few devs experienced the same issue, just curious if it has been fixed

neon pilot
#

good morning, I want to use Addressables in a cutscene—well, I already used them in several—but I noticed in the build report that the characters I use in the cutscenes are duplicated in size. For example, npc.fbx appears twice in the build. Should I make npc.fbx an Addressable and have the cutscene look for it in the Resources folder before it starts? But isn’t it complicated to assign npc.fbx with its animations in the Timeline and then remove it afterward? Or am I misunderstanding something? I’ve looked for tutorials on this, but I only find basic Addressables videos.

honest halo
neon pilot
#

sorry for my english

honest halo
neon pilot
honest halo
#

2022+ has the better report window that shows this information easily

neon pilot
honest halo
#

it goes 2022, 2023, 6

neon pilot
#

and i just noticed this new package, if i wont use play asset delivery is not necessary right?

honest halo
#

Correct

neon pilot
#

What I’ve found is that it’s not enough to just mark the shared object in both cutscenes as Addressable—I also need to place it in a separate group to avoid it appearing duplicated in the build report. I’m not sure if I’m doing it right. For example, “arms…” with its material and texture—I’ve moved it to its own group, as you can see in the screenshot. Only this way I can prevent it from showing up duplicated in the Addressables report.

neon pilot
#

and how to avoid duplicated shaders? i cannot make them addressable are the basic from urp

honest halo
#

you can make them addressable

honest halo
azure spear
#

Hey 🙂
I am fixing addressables for one project. I want to have bundles included in build, but updated from remote.
My build path is to Streaming assets Assets/StreamingAssets/aa/[BuildTarget]
and my remote path is [CloudRootPath]Hockey/Release I can not make it work like this. Any idea why ? I use remote catalog.

wet steeple
#

When doing a Content Update build how can I tell what bundles are new? The docs say they will have a new name but I feel like there should be a built in way to get a list of all the changed bundles to upload to our cdn

honest halo
#

If the hash is in the filename then you know that way

#

Otherwise I dont think you can tell without checking checksums yourself

wet steeple
#

What? So I am supposed to keep a db of the hashes and check against that?

#

Would be easier to compare creation date of the file with the jenkins job start time

honest halo
#

if they are all stored in the same folder and have the hash in their filename then you can upload them all and not worry

wet steeple
#

I don’t want to upload them all.that takes 3 mins

honest halo
#

Then you probably need your own solution to find what has changed

viral seal
#

Is it correct to assume that assets between assetbundles are referenced with GUIDs/FileIds?

#

If thats the case, is it safe to assume that if I build assetbundles within the same project - these references will always stay valid

#

Example, I have folders Game and Update1 build in the first batch

#

Then I build folders Game, Update1 and Update2 in a second batch

#

If I will be loading bundles like so:
Game bundle (taken from the first batch)
Update1 bundle (taken from the first batch)
Update2 bundle (taken from the second batch)

#

Will all assets references still stay valid between an old bundle and a new bundle that uses assets from the old bundle?

#

They were build within the same project with the exact same folders

#

Just in different batches ( different BuildPipeline.BuildAssetBundles calls )

#

I need to be able to additively upload content to the game with updates, and I want to only ship that additional content that was built with a second batch (Update2). I know that some games using Unity is doing this somehow, but none of this is documented anywhere.

#

TL;DR Can newly build assetbundles within the same project reference old assetbundles in terms of asset references from old to new, so that you could publish new assetbundles without republishing any old assetbundles

fierce crow
# neon pilot What I’ve found is that it’s not enough to just mark the shared object in both c...

I'm late to this, but back in the day we made a video about SOs and in passing we mention exactly this duplication issue that can happen with Addressables: https://youtu.be/WLDgtRNK2VE?si=tSGSmcA8P4x8XzUj
(sharing just for fun)

In this second devlog, we look at how we employed ScriptableObjects to create a flexible and powerful game architecture for "Chop Chop", the first Unity Open Project.

🔗 Get the demo used in this video on the Github branch:
https://github.com/UnityTechnologies/open-project-1/tree/devlogs/2-scriptable-objects
(compatible with Unity 2020.2b and...

▶ Play video
hexed viper
#

Hey! I tried to integrate the addressable system with my scriptable objects and load them on awake, it does work, but I have to rename every SO to "Perk" by hand, so I'm looking for a better way.

burnt rover
#

rename them after loaded? or before
what does it help with when you rename them?

honest halo
bold spruce
#

Hey everyone. I've got a problem. I have multiple asset types, inherited from the class ParentType. I mark all of them with the same set of Labes. Then I do this:

var operation = Addessables.LoadAssetsAsync<ParentType>(Labels, Addressables.MergeMode.Intersection);

But operation.Result contains only null values. It contains the correct number of them, it designates them with correct classes, but the vaues themselves are null.

I've tried to instead use LoadAssetsAsync with specific type instead of a parent and it works fine. Am I missing something? I think this worked before. No?

honest halo
bold spruce
#

Ok. I fixed it by changing generic type I used for ParentType to ScriptableObject. Before, it was just UnityEngine.Object

viral seal
honest halo
#

should be guid because asset bundles existed before addressables

viral seal
honest halo
#

Probably fine yea but seems like needless work as you surely will need to update old assets requiring changes to older bundles

neon pilot
viral seal
#

I am working on something entirely different that would just use the same mechanism - modding SDK

#

Thanks for the feedback

lost bobcat
#

Hello channel, I am having some issues with the addressables system. I am currently using it for visionOS and for some reason, the memory keeps piling up using this simple script

private void Start()
    {
        StartCoroutine(AutoLoadAndUnloadToTest());
    }

    IEnumerator AutoLoadAndUnloadToTest()
    {
        LoadAssetReference();
        yield return new WaitForSeconds(4);
        UnloadAssetReference();
        yield return new WaitForSeconds(4);
        StartCoroutine(AutoLoadAndUnloadToTest());
    }

    private void LoadAssetReference()
    {
        if (assetReference != null)
        {
            asyncOperationHandle = Addressables.LoadAssetAsync<GameObject>(assetReference);
            asyncOperationHandle.Completed += OnAssetLoaded;
        }
    }

    private void UnloadAssetReference()
    {
        if (asyncOperationHandle.IsValid())
        {
            Addressables.Release(asyncOperationHandle);
        }
    }
lost bobcat
honest halo
#

well in your example you may be using the asset reference as a key which is just wrong

lost bobcat
#

But isnt that how its meant to be? Using the AssetReference from addressables namespace to reference the asset in the group?

honest halo
#

if you use an AssetReference object then you load its held asset from that instance

AssetReference myAssetRef;
//...
Sprite asset = await myAssetRef.LoadAssetAsync<Sprite>();
#

otherwise you can load an asset with its address via:
Addressables.LoadAssetAsync<GameObject>("MyCoolAddress");

#

you are trying to do something weird and wrong

lost bobcat
#

Oh, so you mean, the assetreference will not be converted to its address by passing it?

honest halo
#

no so do what I just showed above

lost bobcat
#

Because it is actually loading it and showing it and also unloading it

#

Okay, Im on it trying your suggestion , thanks a lot

honest halo
#

then unity must have handling for this but its not the intended solution

lost bobcat
#

Haha no no, I trust you, was just wondering, why it worked with all the addressable calls still 😄

#

seems like I mixed up address loading with the actual reference part 😄 Lets see, how xcode tracks the memory now 🙂

honest halo
#

use the unity memory profiler instead

lost bobcat
#

I do, but firing a snapshot every now an then is semi convenient and not always the best representation of the actual device. I am using this for larger amounts, this is just a quick test to get the issue fixed 🙂

#

Still piling up:

honest halo
#

releasing the handle is the correct way. Btw you can use the profiler and track current handle counts for loaded addressables

#

(normal profiler)

lost bobcat
#

yeh, when its unloaded in editor, the addressable profiler also shows no entry, but still, memory is piling up for no reason. I am confused 😄

#

all good there from unitys logs at least

#

Lets up to the latest 2.7.3 version, maybe there is a fix for something

#

Also, everytime unloading, this is being fired in xcode:

#

Oh my, has 1 polyspatial ref... somehow I am scared, it is indeed a visionos bug

honest halo
#

You can profile on a dev build as long as you have the build report (to allow the addressable part to work)

#

but anyway if you use the memory profiler and take 2 snapshots and compare you can tell what actually changed with more detail

lost bobcat
#

So, I connected the profiler and I can see, that addressables are being loaded and unloaded (at least the view says so), but on everyload, it increases memory

honest halo
#

So thats why you use the memory profiler to find what changed over time. You can try explicitly calling GC to see if it helps but you should not look at external memory profilers only because unity will grow the space for the managed heap but will rarely decrease it.
The unity memory profiler will actually tell you whats in use and whats un used space.

lost bobcat
#

Seems like something is piling up in untracked memory

honest halo
#

Then may be some native lib used by your app

lost bobcat
#

But it happens only when loading and unloading the addressable. Nothing else is happening. Thats why I assume, its some unity package causing this issue or some visionOS bug.

honest halo
#

VisionOS is just android (right?) but unity should track addressable loading correctly. Double check what this loaded asset is potentially doing and follow the doc pages on how to handle/debug memory leaks. Best advice I can offer

lost bobcat
#

visionOS is apple

#

Thanks for your insights! I will try to dig deeper into the profiler and hopefully find the issue or an update of some kind. Will also get in touch with unity support and apple support I guess, to give them an example project

honest halo
#

Oh right mb I got confused with oculus and you mentioned xcode 😂

#

Apple probably isn't going to help unless you can demonstrate one of their libraries has a leak

lost bobcat
novel basin
#

when i try to build i get this

UnityEditor.GenericMenu:CatchMenu(Object, String[], Int32)

SBP ErrorException
UnityEditor.GenericMenu:CatchMenu (object,string[],int)

Addressable content build failure (duration : 0:00:00.01)
UnityEditor.GenericMenu:CatchMenu (object,string[],int)```
upbeat dagger
#

Hi, is it ok to ask about AssetBundles here?

#

I am having an issue where our bundling project exports some assetBundles with Universal Render Pipeline/Lit shader, but this is stripped from our app project at build.

I can't set it to always include this built in shader because Unity screams at me about too many variants, and there has to be a way without indlucing a dummy scene that includes dummy objects. No?

honest halo
upbeat dagger
#

URP/Lit is a built-in shader, that could be why it's not shipping with the bundle

#

i also can't include built-in shaders in a shader-variant collection

honest halo
#

It's not built in it's from a package

upbeat dagger
#

right, i still can't include it in an SVC though

#

it is quite normal to exclude assets from a project that utilizes AssetBundles/Addressables though, no?

#

because the whole idea is you fetch the bundles remotely, they aren't included with the build

honest halo
#

Same with addressables but requires you to correctly organise assets and dependencies

upbeat dagger
#

I see, so I am assuming the problem is that for URP lit, it isn't shipping with my bundle, and my build won't include the exact variant i need without forcing it into my build somehow with a dummy scene or dummy object?

#

How do people get around this? Have an uber scene where they just dump variants and make sure users can never access this scene?

#

I'd happily correctly organise assets and dependencies, but what does that mean exactly? Are there articles or guides I can refer to?

honest halo
#

It should be included in your bundle which confuses me. If you try adding urp lit to the same bundle does that help?
Addressables seems to manage this correctly and I've not had issues except with an older 2022 version that had a bug

upbeat dagger
#

I'll try

#

I am in Unity 2021 which probably isn't helping either

honest halo
#

Oof no it's not

upbeat dagger
#

(i have to, it's a company thing, tied to all the SaaS plugins and satellite companies etc)

honest halo
#

It should work though I used addressables in 2021 and bundles as early as 2019

upbeat dagger
#

apparently "AssetBundles can’t ship new compiled variants, only the shader reference."

honest halo
#

I use addressables and usually add common shades to the default group to avoid duplication

upbeat dagger
#

yeah, but I can't add Lit to AlwaysInclude section under Graphics, nor can I add it to a ShaderVariantGroup, so not sure what I'm meant to do with it

#

problem is not finding it in the packages folder, problem is what to do with it from there

#

or, what is the default group you're meaning?

honest halo
#

no no add the shader file asset to an asset bundle

#

in addressables you can just mark it as addressable/add it to a group of your choice

honest halo
#

(project window)

upbeat dagger
#

Ah no, I already see all the packages, just Lit shader can't be dragged into stuff, SVC or AlwaysInclude, Unity won't let me

#

and I can't force-include it with the bundle because the interface to mark it with a bundle name won't show for package assets

#

I can duplicate it out of packages, and THAT I can assign a bundle name to

honest halo
#

that wont help. guess addressables solved that issue for us

#

is it really not possible to just assign the asset to a bundle in the inspector?

upbeat dagger
#

no, Unity hides the bundle-name menu from the preview box for package assets

#

Addressables do seem to be the evolution of AssetBundles, so that we are still using bundles seems to be one thing riding against me here, the other being I'm in Unity 2021.

Still I thought there should be a straightforward way

honest halo
upbeat dagger
#

Im lucky this was just for a feature test, I don't actually need the shader included at all, just annoying it was coming up pink.

In our company's main app we have URP shaders appearing fine, nobody I ask seems to know why though 😛

#

but what I've been doing is in a bundle project I setup from scratch for isolated testing, so this URP Lit confusion from me has not been a mandatory solve, just something I'm curious about

honest halo
#

Hmm well I'd always suggest trying to use addressables instead if you can but does mean you have to load via that to get the most benefit

upbeat dagger
#

For a different project maybe, our company is hundreds of people and I am nowhere near as far up the ladder as I'd need to be to influence decisions there

#

plus it's been a few years, the way the app works at this stage is just how it works

#

I solved the actual problem I was trying to solve though, which was including Unity Visual Scripting in the app project without stripping anything during build. Seeing as we bundle to cloud from a separate project so it never sees any of our graphs and on its own doesn't know what not to strip

honest halo
#

I feel like I understand less but sounds like it's okay so let's leave it there 🙂

next marlin
#

I'm having a issue where I'm unable to instantiate a prefab using addressable in additive scene, but it works perfectly if that scene is the only one loaded .

It works even if i instantiate it once in main scene and then again in additive scene but it doesnt work if it instantiate only in additive scene .

honest halo
next marlin
#

no

honest halo
#

no what?

#

which one?

next marlin
#

_agentInstance = Instantiate(_agentInstance, _agentParent);

#
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.ResourceManagement.AsyncOperations;

internal class LoadAddress : MonoBehaviour
{
    public AssetReference assetReference;

    private AsyncOperationHandle<GameObject> _opHandle;

    private IEnumerator Start()
    {
        if (assetReference == null || !assetReference.RuntimeKeyIsValid())
        {
            Debug.LogError("[LoadAddress] AssetReference is null or invalid.");
            yield break;
        }

        _opHandle = assetReference.LoadAssetAsync<GameObject>();
        yield return _opHandle;

        if (_opHandle.Status == AsyncOperationStatus.Succeeded)
        {
            GameObject obj = _opHandle.Result;
            Instantiate(obj, transform);
        }
        else
        {
            Debug.LogError("[LoadAddress] Failed to load asset: " + assetReference.RuntimeKey);
        }
    }

    private void OnDestroy()
    {
        if (_opHandle.IsValid())
        {
            Addressables.Release(_opHandle);
        }
    }
}
#

even this only works in first scene not additive scene

#

works fine on editor

honest halo
#

Yea i dont see anything wrong here

steady mica
#

i was wondering if it is possible to convert AsyncOperationHandle to AsyncOperation?

honest halo
#

Why? You can await them with UniTask if that helps

gentle thicket
#

I know you asked this 4 years ago, but did you solve? 😄
Same issue, only on iOS addressables build though. Have no clue what to do, the error doesn't tell anything useful.

honest halo
undone hound
gentle thicket
honest halo
gentle thicket
#

`
Exception has been thrown by the target of an invocation.
UnityEditor.GenericMenu:CatchMenu (object,string[],int) (at /Users/bokken/build/output/unity/unity/Editor/Mono/GUI/GenericMenu.cs:154)

Addressable content build failure (duration : 0:00:00)
UnityEditor.GenericMenu:CatchMenu (object,string[],int) (at /Users/bokken/build/output/unity/unity/Editor/Mono/GUI/GenericMenu.cs:154)
`

honest halo
#

When I had this happen before was during a merge in git so it just took checking what the merged did and removing the funny group entries

#

hmm yea nothing useful at all 😐

gentle thicket
#

So the last git commit is very different 😄

honest halo
#

try disabling some groups from being included in build to narrow down the cause
Tbh this issue REALLY NEEDS to be fixed

#

Hello Unity devs who work on addressables please improve these shit error messages thanks 👋

#

Addressables could be soo much better if it didnt need to use asset bundles (which have many flaws)

gentle thicket
#

Because I updated Firebase, there was a new .dll file.
My MacOS didn't trust it and put it into some category of unknown developers, basically like the file could contain malware.

I whitelisted it in OS security settings and all is good now

#

I still don't know why build for android worked though, but at least all works now

honest halo
#

Thanks apple. Glad it's fixed

steady mica
cloud aurora
#

So question. I have a scene I am loading in, but not activating, and then I quit playmode before it is loaded in. However I am seeing error logs from my components in that scene, specifically from OnEnabled. Does Unity activate the scene befor unloading it?

pale bobcat
#

i just downloaded my friends unity file and i kept getting errors like these. Im really a beginner but im doing it for school (ill learn a lot if you help me 🙂

#

the last 2 are the source of the problems i think

#

i mean the yellows ones i think i can fix those but the red problems i really dont know

#

i can still download the file again

#

but it will have the same problems

honest halo
pale bobcat
#

ohh

#

wait

pale bobcat
honest halo
pale bobcat
#

ty

viscid bison
young igloo
#

Hi anyone here knows why the image in the "Scene" panel is not the same as the image in the "Game" panel

young igloo
honest halo
#

you should be using ugui shaders only

fathom compass
#

Hi

#

I got a problem, how the runtimekey work ? With an assetreference ? When I define it in a SO and use it value with runtimekey , it give me the meta of unity, not the address i defined in the adress

honest halo
#

Runtime key is not guaranteed to be there because it's optional for them to be included by a group.

#

So if you use asset reference then just load the asset correctly

fathom compass
#

the problem isn't loading the problem but how i manage the all ressource

#

the preload use the label so I get the address with the IRessource

#

but when other need to ask a resource, it give the assetguid

honest halo
#

Yea because the guid is always valid to load an asset

honest halo
#

What you say sounds like you are just abusing it

fathom compass
#

oh i wanted to use the guid as key to search an already loaded ressource

#

but the preload i use the primarykey that i get with Addressables.LoadResourceLocationsAsync

#

!code

indigo oarBOT
fathom compass
#
    public async Task LoadAssetLabel<T>(string label) where T : UnityEngine.Object
    {
        // Get Location
        var locHandle = Addressables.LoadResourceLocationsAsync(label, typeof(T));
        await locHandle.Task;

        if (locHandle.Status != AsyncOperationStatus.Succeeded)
        {
            CustomLogger.LogError($"Failed to get locations for label {label}");
            return;
        }

        foreach (var location in locHandle.Result)
        {
            if (!IsAssetLoaded(location.PrimaryKey))
            {
                await PersonalLoadAsset<T>(location.PrimaryKey);
            }
        }

        Addressables.Release(locHandle);
    }

is there better ways loading this ? other than using the primarykey

honest halo
#

I am confused. A label works well to load multiple assets yes

#

Not great though to load one at a time by awaiting each. Ideally you load them all using addressables or load and await all them as tasks via UniTask

#

A resource location is not an asset reference so I don't get what you actually had issue with

#

@fathom compass

fathom compass
#

haha i just saw the UniTask in the unity talk

fathom compass
#

but the problem is I mixed the guid (unity) and the address we set in the inspector

honest halo
#

You can keep the actual object and not the op handle btw

#

But there isn't much benefit in loading an asset and keeping it loaded longer than needed.
Then you miss out on auto unloading

#

Just load and release via addressables everywhere

fathom compass
#

I made this system for that and prevent memory overload but my friend tell me as it is only the beginning of the projet, i can just load everything

honest halo
#

If you load things and leave them loaded in then it uses MORE memory

#

Addressables tracks users so when user counts goes to 0 it unloads stuff

fathom compass
#

ahh

honest halo
#

You can use the profiler to even check this stuff

fathom compass
honest halo
#

If you build addressables to have an updated build report and then use the profiler it will show the current users of assets

#

This helps you track when you forget to release stuff

#

Because you WANT to so things can be unloaded

#

The docs explain this all

fathom compass
honest halo
#

It's sometimes required for us to load stuff ahead of time and keep it loaded (if used a lot) but for other stuff you should load and release via addressables to get the most benefit

#

Otherwise textures and other large assets build up in memory

fathom compass
#

yeah i know it, but for a small projet it is not necessary (what my friend said) so I just changed it into keeping a stuff loading that all UnityChanThumbsUp but fine, thx for that I just swapped and write my address if i can't use assetreference

honest halo
#

Well this problem demonstrates why it's not a good idea to do what you are

#

You can just reference the asset directly if a direct dependency is okay

fathom compass
#

then how can I preload object ?

#

if I only use the label?

honest halo
#

Your previous code is correct to load assets that have a label

fathom compass
#

you said I don't have to wait

#

like i can remove the await here ?

        foreach (var location in locHandle.Result)
        {
            if (!IsAssetLoaded(location.PrimaryKey))
            {
                await PersonalLoadAsset<T>(location.PrimaryKey);
            
```?
#

oh I succeed

#

yay

honest halo
fathom compass
#

I will change it thx

honest halo
#

UniTask does make this easier because it has many good extensions for addressables

#

But the concept is what matters, its better to start many loads at once and await them all completing.

fathom compass
#

oh before i am using task but when I saw unitask in unity talk (1hour ago) i swapped into it haha

honest halo
tired lily
#

Hey everyone. I am kind of newbie to Addressables. So i have few questions. I want to make Asset bundles using Addressables and then i want to publish those asset bundles to Google Play Asset Delivery & iOS Store. Can i do that. I Don't want to put it on Unity Server or any other paid server services.

honest halo
honest halo
peak kraken
#

I am confused about why an asset is staying loaded in memory, the asset has been released, has 0 handles, and the asset load mode is “Requested Assets And Dependencies”. Even after calling unloadunusedassets it stays loaded

#

I don’t think anything has this asset as a dependency either, it’s just a ui texture

honest halo
peak kraken
#

Yes using the addressables extension of the profiler

honest halo
#

well with addressables we dont need to use unload unused from resources (may not even work) so it must be required still

#

you can try to use the memory profiler to find why

peak kraken
#

Oh wait what I think I just fixed it… by setting the background texture that used to have the texture to null then using unloadunusedassets

#

Weird I thought releasing the texture and calling unloadunusedassets would have been enough to unload it but does keeping a texture in a visual element backgroundImage keep it in memory?

honest halo
#

addressables just tracks users and dependencies so as long as things get released it will unload when able

brazen spade
#

Hi

peak kraken
#

Maybe visualelement backgroundImage keeps addressables handles alive?

honest halo
#

no, you miss understand

#

It doesnt care about that. If you load a texture via addressables directly or its loaded as a dependency, that is tracked.
When its user count internally goes back to 0, it can unload the texture

#

so as long as things get released when no longer used things get unloaded correctly

peak kraken
#

I do understand that, but it’s just really weird because the only changes I made to the code were to set the backgroundImage to null and only after making that change did the texture stop showing up in the memory profile after calling Unloadunusedassets

#

Okay maybe I understand actually, unloadunusedassets wasn’t considering that texture before because it was referenced by a visual element

honest halo
#

yea that looks at current users in scenes and some other places to figure out if something is used.
addressables does not

#

but you have essentially bypassed solving it correctly which may have adverse results

young igloo
plain shale
#

Hello, I have marked my scene as an addressable and I'm starting my game water's shader is being stripped (idk if that's the right word but water is pink)

honest halo
plain shale
#

It works fine in editor if I play normally

honest halo
#

were bundles built for the correct platform?

plain shale
honest halo
#

If the shader was added to the group there is a chance that all variants were stripped if no users could be detected

#

is the shader used by a material in this scene already or do you spawn things at runtime?

plain shale
#

Gaia to be specific

honest halo
#

If gaia has materials it uses you can try adding those to a group too

plain shale
#

And it looks like the grass and other shaders are working fine

#

Only water is missing

honest halo
plain shale
honest halo
#

Ive never used gaia so does me no good

#

Add em, re build and test again

#

you can check your editor logs to see whats happening with shader variant stripping

plain shale
#

Hmm ok

honest halo
#

Basically even if a shader is going to be included, if no uses of a variant can be found, its stripped.
Why? shaders can have a few variants to many thousands so we must not build variants we dont need to keep build times reasonable

lunar shard
#

Yoooo,

Does this Unity 6.3b feature mean all web requests on Windows can now use HTTP/2 features (and therefore download lots of remote bundles without opening a single HTTP/1 connection per download)??

Windows: Enabled HTTP/2 functionality on Windows, including optimal HTTP/2 settings.

#

(Well not just Windows, but all desktop platforms and Android and a couple more niche ones [Kepler and QNX])

honest halo
#

I think libcurl is used on windows too so I have no idea

#

Depends on support in curl id say

plain shale
honest halo
#

check the editor logs to confirm if this shader was fully stripped

#

!logs

indigo oarBOT
# honest halo !logs
📝 Logs

Documentation

Editor logs

Windows: %LOCALAPPDATA%\Unity\Editor\Editor.log
MacOS: ~/Library/Logs/Unity/Editor.log
Linux: ~/.config/unity3d/Editor.log

Unity Hub

Windows: %UserProfile%\AppData\Roaming\UnityHub\logs
Mac: ~/Library/Application support/UnityHub/logs
Linux: ~/.config/UnityHub/logs

plain shale
#
  1. Marked my scenes as addressables
  2. added shader in the graphic settings
  3. saved as shader variants
  4. built the game
honest halo
#

dont use graphics settings always include as that wont affect asset bundles

honest halo
#

addressables and asset bundles work differently

#

thats why you need to use a shader variant collection and include THAT in an addressable group

#

or a material already set up correctly for the shader

#

Why? asset bundles can only reference things in other bundles (critical flaw imo)

plain shale
honest halo
#

*shader variant collection

plain shale
#

I'm not using asset bundle btw

honest halo
#

or a material using the shader that is setup correctly

plain shale
#

Just addressables

honest halo
#

addressables uses asset bundles so you technically are

plain shale
#

Ohh ok

#

Ok, marked the variant collection as addressable, let's see now

plain shale
honest halo
#

I know for full game builds it will list all shaders and state how many variants it plans to compile in steps

plain shale
honest halo
#

It looks like this:

Compiling shader "Shader Graphs/glTF-pbrMetallicRoughness" pass "Universal Forward" (vp)
    Full variant space:         754974720
    After settings filtering:   49152
    After built-in stripping:   768
    After scriptable stripping: 256
    Processed in 0.01 seconds
    starting compilation...
    finished in 21.05 seconds. Local cache hits 0 (0.00s CPU time), remote cache hits 0 (0.00s CPU time), compiled 256 variants (166.95s CPU time), skipped 0 variants
    Prepared data for serialisation in 0.01s
#

anyway this is to check if any variants were included, its possible some are but not the ones needed by you

plain shale
#

Showing my variant collection asset

honest halo
#

Then if its 0 you know that shader is not included AT ALL

plain shale
#

Don't know if it's set up properly or not, one sec

honest halo
#

what variants exist in a shader is unique to it so having a material exactly configured that you mark as addressable is easier.

plain shale
honest halo
#

you add the revent shader in the asset

#

or as i said, have a correctly configured material for this water shader marked as addressable (so unity will build the shader variant for this guaranteed)

plain shale
#

hmm ok

plain shale
honest halo
#

We went over this already, that is why this is happening...

#

Gaia may be using the shader only In code so there is no direct dependency.
That is why the above stuff needs to be done

plain shale
#

I did mark the used materials as addressables, but it still doesn't load automatically when scene loads

#

So maybe I need to load them manually

#

Ooo or wait would adding a disabled gameobject in the scene that uses the same material, that should work right?

#

It should be marked as one of the dependencies

honest halo
#

Yea that would make the scene depend on the shader AND the variants used in it

#

Perhaps you can check what Gaia is even doing to make/load this material anyway

plain shale
#

Have to make do with work arounds for now

honest halo
#

Just search for the shader name in the codebase

#

Understanding what a shader variant is and why unused ones are stripped will help with this and future issues

plain shale
#

Yeah you're right, as soon as the it's working that's the first thing I'll do

honest halo
#

When you see how many variants some shaders have then you understand. E.g. urp lit has like 10 million + or something crazy

honest halo
#

Hence stripping is done to keep what's needed only

plain shale
#

LESGOOOOOOOO

#

thank you so much for the help T-T

honest halo
#

Yay congratulations

stuck swan
#

CONGRATULATIONS 🎊

upbeat dagger
#

Im just confused why any shader i write myself is fine, but why built in shader has such trouble.

I understand about variants, but i thought that variant would just be shipped with the addressable or bundle

#

Same as any other shader the app hasn't encountered before

#

I gave up trying to support URP/lit in my test project. It's just a forbidden shader now lol

honest halo
upbeat dagger
#

I absolutely did exactly as you just said and still got the pink missing-shader on the other end, hence I gave up

#

I mean, it's not really optional, if you export an assetbundle, it takes materials and shader with it. There's not really an option to exclude those things, so I can't be exporting assetbundles incorrectly. And outside of always-include and shader-variant collections (both of which don't work with URP Lit), I see no other ways to include variants of URP Lit in the build.

#

Am not making any materials in code

#

There has to be some very special thing people do with their app build to make URP Lit work with AssetBundles

#

I am sortof wondering if Addressables aren't just superior in this regard, or possibly because I'm using Unity 2021

honest halo
#

You should either upgrade to the latest 2021 version avaliable OR go to 2022 or unity 6

#

the latest version usable without other licenses

upbeat dagger
#

ah so there was a stripping bug a long time ago. That could be why. We are not on the latest 2021 version and I don't really have control over that

#

ty anyways

honest halo
#

If its causing issues like this then seems like a valid reason to update to the latest 2021 version you can

lunar shard
#

tip about shaders and addressables/asset bundles:

I build lots of bundles that are not manually placed in a scene. Meaning, I build them to be dynamically added to the scene at runtime and have a constant growing library of new ones I am adding over time.

Since Unity relies on scene settings and realtime lights, etc. to determine what shader variants to use, that means I have to first programmatically spawn a sphere for each one of my materials, place them in a scene that has all of my lighting settings, and then move a camera through that scene and spin it around as it moves so that gathers all the shader variants it sees. I do this at editor time while in play mode.

If you have many scenes that your bundles could possibly appear in that all have different lighting settings, then you would need to do it for those scenes too potentially (if they are showing up as pink in those scenes).

Then I have a shader variant collection that is not missing anything and can build proper shaders without missing any keyword combinations.

honest halo
#

that is crazy and I don't think is required at all 😆

lunar shard
#

it is, but technically doing every material probably isn't necessary, but when you have over 2,000+ props that use 800+ materials it's easier to just add them all and assume some of them are using shader features that are edge cases (as sometimes a keyword might be toggled on or off with a checkbox or something).

#

if you don't do this, Unity doesn't know your shader needs a feature the scene you are trying to spawn it in wants

#

how could it? the addressables I am building aren't in the scene yet, after all.

#

(I should mention I am loading the addressables from an external catalog at runtime, they aren't being built with the game or anything like that)

honest halo
#

You add the material and or prefab to an addressable group so unity knows it's required

#

You are overthinking this

#

It's not dumb, if a prefab depends on a material, and this depends on a shader variant it will be included

lunar shard
#

i'm not talking about anyone else's previous issue specifically

#

if you just build a prefab without it being in any scene in Unity, and that scene requires specific shader keywords, the addressable build will not include them because it doesn't know it needs to

honest halo
#

You are not understanding addressables then

lunar shard
#

i think you are not understanding addressables

honest halo
#

Scene build list and resources are the two ways to have assets be included in a build
For addressables its if an asset is marked as addressable

#

The two systems do not mix because asset bundles cannot ref things in the build, ONLY in that same bundle or other bundles.

lunar shard
#

we're saying the same thing, but you're saying that my prefab (which is not inside of any scene) will know what shader keywords to include

#

and I am saying it will not

#

I know from experience

#

you can get lucky and there will be no problem, but you also can get unlucky. it really depends on how complex your keyword combinations get.

honest halo
lunar shard
#

i tried this and it did not work

#

but I acknowledge the documentation does say that

#

I can't say why it didn't work, just that it did not (for me)

#

the only thing that did work was creating this massive shader variant collection and telling Addressables to reference it during the build

honest halo
#

I do acknowledge that it can be super annoying at times and tbh I think its all down to the massive flaws that asset bundles have .
Yes the shader variant asset is a reliable way to also ensure variants are included.

lunar shard
#

(I am also doing Entity Graphics rendering, which has a lot of special keywords)

#

I'm not exactly sure which combinations were missing for me for so long

#

also I hate the UI for shader variant collections

honest halo
#

Ah I have not used entity graphics with it but I can imagine its worse

lunar shard
#

I'm not certain entity graphics is to blame, I think I was running into this before switching to it as well

#

i'm convinced it was lighting data being stripped, as you suggested with your link

lunar shard
#

gather all the variants yourself and it should work then, at least it did for me

#

I don't know how many people use Addressables like I do, though

#

there's so many different ways to make and use them

#

I believe using GPU Resident Drawer uses the same or similar keywords as Entity Graphics, btw, for people who use that

#

(it's quite good, highly recommend GPU Resident Drawer if you can use it)

honest halo
#

realtime and baked light will have their own variants so it should contribute

#

unlit is simpler as we do not have lights to consider

lunar shard
#

yeah I assume unlit is immune to these problems

#

but I'm not certain

#

you were right to say that just including materials and shaders in an addressable build does bring along a lot of the right keyword combinations, just not necessarily all of them if you are someone who still runs into issues of pink shaders

honest halo
#

I usually had the before mentioned settings changed as well as a light in a scene already so perhaps that was enough

broken wolf
#

I keep getting the same error for loading my addressables during a cloud build:

[Error] OperationException : CheckCatalogsOperation failed with the following errors:
RemoteProviderException : TextDataProvider : unable to load from url :
"My Bucket URL"
UnityWebRequest result : ProtocolError : HTTP/1.1 400 Bad Request

This error doesn't happen on a regular build, only on a cloud build. And I have no idea why.

honest halo
#

Which is very wrong and a placeholder

broken wolf
#

No There is a URL there, I just removed it since i thought potentially it could be sensitive info idk

#

Its pointing to my bucket URL

#

It works fine on a regular build. Its just on a cloud build where it doesnt work

honest halo
#

ah well that wasn't clear

#

I can only presume some authorisation is required for this request,~~ Im not familiar what CheckCatalogsOperation even does (is this to upload it or get it?)~~

#

Im more confused, why is this happening during a build

broken wolf
# honest halo Im more confused, why is this happening **during** a build

Sorry, It happens in my loading screen from my cloud build, CheckCatalogsOperation supposedly checks for updates. I have a similar project where I've succesfully managed a cloud build and im trying to compare the two to see why one works and one doesnt. The only difference i found is that this was UNCHECKED on the working project, But CHECKED on the unworking project. Which makes no sense to me since they both are using CCD. And the working project Ive tested with other people downloading the cloud build and it works fine, Even when I make updates it works find for them. For some reason the unworking project is causing issues and I'm unsure why.

broken wolf
honest halo
broken wolf
#

No I'm using the automatic path from the CCD package

honest halo
#

Hmm I have no idea why it would suddenly change when using cloud build (unless it is altering some settings before building)
Ive only worked with s3 with addressables myself

broken wolf
#

But if i do a fresh CCD build then build the client it works fine

honest halo
#

I wonder if the files are just missing but id expect 404 then

broken wolf
#

Im getting a 404

#

Oh no sorry its just a 400 all round

#

Is there a way to refresh addressables Like refresh the package from scratch. Can i just remove the package and put it back in?

honest halo
#

That is not committed so won't really matter

#

It's in Library/PackageCache

upbeat dagger
#

but very hard to have a scene that contains every possible variant when your studio is remote/distributed

#

btw, you describe how in your case bundles are added dynamically, forgive me i am learning about this stuff, but I thought this is normal for assetBundles/addressables, that their purpose is for pipelines where the assets aren't present in the build

#

i can't imagine a scene that has every possible variant of a URP Lit material lol

upbeat dagger
honest halo
#

Well things have to be addressable to be loadable via the system, a prefabs dependencies are included anyway so the only point of adding a material explicitly is if you do want to load that or ensure certain variants are "in use"

upbeat dagger
honest halo
#

well that doesnt matter, we only care about variants we want to use

upbeat dagger
#

it's just not always knowable by those who are creating the bundles for the app

#

nor the maintainers of the app

honest halo
#

Most normal use will be fine (e.g. someone makes some prefab and makes it addressable)

upbeat dagger
#

I have a possibly dumb question. What does normal use for addressables/assetBundles look like? I've only worked for 2 companies that use them so far, and in both cases it has been a decentralized workflow where production lines produce 3D assets for small, generic experiences. Viewing content in AR for promotional purposes, or viewing collectible NFTs.

How else are they used? Are people using assetbundles/addressables for online games similar to like FIFA, CoD, Fortnite etc?

#

just, from my experience so far, the people producing asset bundles are MILES apart from the people who maintain the app/build and barely have passages available to communicate their requirements to each other

#

which is what I have begun to think addressables were for, if I was to make an app that already had content in the build, it sounds to me like it defeats the decentralized quality that assetbundles bring to the table

honest halo
#

I used it for all asset loading tasks. Originally it was because you can easily have remotely hosted content with addressables.
Its easy to make something addressable and its simpler to configure an address to some asset in some configuration.

upbeat dagger
#

So lends itself well to online games?

honest halo
#

no, its useful for local asset loading but also having remotly hosted content that you want to be able to update at anytime or just have the user download later

upbeat dagger
#

or you mean even mostly offline singleplayer games can benefit too by perhaps only loading content needed for where the player is up to

#

like no need to load volcano assets for the app if the player is on the underwater level

honest halo
#

erm no

upbeat dagger
#

keep build-size down

honest halo
#

its when build size is an issue yes (common with mobile games)

upbeat dagger
#

right so you might update tank-skins for a tactics game at any point in the future, and you'd like to do so without players needing to grab a full app update

honest halo
#

well most good platforms like steam do partial updates so its not always better but yea you can alter content in remote bundles without needing a new game build

upbeat dagger
#

ok, just thinking how i might apply these to more centralized projects. I have an indie game that could make use of it

lunar shard
#

Asset bundles are very old, and addressables are about...seven-ish years old?

#

Asset bundles were originally for keeping mobile app store download sizes down, yes.

#

They were only able to be built using scripts for years and years.

Addressables eventually shows up on the scene and gives it settings and a UI and such.

I think the most "normal" use of addressables is creating one big bundle/catalog with everything your game has in it when you first launch.

And then later, creating one big bundle/catalog for each DLC or content patch you release that only contains those assets and nothing from the original big bundle.

lunar shard
# upbeat dagger I think this is not practical in an enterprise. Some of this advice works fine w...

I see in a later post you talk about communication problems. And I agree. If you have a big organization with teams making lots of new scenes with new lighting configurations and not telling anyone this would be a bear to keep up with.

But, a lot of it could be automated from a continuous integration build tool (github actions, Jenkins, etc.) and how you set your project up.

"oh a new scene was committed. Time to run the shader variant gathering script and rebuild the shader variant collection if it has new keyword combination entries we have never seen before"

As an example.

honest halo
#

You should make use of groups where it makes sense (especially when you have remote groups)

upbeat dagger
#

ty for explaining all that. Though to show my ignorance, even though apps always start with this initial download the first time you open them, I never understood making the initial content a download from within the app.

If the goal is to make the app size smaller, isn't that completely negated by the fact the app has to download and cache assets when it first loads anyway? All it does it make the app look smaller on the app store, in practice it's still a big app.

honest halo
lunar shard
#

also, early app store days may have had strict app size requirements, unsure. And mobile internet really sucked back then.

#

I've never released anything on the app store myself, so don't know all the requirements

#

but iOS basically dictated how it all worked since most paying customers were there

broken wolf
#

Does someone answer a couple of questions about CCD for me?
Does it need to create a new bucket for each device? I.e. android, windows, IOS?
If so, do I then need to make a fresh build to CCD for each device?
If so so, Is there a way to automate this process when I do a regular build, or only via cloud build?

next hedge
#

@broken wolf No separate buckets needed per device. One bucket works for all platforms.
No fresh builds per device. Build once, all platforms use the same CCD content.
Automation options:
Unity Cloud Build (easiest)
CCD CLI in CI/CD pipelines
Custom editor scripts
Build once -> upload to CCD -> all devices can access.

broken wolf
#

So how come when I switch to android platform and build to CCD, it automatically creates a new bucket, it still has the same project ID but it's under android, and the other bucket is standalone windows.

Also when I try and load the data, if I didn't build to CCD from the Android version, I get an error 400 bad request, or sometimes error 404.

#

@next hedge Like this

next hedge
next hedge
broken wolf
next hedge
#

Web Dashboard:
Go to CCD → Find bucket → "Promote" to other platforms

CLI:

ccd management copy-bucket --source WINDOWS_BUCKET --dest ANDROID_BUCKET

API:

ManagementSdk.PromoteBucketAsync(sourceId, destId);

Dashboard = easiest.

turbid canyon
#

Hi guys, I need some help, I'm struggling to have remote addressables up and running 🙁
I configured a remote group, generated the .hash, .bin and .bundle files, uploaded to my server, downloaded it (calling the url manually) but I cannot see my asset changing.
What I'm doing:

  • I have a Ferrari model (just an example) and it's marked as an addressable.
  • Then I go to Addressables Groups -> Build -> New Build -> Default build script.
  • It generates the catalog_0.0.1.bin, catalog_0.0.1.hash, and some *.bundle files.
  • I send all of them to my API server and they are available on the internet.
  • I generate an Android Build, install the .apk on my smartphone.
  • I open up the game and I can see the Ferrari in the game, cool.
  • Go to Unity, replace the Ferrari by a Porsche (keep the same address and name, I only replace the file using Windows Explorer).
  • Then I go to Addressables Groups -> Build -> Update a Previous Build.
  • Grab the new catalog_0.0.1.bin, catalog_0.0.1.hash, and some *.bundle files and replace all of them in my API server.
  • Open the game and I still see the Ferrari and not the Porsche 🙁

Why is this happening? Any clue?
If you need more info, let me know. I've also tried million different stuff, e.g., bumping the version from 0.0.1 to 0.0.2, changing the bundle mode to pack separately, clearing the build cache.
I'm using the Addressables version 2.7.4

Thank you!

#

I also tried this code below, it always goes to the [BootstrapManager] No catalog updates found., even though if I open the .hash file the hash value is different from the previous .hash file.

private IEnumerator InitializeAddressablesAsync()
{
    Debug.Log("[BootstrapManager] Initializing Addressables...");
    var initHandle = Addressables.InitializeAsync();
    yield return initHandle;

    Debug.Log("[BootstrapManager] Checking for catalog updates.");
    var updateHandle = Addressables.CheckForCatalogUpdates(false);
    yield return updateHandle;

    if (updateHandle.Status == AsyncOperationStatus.Succeeded && updateHandle.Result != null && updateHandle.Result.Count > 0)
    {
        Debug.Log($"[BootstrapManager] Found {updateHandle.Result.Count} catalog(s) to update...");
        var updateCatalogs = Addressables.UpdateCatalogs(updateHandle.Result);
        yield return updateCatalogs;

        Debug.Log("[BootstrapManager] Catalogs updated successfully!");
    }
    else
    {
        Debug.Log("[BootstrapManager] No catalog updates found.");
    }

    Addressables.Release(updateHandle);
}
honest halo
turbid canyon
#

And I added some config to not cache it

honest halo
#

Okay but all it needs to do is serve files so any web server will do

#

Did you restart the game to see if it downloaded the new catalog then?

turbid canyon
honest halo
#

And you uploaded the catalog and catalog hash files with the bundles?

turbid canyon
#

I've just download the hash in my API, this is the content 3676da828dd4900227b786a4ddec3bfd.
I changed the model in Unity again, clicked on Update previous build and now it generated this hash 272e6664f04cb40f5dc07f99cf895216

#

I can send this to the server and nothing is recognized on my app

turbid canyon
#

now it's using timestamp because I removed the hardcoded 0.0.1 from addressable settings

honest halo
#

The version has to be the same

#

So if it changed from what was in the build has it won't work

turbid canyon
#

it has the same, I generated a new .apk to test with timestamp (I'm already desperate, trying to fix it for 4 days already)

#

But I can do it one more time, I'm gonna generate a new apk using 0.0.2 then

honest halo
#

Access the hash file from a browser to verify what is being served is the latest

turbid canyon
#

sure thing, one sec

#

it's serving the latest one

#

I'm gonna generate a new apk using the 0.0.2 name, it's more readable

honest halo
#

Yea do that, then change something and re build + upload as v 0.0.2

turbid canyon
#

And the current .hash file

#

I didn't upload the hash, bin and bundles to the server on purpose to show that's trying to retrieve them from there.

#

I've just uploaded the files to the server (without changing anything yet) and these are the android logs now.

honest halo
#

looks correct then

turbid canyon
honest halo
#

can do "update previous" for this

turbid canyon
#

Replace everything in my server, right?

#

Still no updates found and the game is using the old model 😕

#

I'm gonna download the .hash from the server to check the content

#

Left: local one generated by Unity (my computer)
Right: downloaded from the server

#

🫠

honest halo
#

Well currently it should be updating the catalog on addressables init so your log probably isnt going to help you

#

and it will init addressables anyway when first used so keep that in mind

turbid canyon
#

Avoid downloading on fly, you see?

#

only the essential stuff, model, prefabs, textures used in the gameplay itself

honest halo
#

You can do that but your provided code does not do this

turbid canyon
#

the provided code was an attempt to find where is the issue

honest halo
#

okay well tbh im out of ideas now. Are you changing an addressable asset and trying to see this change in a build?

turbid canyon
honest halo
#

you can test this all in editor too if you change the mode to "use existing bundles"

#

would require building addressable content for windows instead of android

#

also do double check you dont have Android and android or something else weird with casing

turbid canyon
turbid canyon
#

My server

honest halo
#

the web server file structure is what I mean here

turbid canyon
turbid canyon
#

And the addressable profile

honest halo
#

cool. remember most linux filesystems are case sensitive (i presume your web host is linux) so its worth thinking about

turbid canyon
#

I'll double check, thanks for the tip 😉

#

I'm already having bad dreams with Addressables lol 😅

#

4 days struggling with this

#

I gotta go now, thanks a lot again @honest halo

#

I'll test your suggestion on Windows + Unity Editor tomorrow morning and give you a heads-up. Have a great rest of your day.

turbid canyon
#

Hi @honest halo
Just to give you a heads-up, I quit Addressables and created a custom solution using only AssetBundles.
Thank you man!

honest halo
#

Both use asset bundles anyway so they share the same problems too

turbid canyon
#

I've found some people complaining about the same issue I reported and no solution

honest halo
turbid canyon
#

I've created a question on the Unity Forum, no replies yet

turbid canyon
#

Found other posts as well, but no proper answer

honest halo
#

Strange, it worked for me when I last used it. But I was aware of catching issues from cloudfront

turbid canyon
#

So it's not a caching issue on my server side

#

it seems to be some logic issue in Addressables system

honest halo
#

Odd but well it's either open a bug report or do nothing

balmy carbon
#

Can someone explain what exactly the catalog.bin file is? Im trying to work with adressables to make a game with a bunch of DLC content, so I changed the path of the addressable group for each DLC but the catalog.bin still generated only once and in its old location. What exactly does it do?

honest halo
balmy carbon
#

so its what tells unity what prefab/scene/whatever has what name?

honest halo
turbid canyon
#

@honest halo morning mate!
I solved my problem with Addressables, I think it was a misunderstanding on my part about how it works.
I had a prefab marked as addressable, e.g.:

  • Car prefab: network object, network rigidbody, network animator, ...
    • Visual model (.fbx): animator, mesh, armature, rigs
    • UI: player name

My visual model was also marked as an addressable and I was replacing the .fbx and thought it was enough, but it is not! The solution is that, I keep the .fbx model as an addressable but now, in runtime, I have a script to instantiate the model as a child of the root object, this solved my problem. The addressable system cannot detect the changes in child objects (that's what I understood from this problem).
By the way, now I no longer need to update my own AssetBundle solution, which takes time 😛
Just a heads-up for you, since you helped me a lot.

honest halo
turbid canyon
honest halo
#

If this prefab had a mesh renderer on a child gameobject then this should have worked just fine
I suspect something else was wrong but you arent able to explain this very well so lets leave it at that

turbid canyon
agile dagger
#

So, I got a show stopper bug thats completely breaking my team's ability to make our next release target. For some reason, when we build our linux server, our TarGz process is running into errors trying to process the local Addressable catalog (the one in StreamingAssets/aa). Specifically, I get a DirectoryNotFoundException: Could not find a part of the path "C:\Runner\temp\ANON\build\src\ANON\Builds\Client\LinuxServer\ANONBRANCH\LinuxServer\Server_Data\StreamingAssets\aa\Content\23afe60b606c705a9db12493ccf223c8_monoscripts_ce376555600b0674605d7e863583e51d.bundle" error and the targz that is built is corrupt. Like, proper corrupt. However, when I check the runner, these files and directories exist and are valid.

#

The TarGZ process is part of a PostBuild action, with a priority of 99999 (Should execute last)

#

Im completely stumped. Nothing I do seems to fix it, and we need to deliver a dev version Sunday. If anyone has any ideas, I will be eternally greatful. Till them Im going to keep trying more and more outlandish ideas to fix it.

agile dagger
#

Update: I think it may be caused by the actual Unity.SharpZipLib.GZip library running into max path issues

#

As the files exist on the disk and are not corrupt. Its only the zip step itself that fails

honest halo
peak kraken
#

Does anyone know why there would be so much memory used by these addressables classes? There are a fewthousand bundles in the game but there are millions of these

honest halo
peak kraken
#

I am keeping a dictionary for caching but there are only a few thousand entries in that... they are holding AssetReferences and AsyncOperationHandles however

honest halo
#

caching what? if you load something then no need to cache things needlessly

#

you can release with the object ref itself so you dont have to keep the async op

peak kraken
#

Really you can release with just the plain Unity object?

#

oh, lookling at the source code Unity just uses a cache from object to AsyncOperationHandle...

honest halo
#

Yea. Ideally you always load from addressables, use the assets and release when you are done with it

#

loading once and never releasing just wastes the ability for addressables to unload things from memory for us

peak kraken
#

yeah ,the cache is used to keep track and release when done with the handle, however I am confused about why loading a few thousand handles creates more than a million objects... something to do with dependencies maybe?

honest halo
#

well after you have used resource locations then let them get GCd

peak kraken
#

I do remove them from the dictionary so hopefully they are GC'd after that

honest halo
#

hopefully you can investigate here and see why they are still alive

#

usually you only need resource locations to avoid lookup work to load a large set of things later
e.g. get resource locations for tag, check potential download size, pre download/load now.

peak kraken
#

Thank you, I will continue to investigate

lone lynx
#

get this fool out of here.............

#

i need all unity mods to converge on this account immediately

languid widget
#

@lone lynx Please don't spam the channel with off-topic. If you have something to report use modmail with evidence attached.

lone lynx
#

my bad

sturdy gust
#

Is there a way to like link addressables between different projects? I would like too be able have it so project A can have an asset reference to an addressable that was created in project b.

honest halo
#

If you load some other projects catalog at runtime then you can just use the guid/address to load something as normal @sturdy gust

peak kraken
#

So I think I need to simplify the dependencies of these prefabs

viral seal
#

Has anybody tried to load APV data from AssetBundles?

#

And have successfully disabled streaming assets

#

But it still seems to just silently drop any tries at loading them, even when I know that an AssetBundle containing them is definitely loaded up

honest halo
viral seal
#

Thanks, I will try doing that right now

#

Didnt help, unfortunatelly :(

viral seal
#

This sounds like a Unity bug, gonna try filling it :(

steady mica
#

is there a way to build assets in addressables as different files like this (these are scriptable objects for example)

honest halo
#

but really this is the point of groups so do that

errant blade
#

Hi, I am new to addressable and i am trying to store videoclips.

I cant seem to understand why the asset bundles fail to download on build.

errant blade
final rampart
#

Looks like Invalid URI Invalid port specified.

errant blade
shrewd edge
#

hi, anyone upgrade to Unity6 and suddenly the addressables builds are placing all assets into a single folder? In 2022, It would make one folder per group when I had multiple 'pack seperately' assets in that group, now I have one gigantic folder full of hundreds of files and can't seem to find anything on google or in the settings to make it behave like it did in 2022

honest halo
shrewd edge
honest halo
#

Hmm I only used pack together and by tag and it didn't do this folder behaviour.
If you have unique bundle names I guess it can be a painful to clean out old ones?

thorny flower
#

Do I have to explicitly mark assets as Addressable and organize them in a group if I use AssetReference for each asset?
Rn I'm only marking the folder that contains them, but they don't seem to be marked. I guess I can still access them as depencies of the folder key, but I'm not sure which way is more efficient.

thorny flower
#

I’m planning to spawn each prefab randomly, so I likely don’t have to keep a reference of them all the time

honest halo
#

The asset reference inspector will show if the ref is invalid or not. If its valid there it should work fine

thorny flower
honest halo
thorny flower
#

Hm, then I guess I will go with this. Thanks

sonic pulsar
#

Hi, switching from "Use Asset Database" to "Use Existing Build" makes my grass turn into black&white and all over the place. I demonstrate it shortly in this video: https://www.youtube.com/watch?v=Rb6jmgjJHVE It's a ShaderGraph shader, and the black and white is still "swaying". I tried too many things to list, none of it helped.

Switching from "Use Asset Database" to "Use Existing Build" makes my grass turn from normal to black and white and all over the screen.

▶ Play video
thorny flower
#

Is it safe to Destroy() an instance then release its asset reference in OnDestroy()?

honest halo
thorny flower
honest halo
thorny flower
honest halo
#

Maybe this is how its meant to work with sub assets and thus shows its a bad idea to do what you are doing

thorny flower
#

No, but that would likely be a future case

honest halo
#

I wouldnt do this then

#

I believe prefabs do not handle this well, I remember freya mentioning it once 🤔

thorny flower
#

Aight, I will keep digging

thorny flower
#

I'm not sure how to look at this. The assets are loaded normally but there are no numbers.

honest halo
balmy robin
#

Hello, after loaded scene with function Addressables.LoadSceneAsync(sceneKey, LoadSceneMode.Single, true, settings.loadPriority) then we have to use Addressables.UnloadSceneAsync(sceneKey, UnloadSceneOptions.UnloadAllEmbeddedSceneObjects); to unload and release handle/asset bundle, or just load empty scene then it will automatically unload and release handle/asset bundle?

balmy robin
#

Okay, so I have to use Addressables.UnloadSceneAsync

#

Another question, does it have any functions to unload all assets which loaded from asset bundle which can skip handle/usage count?

honest halo
#

No, that isnt how addressables should be used

#

unity is tracking dependencies and bundles and handing that for you

balmy robin
#

I see, but it is really hard to make groups to make it unload asset bundle properly

honest halo
#

use more groups
change the bundle mode for the group to pack per asset or by label

balmy robin
#

Would it have any disadvantage if it pack to many asset bundles?
I think pack each mesh to each asset bundles is not sounds good.

#

Or does it have any function to get count of references by assets GUID?

honest halo
#

because if you just "want to release it X times" then you are not using addressables properly

#

the point is you load and release so unloading happens dynamically when needed

balmy robin
#

Not sure that game objects which instantiated by addressable will decrease ref count when destroyed?

honest halo
#

no you have to ReleaseInstance() which is dumb

#

so often easier to just load the prefab so you can just release that when you close/exit the scene

balmy robin
#

Okay, what if I do like this

  • I have a class which store all handles to prefabs (I plan to load asset as prefab, not instantiating by addressable's functions)
  • It have to instantiate object by those prefabs
    Then I can just release the handle to prefab or do I have to destroy all instantiated objects before releasing?
honest halo
#

If you load the prefab 1 time, you just need to release it 1 time
If you release the prefab before all the instantiated objects are destroyed you could encounter issues such as textures vanishing

balmy robin
#

Okay, so this should work for me



        AsyncOperationHandle prefabAHandle;

        public GameObject InstantiatePrefabA()
        {
            // Instantiate prefab A
            GameObject prefabA = prefabAHandle.Result as GameObject;
            GameObject instanceA = GameObject.Instantiate(prefabA);
            return instanceA;
        }

        public void UnloadPrefabA()
        {
            // Release the handle when done
            Addressables.Release(prefabAHandle);
        }
honest halo
#

So just be smart and have code to release stuff you load at the correct time

balmy robin
#

Thank you

balmy robin
#

Hello, Today I have questions again, loaded asset bundles will use a lots of RAM if there is no assets loaded from those bundles or not?

teal mortar
#

iirc depending on factors like your compression settings, unity will sometimes need to load the bundles fully into memory rather than reading from the disk on the fly

balmy robin
#

Where I can read about non recursive dependency calculation, I try to find it in manual, I am using com.unity.addressables@1.28

honest halo
balmy robin
#

Thank you, now I try to pack my assets into smaller bundles from:

- CharacterGroup
--- Character001.fbx
--- Character001.png
--- Character001.prefab
--- Character002.fbx
--- Character002.png
--- Character002.prefab
--- Character002.fbx
--- Character002.png
--- Character002.prefab

to

- Character001Group
--- Character001.fbx
--- Character001.png
--- Character001.prefab
- Character002Group
--- Character002.fbx
--- Character002.png
--- Character002.prefab
- Character003Group
--- Character003.fbx
--- Character003.png
--- Character003.prefab

Hope it will help for asset bundle unloading

#

I actually don't know how it loading catalog, I want to know if I can change catalog URL at runtime or not.

#

I noticed that monoscript always included in Default Local Group and I can change the group to remote.

honest halo
balmy robin
# honest halo You should be able to have runtime variables in the remote path too, check the d...
  1. This page (https://docs.unity3d.com/Packages/com.unity.addressables@1.28/manual/ProfileVariables.html) ?, so I can have my static class with specific remote URL, then when I can make changes to the URL, before or after initialize or anytime?

  1. I also can find AddressablesRuntimeProperties.SetPropertyValue not sure I can use it likes
AddressablesRuntimeProperties.SetPropertyValue("Reload.LoadPath", "https://www.mygame101.com/assets");

And when that I can call the function, before or after initialize or anytime?

balmy robin
balmy robin
#

Can't find The question mark icon yet, do I have to expand asset bundles to find it? or change view by to Assets to find it

#

Ahh, they are assets with italic name

balmy robin
thorny flower
#

In regard to my previous question in #💻┃code-beginner message, I did some research and currently reading that Destroy() does not unload the prefab reference from memory. I also notice a higher difference in memory resident compared to using AssetReference
So given that the dependencies in my SO are not addressables, I create them with Instantiate, do they get unload if I unload my Theme?

honest halo
#

You shouldn't need to Destroy anything and when correct releasing is implemented it should all act good. I have observed good behaviour on a game that would load many assets and release many

#

Remember that if you load the prefab via addressables then instantiate as normal then addressables just needs the prefab releasing once

thorny flower
# honest halo As long as you Release() assets you loaded and use ReleaseInstance() when we ins...

I'm just trying to understand what causes the difference in performance between 2 methods. Consider this an experiment.
In both cases, the Theme is load through LoadAssetAsync() when the game starts. For the prefab assets within:

  • AssetReference: Asynchronously loaded and release like Theme. Less memory allocated at runtime.
  • Direct reference: Since this is not supported by Addressable, I manually Instantiate() and Destroy() when not needed. According to some discussions in the community, non-addressable prefabs are not unloaded even if they are destroyed. So my guess is that the extra memory resident is caused by those 'leftover' prefabs. That includes texture, mesh, ... data. Correct me if I'm wrong.
    All that lead me to the question above.
honest halo
#

In my mind it shouldn't matter if the addressable depends on a texture or if it's a prefab -> texture

thorny flower
honest halo
#

I see no information that states that a prefab works differently to other asset types

thorny flower
#

Yeah, I have to note that duplication issue. It's getting clearer now. Thanks

honest halo
thorny flower
#

Thanks, I totally missed that

balmy robin
#

Should I store every assets into addressable group or just put prefabs then let's addressable manage it?

#

I try to reduce RAM usage, now I don't know why Remapper is using high RAM

balmy robin
#

Okay, as I try Remapper RAM usage can be reduced by not put assets into any groups

balmy robin
#

PersistentManager.Remapper in Memory Profiler

honest halo
#

Aha i see. I have never experienced issues with it, probably due to careful group design and assignment and usually using 1 bundle per group

balmy robin
#

Not sure that I should ask about terrain collider here, I want to know when load scene additively from addressable asset, with terrain collider or use mesh collider with exported mesh which one will load faster

balmy robin
honest halo
#

and all games after this addressables was used for everything (all scenes and loadable assets were in addressables)

queen shale
#

If i make animations first with sprites then put the folder with all the sprites into a sprite atlas then make that addressable then can i just have one script that loads and unloads I tested this but i didn't have to make a script to load and unload it played the animation like it didn't need to be loaded in

quartz blaze
#

Hi, Im having issues with addressables in a webgl build crashing after a few game cycles due to memory access out of bounds. Im using addressables 1.19.19 because its risky to change the editor version for this project.

  • Each level scene is bundled in their own addressable group, and Im only using Addressable.LoadSceneAsync in the project (some prefabs are instantiated by objects in the scene, but not through addressables).

  • When loading a new level, i made sure to release any unused scene AsyncOperationHandles, call Resources.UnloadUnusedAssets, and call GC.Collect. The current scene will always be unloaded by a lightweight loading scene before loading the next scene from remote.

  • from what I assume to be the webgl heap memory in task manager, the memory keeps on increasing whenever I perform a load level process, until it exceeds the maximum allowed by the browser and crash. I have not found if its possible to clear the memory manually.

Thank you for reading all these, please help me understand addressables better 😭🙏

honest halo
# quartz blaze Hi, Im having issues with addressables in a webgl build crashing after a few gam...

Web GL is special in that it cannot perform garbage collection "mid frame" because execution cannot be halted to perform the GC. Therefore unity has to wait till till certain points to perform a GC so its quite possible for too much allocation on a frame to cause an out of memory error.
Use the profiler and make sure you have an up to date addressables report so you can ensure you are releasing everything correctly and see also if you can stagger or split up some loading over many frames to allow for GC to occur.

quartz blaze
sudden galleon
#

How do I implement encryption in Addressables?

molten stone
#

My game stores 1920x1080 screenshots as level hints. There are about 91 such images. They are referenced directly as textures in a scriptable object which that is referenced at the start of the game. I don't know enough about unity's image system to know if all of them are loaded into memory instantly. I'm considering converting this into addressables.

I don't get a lag when I open it but I don't know it cause issues in low VRAM devices. Would addressable conversion be worth the hassle?

teal mortar
honest halo
#

Also because these are not POW2 they will be larger in VRAM than desired

trail crow
eternal sable
#

I keep getting errors with monoscripts bundles.

I have tried building the addressables again, clearing cache, deleting the .bin file but nothing seems to work.

gritty yacht
#

Been trying so much i made a android game and added the addressables build files into the firebase host and its working fine in the editor but still there's problem running in my android saying its invalid key and much more errors.

tiny charm
#

Hello,
I'm starting to use addressables but there is something I don't understand.

The doc says "If a scene is Addressable, you can use Addressable assets in the scene just like any other assets. You can place prefabs and other assets in the scene, and assign assets to component properties. If you use an asset that isn't Addressable, that asset becomes an implicit dependency of the scene and the build system packs it in the same AssetBundle as the scene when you make a content build. Addressable assets are packed into their own AssetBundles according to the group they're in."

But if a prefab in my scene is addressable when I'll load the scene it loads this prefab not as the real addressable for this object.
Basically in my scene I have a prefab (which is an addressable) and an object with a script that does assetReference.LoadAssetAsync<GameObject>() for the same prefab.

If I delete the bundle file for this object it puts an error for the assetReference.LoadAssetAsync<GameObject>() (which is normal) but it is still loading the object placed in the scene which is supposed to be in the deleted addressable group file.

I'm obligated to do assetReference.LoadAssetAsync<GameObject>() for all the objects in a scene ?

honest halo
#

Make sure the web server can serve the files

eternal sable
#

All of my 100 addressable groups are downloading and working fine. Monoscripts are broken.

honest halo
eternal sable
honest halo
eternal sable
#

Dunno what was a problem tho

honest halo
#

It caches weird shit so I often delete that folder before builds

fringe frost
#

Hi, I hope someone can help me.
Is it possible to get number of files in the specific folder by addressables ? I have a folder called Level as addressables key/path and there are bunch of JSON files there (They are not marked as an addressable). I already load them by addressable but I want to know the total number of those JSON files too.

teal mortar
# tiny charm Hello, I'm starting to use addressables but there is something I don't understa...

is your scene addressable? if you have a prefab included directly in the scene, it becomes a dependency for the scene's bundle, whereas an AssetReference doesn't create a dependency and only loads the required bundle when you use LoadAssetAsync. so if you delete the bundle, and your scene is loaded via addressables, you should get a depedency error (the scene can't load because the prefab is missing), but if the scene is not addressable, it'll load fine because by putting the prefab directly in a build scene, you're creating a duplicate