menu
 
Version
2021.1.14.8108

2024.1.4.8780

2023.1.12.8706

2022.1.18.8567

2021.1.14.8108

2019.2.15.7667

2019.1.11.7296

2018.1.11.6987

2017.2.10.6745

2017.1.9.6501

2016.2.6.6153

2015.1.9.5624


menu_open
Wwise Unreal Integration Documentation
Splitting Switch Container Media
info Note:
This feature is only available when using Event-Based Packaging
dangerous Warning:
This feature relies on having Switch or State Value assets loaded in memory in order to load the appropriate media. The following usages would be problematic:
  • Setting states or switches using strings. If you wish to split Switch Container media, you will need to ensure the corresponding switch or state value asset is loaded, using the Load Asset Blueprint Node, for example.
  • Setting states or switches from C++. If you wish to split Switch Container media, you will need to ensure the corresponding switch or state value asset is loaded, using UE4 Asynchronous Asset Loading, for example. If you do not wish to dynamically load assets at runtime, it is recommended to deactivate the Split Switch Container Media feature.

In order to optimize memory usage, the dependencies between an Event and its media take Switch container values into consideration. For example, consider the following Footstep event dependency tree:

If the currently active level only references the Material_Dirt Switch Value (via a SetSwitch node in the Level Blueprint, for example), only the Foot_Dirt1 and Foot_Dirt2 media files are loaded to memory. If at a later time a level referencing Material_Grass is loaded, Foot_Grass1 and Foot_Grass2 are automatically loaded at the same time.

Note that this feature can be disabled in the Integration settings:

How the load and unload of media associated with switch/state value is done

In order to optimize memory usage for events that implement a Switch Container, the Split Switch Container Media Integration Setting is activated by default.

When this option is activated, the switch container tree is replicated in the event asset data. Each switch or state is associated with either children SwitchContainerData or a list of media.

When a state or switch value asset is referenced in a level, every loaded event receives a callback to load or unload media assets associated with this switch or state value, and traverses the whole dependency tree to all the loaded referenced media. When unloading, the handle to the streaming manager is released and the media is removed from memory on the next tick of the garbage collector.

This dependency tree is implemented using AkAssetDataSwitchContainerData:

AkAssetDataSwitchContainerData contains references to media files:

AkAssetDataSwitchContainerData can also contain references to other AkAssetDataSwitchContainerData. This is the case when using nested Switch containers in Wwise.


Cette page a-t-elle été utile ?

Besoin d'aide ?

Des questions ? Des problèmes ? Besoin de plus d'informations ? Contactez-nous, nous pouvons vous aider !

Visitez notre page d'Aide

Décrivez-nous de votre projet. Nous sommes là pour vous aider.

Enregistrez votre projet et nous vous aiderons à démarrer sans aucune obligation !

Partir du bon pied avec Wwise