Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
## [1.18.11] - 2021-06-15
- Improved performance of Labels popup in Groups Window.
- Added "Copy Address to Clipboard" Context menu option in Groups Window.
- Added AssetLoadMode option to AddressableAssetsGroup, adds "Requested Asset And Dependencies" and "All Packed - Assets And Dependencies" load methods.
- (2021.2+) Improved performance of copying local buld path Groups built content when building a Player.
- Removed "Export Addressables" button from groups window because it was no longer in use.
- Fixed issue where loading remote catalog from .json fails when Compress Local Catalog is enabled.
- Fixed issue where loading remote catalog from bundle on WebGL fails when Compress Local Catalog is enabled.
- Added multi-project workflow documentation
- Made CacheInitializationData.ExpirationDelay obsolete
- Improve Hierarchical Search performance in Groups Window.
- Build now fails earlier if invalid or unsupported files are included.
- Fixed issue where renaming Group and Profiles would not cancel using Escape key.
- Fixed issue where StripUnityVersionFromBundleBuild and DisableVisibleSubAssetRepresentations were not being serialised to file.
- Updated content update docs to be a little more clear
- Made ExpirationDelay on the CacheInitializationObjects obsolete
- Reduced amount of main thread file I/O performed during AssetBundle loading
  • Loading branch information
Unity Technologies committed Jun 15, 2021
1 parent 357035d commit 74ca2a7
Show file tree
Hide file tree
Showing 45 changed files with 1,362 additions and 275 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,24 @@ All notable changes to this package will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [1.18.11] - 2021-06-15
- Improved performance of Labels popup in Groups Window.
- Added "Copy Address to Clipboard" Context menu option in Groups Window.
- Added AssetLoadMode option to AddressableAssetsGroup, adds "Requested Asset And Dependencies" and "All Packed - Assets And Dependencies" load methods.
- (2021.2+) Improved performance of copying local buld path Groups built content when building a Player.
- Removed "Export Addressables" button from groups window because it was no longer in use.
- Fixed issue where loading remote catalog from .json fails when Compress Local Catalog is enabled.
- Fixed issue where loading remote catalog from bundle on WebGL fails when Compress Local Catalog is enabled.
- Added multi-project workflow documentation
- Made CacheInitializationData.ExpirationDelay obsolete
- Improve Hierarchical Search performance in Groups Window.
- Build now fails earlier if invalid or unsupported files are included.
- Fixed issue where renaming Group and Profiles would not cancel using Escape key.
- Fixed issue where StripUnityVersionFromBundleBuild and DisableVisibleSubAssetRepresentations were not being serialised to file.
- Updated content update docs to be a little more clear
- Made ExpirationDelay on the CacheInitializationObjects obsolete
- Reduced amount of main thread file I/O performed during AssetBundle loading

## [1.18.9] - 2021-06-04
- Added "Select" button for Addressable Asset in Inspector to select the Asset in the Addressables Groups Window.
- Reduced the number of file copies required during building Addressables and moving Addressables content during Player build.
Expand Down
7 changes: 3 additions & 4 deletions Documentation~/AddressableAssetSettings.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ To access these settings, open the AddressableAssetSettings Inspector (menu: **W

When you perform a content build, the build process saves the settings needed at runtime to the `settings.json` data file. When you run your application in the Editor using the `Use Existing Build (requires built groups)` Playmode Script, you must rebuild your Addressable content to update `settings.json` if you have made changes. If you enter Play mode using the `Use Asset Database (fastest)` or `Simulate Groups (advanced)` scripts, the Addressables system uses the current values in AddressableAssetSettings, so you do not need to rebuild.

![Addressable Asset Settings Inspector](images/AddressableAssetSettings.png)<br/>
![Addressable Asset Settings Inspector](images/AddressableAssetSettingsWithPathPair.png)<br/>
*Addressable Asset Settings Inspector*

#### Manage Groups
Expand Down Expand Up @@ -41,8 +41,7 @@ The **Manage Profiles** button opens the Profiles window. You can also open the
| **Disable Catalog Update on Startup** | Whether the Addressables system should skip the check for an updated content catalog when the Addressables system [initializes](InitializeAsync.md). <br/>Note that you can update the catalog later using [Addressables.UpdateCatalogs](UpdateCatalogs.md). |
| **Content State Build Path** | The path to the folder in which to save the addressables_content_state.bin file. If empty, the file is saved to Assets/AddressableAssetsData. |
| **Build Remote Catalog** | Whether a remote catalog should be built-for and loaded-by the app. When enabled, content builds generate .json and .hash files for the catalog to **Build Path** and the Addressables system loads these files from **Load Path** at runtime. The system caches the catalog and compares the remote .hash file to the cached version to determine if the catalog itself should be updated (along with any changed AssetBundles). In order to update content in an existing, built app, you must build and host a remote catalog. Overwriting the catalog is how the app gets informed of the updated content. See [Profiles](AddressableAssetsProfiles.md) for more information of configuring build and load paths.|
| **- Build Path** | The path at which to build the content catalog for online retrieval. Typically, this path should be the same as the build path that you use for your remote Addressables groups, such as the RemoteBuildPath profile variable.|
| **- Load Path** | The path or URL from which to load the remote content catalog. Typically, this path should be the same as the load path that you use for your remote Addressables groups, such as the RemoteLoadPath profile variable. It is your responsibility to copy or upload the remote catalog files so that your app can access them at the specified location. |
| **- Build & Load Paths** | The pair of paths that determine where to build the content catalog for online retreival and the path or URL from which to load the remote content catalog. <br>For the build path, typically, this path should be the same as the build path that you use for your remote Addresssables groups, such as the `RemoteBuildPath` profile variable. <br> For the load path, typically this path should be the same as the load path that you use for your remote Addressables groups, such as the `RemoteLoadPath` profile variable. It is your responsibility to copy or upload the remote catalog files so that your app can access them at the specifiedc location.

#### Downloads
| **Property:** | **Function:** |
Expand All @@ -57,7 +56,7 @@ The **Manage Profiles** button opens the Profiles window. You can also open the
| **Ignore Invalid/Unsupported Files in Build** | Whether unsupported files during build should be ignored or treated as an error. |
| **Unique Bundle IDs** | When enabled, AssetBundles are assigned unique, more complex internal identifiers. This may result in more bundles being rebuilt. See [Content Update Workflow](ContentUpdateWorkflow.md#unique-bundle-ids) for more information. |
| **Contiguous Bundles** | When enabled, the Addressables build script packs assets in bundles contiguously based on the ordering of the source asset, which results in improved asset loading times. Unity recommends that you enable this option. However, enabling this option does result in binary differences in the bundles produced. Disable this option if you've built bundles with a version of Addressables older than 1.12.1 and you want to minimize bundle changes. |
| **Non-recursive Dependency Calculation** | Calculate and build asset bundles using Non-Recursive Dependency calculation methods. This approach helps reduce asset bundle rebuilds and runtime memory consumption. Unity recommends that you enable this option. However, enabling this option does result in binary differences in the bundles produced.<br>**Requires Unity 2020.2.1 or above** |
| **Non-recursive Dependency Calculation** | Calculate and build asset bundles using Non-Recursive Dependency calculation methods. This approach helps reduce asset bundle rebuilds and runtime memory consumption. Unity recommends that you enable this option. However, enabling this option does result in binary differences in the bundles produced.<br>**Requires Unity 2019.4.19f1 or above** |
| **Shader Bundle Naming Prefix** | Sets the naming convention used for the Unity built in shader bundle at build time.<br/>The recommended setting is Project Name. |
| **- Shader Bundle Custom Prefix** | Custom Unity built-in shader bundle prefix that is used if AddressableAssetSettings.ShaderBundleNaming is set to ShaderBundleNaming.Custom. |
| **Mono Bundle Naming Prefix** | Sets the naming convention used for the MonoScript bundle at build time. A MonoScript contains information for loading the corresponding runtime class.<br/>The recommended setting is Project Name |
Expand Down
6 changes: 5 additions & 1 deletion Documentation~/AddressableAssetsProfiles.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ Once you set up the necessary variables in your profile, you can select the buil
To set your build and load paths:

1. Select an Addressable Assets group from the **Project** window.
2. In its related **Inspector** window, under **Content Packing & Loading** > **Build and Load Paths**, select the desired variables from the currently set profile in the drop-downs for **Build Path** and **Load Path**. <br/>Notice that you do not enter the path directly, but rather select the variable representing the path defined in the **Profiles** window earlier. Once selected, the path displays under the drop-down but is not editable here. <br/>Be careful to ensure the build and load paths are a matched pair. For example, if you are building to the local path, you cannot load from a server.
2. In its related **Inspector** window, under **Content Packing & Loading** > **Build and Load Paths**, select the desired variables from the currently set profile in the drop-downs for **Build Path** and **Load Path**. <br/>Notice that you do not enter the path directly, but rather select the variable representing the path defined in the **Profiles** window earlier. Once selected, the path displays under the drop-down but is not editable here. <br/>Be careful when utilizing the `<custom>` setting and ensure that the build and load paths are a matched pair. For example, if you are building to the local path, you cannot load from a server.
![Selecting a path pair of variables.](images/InspectorPathPair.png)</br>
_Selecting a path pair in the inspector window._
![Selecting a path pair of variables.](images/InspectorCustomPathPair.png)</br>
_Selecting a custom path pair in the inspector window._

## Examples
Consider the following example, demonstrating the local development phase of your content.
Expand Down
16 changes: 15 additions & 1 deletion Documentation~/AddressablesFAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Currently there are two optimizations available.
2. Disable built-in scenes and Resources. Addressables provides the ability to load content from Resources and from the built-in scenes list. By default this feature is on, which can bloat the catalog if you do not need this feature. To disable it, select the "Built In Data" group within the Groups window (**Window** > **Asset Management** > **Addressables** > **Groups**). From the settings for that group, you can uncheck "Include Resources Folders" and "Include Build Settings Scenes". Unchecking these options only removes the references to those asset types from the Addressables catalog. The content itself is still built into the player you create, and you can still load it via legacy API.

### What is addressables_content_state?
After every content build of Addressables, we produce an addressables_content_state.bin file, which is saved to the folder path defined in the Addressable Assets Settings value "Content State build Path" appended with /<Platform>. If this value is empty, the default location will be the `Assets/AddressableAssetsData/<Platform>/` folder of your Unity project.
After every new Addressable content build, we produce an addressables_content_state.bin file, which is saved to the folder path defined in the Addressable Assets Settings value "Content State build Path" appended with /<Platform>. A new content build here is defined as a content build that is not part of the [content update workflow](ContentUpdateWorkflow.md). If this value is empty, the default location will be the `Assets/AddressableAssetsData/<Platform>/` folder of your Unity project.
This file is critical to our [content update workflow](ContentUpdateWorkflow.md). If you are not doing any content updates, you can completely ignore this file.
If you are planning to do content updates, you will need the version of this file produced for the previous release. We recommend checking it into version control and creating a branch each time you release a player build. More information is available on our [content update workflow page](ContentUpdateWorkflow.md).

Expand All @@ -48,6 +48,20 @@ As your project grows larger, keep an eye on the following aspects of your asset
* Group hierarchy display - Another UI-only option to help with scale is **Group Hierarchy with Dashes**. The option is available in the groups window under **Tools** > **Groups View** > **Group Hierarchy with Dashes**. With this enabled, groups that contain dashes '-' in their names will display as if the dashes represented folder hierarchy. This does not affect the actual group name, or the way things are built. For example, two groups called "x-y-z" and "x-y-w" would display as if inside a folder called "x", there was a folder called "y". Inside that folder were two groups, called "x-y-z" and "x-y-w". This will not really affect UI responsiveness, but simply makes it easier to browse a large collection of groups.
* Bundle layout at scale - For more information about how best to set up your layout, see the earlier question: [_Is it better to have many small bundles or a few bigger ones_](AddressablesFAQ.md#Is-it-better-t-have-many-small-bundles-or-a-few-bigger-ones)

### What Asset Load Mode to use?
For most platforms and collection of content, it is recommended to use `Requested Asset and Dependencies`. This mode will only load what is required for the Assets requested with `LoadAssetAsync` or `LoadAssetsAsync`.
This prevents situations where Assets are loaded into memory that are not used.

Performance in situations where you will load all Assets that are packed together, such as a loading screen. Most types of content will have either have similar or improved performance when loading each individually using `Requested Asset and Dependencies` mode.
Loading performance can vary between content type. As an example, large counts of serialised data such as Prefabs or ScriptableObjects with direct references to other serialised data will load faster using `All Packed Assets and Dependencies`. With some other Assets like Textures, it is often more performant to load each Asset individually.
If using [Synchronous Addressables](SynchronousAddressables.md), there is little performance between between Asset load modes. Because of greater flexibility it is recommended to use `Requested Asset and Dependencies` where you know the content will be loaded synchronously.

**Note**: The above examples are taken for Desktop and Mobile. Performance may differ between platforms. `All Packed Assets and Dependencies` mode typically performs better than loading assets individually on the Nintendo Switch.
It is recommended to profile loading performance for your specific content and platform to see what works for your Application.

On loading the first Asset with `All Packed Assets and Dependencies`, all Assets are loaded into memory. Later LoadAssetAsync calls for Assets from that pack will return the preloaded Asset without needing to load it.
Even though all the Assets in a group and any dependencies are loaded in memory when you use the All Packed Assets and Dependencies option, the reference count of an individual asset is not incremented unless you explicitly load it (or it is a dependency of an asset that you load explicitly). If you later call [`Resources.UnloadUnusedAssets`](https://docs.unity3d.com/ScriptReference/Resources.UnloadUnusedAssets.html), or you load a new Scene using [`LoadSceneMode.Single`](https://docs.unity3d.com/ScriptReference/SceneManagement.LoadSceneMode.html), then any unused assets (those with a reference count of zero) are unloaded.

### Is it safe to edit loaded Assets?
When editing Assets loaded from Bundles, in a Player or when using "Use Existing Build (requires built groups)" playmode setting. The Assets are loaded from the Bundle and only exist in memory. Changes cannot be written back to the Bundle on disk, and any modifications to the Object in memory do not persist between sessions.

Expand Down
Loading

0 comments on commit 74ca2a7

Please sign in to comment.