Jump to content

Addressables problem with 2500 terrains and help manual addressable setup


Recommended Posts

I am trying to build a 25x25 km terrain. The process works well with terrains with 2048 size which ends up with 144 terrains. With this setup, the runtime loading process freezes the game until the new chunks are loaded. To avoid this, I tried building the 25x25km world with terrains of size 512. This results in 2500 terrains. However, I could never test the performance because when I started the addressable configuration process (not addressables build process), the process goes forever. This morning, after 90 hours, I forced unity to quit immaturely. I tried to complete this process many times in the last week but I was never successful. The thing is, Gaia does what it does, the computer is not stuck, but when creating achieves of the shared assets, computer slows down more and more as more addressables groups are created, resulting in a constant delay in ETA of the process. After letting Gaia work for 90 hours, the progressbar was not even at the half way to complete.


I believe this is due to the increase of number of files (files that are very small in size) in the system. Addressable groups are created on per asset basis. But, the groups are just tools to organize the content, they work as folders in operating system for the addressable system. You can group many assets under an addressable group. When you select "Pack Seperately" for the packing options, it should produce the same result with what GAIA is trying to do now. For example, let us have Map1, Map2 and Map3 scenes for the addressables to catalog. There should only be 4 addressable groups named as Map1, Map2, Map3, and Shared Assets. I suppose this should result in less files in the system allowing the processes to work with full speed. 


Since my project requires 25x25 km wide terrain, I don't want to use SECTR to combine smaller world designs. Moreover, I did make a 25x25 km world with 2048 sized terrain chunks. It is doable. reducing terrain chunk size to 512 should change nothing except longer waiting durations. 


Now, my plan is to manually build the catalog by dragging the terrain and impostor scenes into the addressables groups window. I also tried this approach a few times but terrains did not load after building the addressables content. This is why I think when GAIA handles this process, it also assigns some references for scene loading from addressables system. Am I right? If so, can you guide me through where to find those references in the Gaia system. This is my second solution.


A third solution might be using my own addressables loading script and make adjustments on terrain loader manager for this.


Before digging deeper on this subject, I wanted to ask experts for their opinion. How should I handle this situation?

Link to comment
Share on other sites

Hi @Torbolax, the Addressable setup that Gaia creates was originally designed to do a "spatial partitioning" of the assets used  on the terrain - assets that only appear on a certain terrain are put in a certain asset bundle that only needs to be loaded as a dependency when that terrain piece is loaded. If an asset appears on two different terrains, they are being sorted in a shared bundle.
The goal was to reduce download times so that if a player e.g. enters the world on the lower left corner, only the assets used in that area are being downloaded first.
I assume what is happening in your case that due to the increasing number of bundles that are being created, the asset sorting process takes longer and longer to complete until it becomes unbearable slow.
The good news is that you can still create your addressable configuration manually as you want it, and have the terrain loader manager load the terrains in from addressables. The following should work:

1. Mark the terrain scenes found in the Terrain Scenes folder inside your session folder as addressable asset:


This should add the scenes into the addressable configuration window. It is important that the "key" to the scenes remains the default scene path like so:


2. Then select the terrain loader manager and activate the "Use Addressables" checkbox. With this box checked, the Terrain Loader Manager will now load the scenes as addressables using the path to the scene file as key.


That should be it already. If you build the addressable bundles with this config, the assets like trees, textures, etc. included in the scene files should be pulled in as dependencies, but you could also further refine the addressable configuration if needed.

Link to comment
Share on other sites

Hi, thank you for your answer. I have been experimenting a lot with Gaia and Addressables in the past few days. After doing what you described, I can build the catalog with Addressable system (without using Gaia manager), right? To do that, Play Mode Script -> Use Existing Build, then Build -> New Build -> Default Build Script, right?


Cause, this is what I am doing during this week and everything seems to be working except one terrain texture in the build. I suppose one of the textures is not loaded, maybe Addressables system can not identify it as a dependency, I don't know, but the terrain on build has black textures blending in with the others, and I guess that texture is the slope texture. I was not able to fix this in anyways. Terrains are usually using 8 or less than 8 textures as I check. More interestingly, after building the catalog, while still keeping Play Mode Script -> Use Existing Build (which will load from catalog, not from asset database) if I play the game on editor, everything seems fine. That one black texture issue on build is what I am struggling with lately. I have checked forums, but maybe I am missing something. Is there anything to do to fix that issue?


Using Unity 2021 and HDRP.

Link to comment
Share on other sites

Hi @Torbolax,


After doing what you described, I can build the catalog with Addressable system (without using Gaia manager), right? To do that, Play Mode Script -> Use Existing Build, then Build -> New Build -> Default Build Script, right?

yes, that would be the way to do it. Regarding your texture issue: Are you using GTS or an alternative terrain shader by any chance? For GTS we just released an update a couple of days ago that allows you to do a initialization of global shader settings before a terrain is being loaded from and addressable setup, please see this thread for more:


If this does not help or you are using another 3rd party terrain shader, try to create a development build to see if you see any error messages in the runtime console in the build. You could also try to record a shader variant collection and include that into your addressable configuration before you build the addressable bundles.

You could check the addressable bundle contents with the "Analyze" window to check if you see any irregularities there (e.g. that the faulty texture is missing in there)

If that does not help, you would probably need to write out debug information about the faulty terrain to figure out what the difference might be vs. the working textures, e.g. by writing out info about the terrain layer prototypes.

Link to comment
Share on other sites

Hi. Thank you for your reply. I am not using third party terrain shaders. Just HDRP Terrain Lit. I did the addressable analysis and I can locate the texture there. I can also get the name of the missing texture in debug line when loading from catalog (not using asset database) in editor. Strangely, when loading from asset database, everything works fine. On detail I have to mention on my setup: I have a start scene and that is the only thing on build settings. Then, pressing the map button loads the map scene from addressables. That is the root scene for gaia and terrain loaders load terrains after that scene is loaded. Not sure if this is affecting or not.


One used has a forum entry mentioning the same problem. It is mentioned there that they could only fix the issue by starting a brand new project, installing gaia and other assets, and rebuilding the setup. That is the only thing left I can try, now. I am out of options.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Tell a friend

    Love Canopy - Procedural Worlds? Tell a friend!
  • Need help?

    We work with some of the biggest brands in global gaming, automotive, technology, and government to create environments, games, simulations, and product launches for desktop, mobile, and VR.

    Our unique expertise and technology enable us to deliver solutions that look and run better at a fraction of the time and cost of a typical project.

    Check out some of our non-NDA work in the Gallery, and then Contact Us to accelerate your next project!

  • Create New...