Blog homepage

Event-Based Packaging Process Overview

Game Audio / Wwise Tips & Tools

What is Event-Based Packaging?

Not long ago, the UE4 Integration of Wwise 2019.2 launched a new asset management workflow called Event-Based Packaging, or EBP for short. Compared with the traditional SoundBanks workflow, this new pipeline is characterized by event packaging, that is, the resources of each event are packaged into an individual SoundBank.

Why would you want to do this? The reason is that in Wwise's traditional pipeline, the user is left to decide how to organize SoundBanks. In larger projects, this organization often takes a lot of time. And because it is manually organized and managed, redundancy is almost inevitable when loading resources. In the new EBP workflow, the resources corresponding to each event are automatically packaged into a SoundBank and stored in the .uasset of the event. When the event is called, only the corresponding media resources are loaded, effectively only loading as many resources as needed. This also means that the occurrence of resource redundancy is fundamentally eliminated. And since each SoundBank only contains the resources of one event, they can be flexibly unloaded without worrying about other events losing access to a resource.

This article will introduce some key resources used in the EBP workflow and their loading process, helping everyone better understand the new pipeline.

EBP and WAAPI

To make automatic packaging based on events in UE4 work, it is necessary to obtain the Event and the corresponding relationship between the Event and the sound media. In this process, the EBP pipeline is dependent on WAAPI. WAAPI means Wwise Authoring API, which is an API that allows external applications to communicate with the Wwise Authoring tool. Users can control the Wwise Authoring tool by calling these APIs, so WAAPI can also be understood as a bridge between the UE4 project and the Wwise project.

When you create an Event in the Wwise authoring tool, the UE4 integration will automatically create the corresponding event.uasset after receiving the operation instruction through the registered callback function. Similarly, when the user clicks the Generate Sound Data button in the WAAPI Picker panel in UE4, the Generate SoundBanks operation will be executed in the Wwise Authoring tool. In the EPB workflow, WAAPI is used to ensure that UE4 and the Wwise project are always synchronized.

Connecting Wwise through WAAPI to generate SoundBanks is the preferred but not the only way to generate Sound Data. If you cannot use WAAPI to connect to the Wwise Authoring tool, you can click the Generate Sound Data button in the Wwise Picker window to start the generation process using Wwise Console. The generation speed is slower compared to WAAPI because it uses more system I/O calls, but the resulting assets are the same. You can also reach the Generate Sound Data dialog in Unreal's Build menu in the Audiokinetic section.

Wwise resources in UE4

In the sound development process, users can use the Event, State, Switch, RTPC, Bank, Auxiliary Bus, and Media resources in Wwise to construct and weave the sound world in the project. In UE4, these resources all exist in the form of .uasset and are stored in the Content/WwiseAudio/ folder by default. The location of the project’s Wwise resources can be configured in the Wwise Integration Settings section of the UE4 Project Settings, by modifying the “Wwise Sound Data Folder” setting.

The following table lists the corresponding classes of Wwise resources and where they are stored in the UE4:

TYPE CLASS PATH
Bank UAkAudioBank Content/
RTPC UAkRtpc Content/WwiseAudio/Game_Parameters/
State UAkStateValue Content/WwiseAudio/States/
Switch UAkSwitchValue Content/WwiseAudio/Switches/
Event UAkAudioEvent Content/WwiseAudio/Events/
InitBank UAkInitBank Content/WwiseAudio/
Auxiliary Bus UAkAuxBus Content/WwiseAudio/Master-Mixer_Hierarchy/
AcousticTexture UAkAcousticTexture Content/WwiseAudio/Virtual_Acoustics/
Media UAkMediaAsset Content/WwiseAudio/Media/
ExternalSource UAkExternalMediaAsset Content/WwiseAudio/ExternalSources/
Localized UAkLocalizedMediaAsset Content/WwiseAudio/Localized/

 

Wwise

Derived from the above resources, these derived classes need to be reserialized to turn themselves into objects. Deserialization refers to the process of converting a byte stream into an object in memory. The following figure is a class diagram of all Wwise resources. You can see the derivation of all resources:

In the game, developers can load these through resource references and C++ code. For objects dragged and dropped in the scene or resources referenced through the Component property, when the Component object is instantiated, the Wwise resources in it will also be loaded. In addition, these resources can also be loaded by calling the LoadObject() function in the UE4.

In the editor, the task of loading resources derived from the UAKAudioType class is completed by the AkAssetDatabase class, and its constructor will register the three events onAssetAdded, onAssetRemoved, and onAssetRenamed. Among them, onAssetAdded is responsible for handling the loading of all resources. In fact, when you open the UE4 engine editor, all Wwise resources for the current map are loaded.

The loading of a media.uasset is carried out with the instantiation of an event.uasset. We will discuss in detail the loading process in a later section. Next, let’s take a look at the two most important resources, which are events.uasset and media.uasset.

Event-Based Packaging Process Overview

The resources that users interact with the most are the various events in the game. There is a one-to-one relationship between events in the Wwise Authoring tool and event.uasset resources in the UE4 project. Events are used to perform actions such as playing, pausing, setting a Switch or a State. In EBP, each event.uasset contains an Event’s content for all platforms defined in the Wwise project. The key information is the SoundBank and media resource paths that the Event depends on. There is only Event and Structure data in the SoundBanks, not the media resource itself, so the event.uasset file size is only a few KB. The media resource path is the basis for finding and loading media resources.

The content of media.uasset

Different Events sometimes refer to the same audio file. This is very common, but it can lead to resource redundancy. In order to implement the sharing of sound files between event.uasset, all the media are stripped from SoundBanks and are stored separately in the Content\WwiseAudio\Media\ folder by default. According to the organization method used in the Wwise Authoring tool, each Audio Source that the Event depends on corresponds to a media.uasset file. As described for event.uasset, media.uasset files include the contents for all platforms in one file. When the user adds a new platform, the file size of media.uasset will increase as that platform’s media is added to the file.

Media resources are named by ID. If you want to find the corresponding MediaName, you can browse Content\WwiseAudio\Media in UE4's Content Browser and display it in Columns.

The loading process of Wwise resources

Now that we understand the contents of the two most important resources, event.uasset and media.uasset, let’s take a look at the steps taken to load them. Since SoundBanks and media have been stored separately, when loading resources, you need to load the SoundBank first, and then load the media it references.

Loading the Soundbank 

When using Wwise, the SoundBank that the event depends on must be loaded before PostEvent is called, and the same is true in EBP. During the loading process of event.uasset, the SoundBank will be automatically loaded, that is, all Event and Structure will be loaded. One thing to note is that in EBP, when the event.uasset is instantiated, the SoundBank has already been loaded into the memory, which means that the loaded SoundBank is in UE4’s reserved memory, not the memory reserved by Wwise. The Sound Engine will receive the memory address as an argument to the AK::SoundEngine::LoadBankMemoryView() function that loads the SoundBank.

Loading the required Media

Once SoundBank loading is complete, the media.uasset will also be loaded. This step consists of loading the media through the media resource path saved in the event.uasset. Therefore, it is located in UE4’s reserved memory like the SoundBank.

The EBP pipeline does not use PrepareEvent to load media. Instead, it provides the memory location of the media resource to the SoundEngine through the SetMedia() function. Each media.uasset will only be instantiated once, so there is no need to worry about data being loaded redundantly. 

Summary

This article briefly introduced the main resources used in the EBP asset management workflow and their loading process, hoping to help readers understand the organization of this pipeline. Being relatively new, the EBP pipeline will be updated and improved upon in subsequent releases, and hence, the contents of this article may be subject to change. Nevertheless, I believe that the automated management of SoundBanks can save considerable time and cost for the game audio development process. It is expected to become more mature and stable in the near future, bringing benefits to more game development teams.

Fan Runpeng

Field Engineer - Greater China • R&D

Audiokinetic

Fan Runpeng

Field Engineer - Greater China • R&D

Audiokinetic

A passionate advocate for topnotch middlewares and optimized workflow, who also strives to provide solutions that are feasible. At the same time, he is a field engineer who is obsessed with cooking, and loves to see technologies being shared the same way as delicacies.

Comments

Leave a Reply

Your email address will not be published.

More articles

Part 1: The spatial acoustics of NieR:Automata, and how we used Wwise to support various forms of gameplay

NieR:Automata is an action role-playing game (RPG) taking place on a wasteland that is earth, after...

4.12.2018 - By PlatinumGames

Don't Even Ask How I Did It! Instructions for the 5-Minute Entry-Level Track Swapping Challenge

Here are the steps I took during my live 5-minute challenge, along with a couple of tips about the...

28.5.2019 - By George A. Sanger

How we used AI to improve dialogue management for Pagan Online

We live in a time where research and development of artificial intelligence is gaining a significant...

6.8.2019 - By Nikola Lukić

Generating Rain With Pure Synthesis

A few years ago, I wondered whether it was possible to synthesize whatever I wanted. I started by...

30.7.2020 - By Aleksandr Khilko

A Wwise Unity Cheat Sheet

Let's talk about the Wwise Unity Integration. There are quite a few educational resources that have...

20.8.2020 - By Mads Maretty Sønderup

Authoring Plug-ins for Wwise 2021.1 | Part 1: History and Goals

One of the least known characteristics of the Wwise ecosystem is its extensibility. Companies create...

5.2.2021 - By Michel Donais

More articles

Part 1: The spatial acoustics of NieR:Automata, and how we used Wwise to support various forms of gameplay

NieR:Automata is an action role-playing game (RPG) taking place on a wasteland that is earth, after...

Don't Even Ask How I Did It! Instructions for the 5-Minute Entry-Level Track Swapping Challenge

Here are the steps I took during my live 5-minute challenge, along with a couple of tips about the...

How we used AI to improve dialogue management for Pagan Online

We live in a time where research and development of artificial intelligence is gaining a significant...