버전
menu
Wwise Unreal Integration Documentation
|
![]() | 참고: | Before version 2022.1 of the Wwise Unreal Integration, this feature was called the "Split Switch Container Media". |
By default, when Wwise Event assets are loaded, all resources they might use (SoundBanks and media) are loaded with them. In deep, nested switch container hierarchies, a large number of media resources can be loaded, and the amount of memory required to load these resources increases accordingly. You can use reference-loaded switch containers on a per-event basis to optimize memory usage: when enabled, resources are only loaded if they are referenced, based on Switch or State values.
If the media in your Switch Container is streamed, which is common for large music files, this feature improves performance because the files are only opened for streaming when necessary. Memory usage is also reduced if the media has a prefetch chunk.
This feature is only available for certain Events that use Switch Containers. It provides the most benefits for Events used in several different contexts, and that only use a subset of the container's Switch values in each context.
예시:
The following image shows a Footstep Event dependency tree:
If the active level references the Human_Surface_Material Switch and only references the Material_Dirt Switch Value (through a SetSwitch node in the Level Blueprint, for example), only the FS_Dirt_[01-04] media files are loaded into memory. When a sublevel that references Material_Grass is loaded, grass_[01-04] media files are automatically loaded with the Switch.
![]() | 경고: When this option is enabled, Switch or State values are loaded in memory to determine which media to load. Be cautious in the following cases:
In addition, be careful when loading and setting Switches or States in submaps or menus. When those levels are unloaded, the Switch or State Value assets will probably be unloaded as well if they are not referenced in the persistent level, which causes their associated media to be unloaded. 이 경우 Switch나 State 값이 씬의 GameObject에 계속 설정되어 있으면 예기치 않은 동작이 발생할 수 있습니다. |
각 UAkAudioEvent 는 이 이벤트가 표시하는 해당 Wwise Event를 식별하는 FWwiseEventInfo 구조체를 포함합니다. The WwiseEventInfo structure also contains the SwitchContainerLoading field, which can enable reference-loaded Switch Container media.
When set to AlwaysLoad, the default mode for all Events, all media resources are loaded with the Event. When set to LoadOnReference, only the referenced media resources are loaded with the Event.
When this option is activated and a Wwise Event asset is cooked by the WwiseResourceCooker, its cooked data contains a set of SwitchContainerLeaves. 이 리프(leaves)는 로드할 미디어와 SoundBank에 대한 다양한 Switch(또는 State) 값 세트의 평탄화된 맵(flattened map)입니다. As seen in the previous example, the FS_Dirt_[01-04] media are only needed if the Human_Surface_Material and Material_Dirt Switches Values are loaded as well. This is represented by a SwitchContainerLeaf with a "key" formed by the pair of Human_Surface_Material and Material_Dirt switches and a payload of FS_Dirt_[01-04] media to load. Wwise Event가 WwiseResourceLoader에 의해 로드되면 해당 SwitchContainerLeaves 세트가 각 알려진 Switch와 State Value에 대해 WwiseResourceLoader가 추적하는 리프 목록에 추가됩니다. When Switch and State Values are loaded (or unloaded) by the WwiseResourceLoader, it checks its list of known SwitchContainerLeaves associated with that value to see if any media need to be loaded (or unloaded).
![]() | 참고: | 미디어 의존성은 Event, Switch, State 애셋이 WwiseResourceLoader에 의해 로드될 때만 평가됩니다. Setting and unsetting Switches or States in the Sound Engine does not cause media to be loaded or unloaded. |
When a Default Value is set on a Switch Container, the resources that only depend on Default Values are always loaded. The same behavior applies to the Generic Path that can be set in Music Hierarchy Switch Containers. In these cases, resources such as SoundBanks and Media are not put in SwitchContainerLeaves. Instead, they are always loaded with with Events that use those Switch Containers.
This system is easiest to work with when you use Blueprints and Wwise assets to post Events and set Switch and State Values. In this case, the assets are loaded in memory with the level so the WwiseResourceLoader does not miss any information. To optimize memory usage even more, you can also disable the AutoLoad property exposed by UAkAudioType, available in all Wwise assets. 이 옵션을 비활성화하면 각 애셋의 LoadData와 UnloadData 메소드(Blueprint에서 사용 가능)를 반드시 호출하여 WwiseResourceLoader가 애셋을 로드 및 언로드해야 합니다.
마지막으로 문자열을 사용하여 Sound Engine에서 Event를 게시하거나 Switch와 State를 설정할 때 WwiseResourceLoader가 필요한 리소스를 이미 로드했는지 확인하는 것은 게임 디자이너의 책임입니다. This likely requires the relevant Event, Switch Value, and State Value assets to be manually loaded (or referenced in maps or Blueprints). However, it is possible to build Switch or State Value CookedData programmatically, and then load and unload them in the WwiseResourceLoader instead of assets.
프로젝트를 등록하세요. 아무런 조건이나 의무 사항 없이 빠른 시작을 도와드리겠습니다.
Wwise를 시작해 보세요