Lesson 6

Table of Contents

Configuring a Music Switch Container

There are aspects of gameplay that provide an opportunity for changing musical themes. For example, the status of a team’s victory versus the team’s defeat provide a great opportunity for music to accentuate the corresponding mood. But, that status needs to be communicated to the music system, which in turn needs to know how to cue the proper music while smoothly transitioning from any other music that may have been occurring at that time.

The status of the team’s victory or defeat would likely be managed by some type of system in the game engine that can then be communicated to Wwise in the form of a game call.

Oftentimes, this is accomplished using the mechanics of game states and game switches. That game call can then be used to set the status of State Groups and Switch Groups within Wwise. From there, the status of a Switch Group or State Group can then be used in conjunction with a specialized object available in the Interactive-Music Hierarchy, called a Music Switch Container. Music Switch Containers can be configured to transition between different Music Playlists or Music Segments in musically sensible ways.

You’ll use this approach to manage how music plays when the player is in standard gameplay, fighting the big boss, reaching victory…or when, sadly, being defeated while trying. You’ll also use this lesson to set the stage for Lesson 7, where you’ll go even deeper into Wwise’s powerful transition system. To provide a few more pieces to work with, the Wwise project you’ll use for this lesson has all the work you’ve done so far, as well as additional pre-built music cues you’ll be using for both this lesson and the following one.

  1. Open the Lesson 6 project.

    The project has all of the Music Playlist Containers you created earlier in this tutorial, along with some new Music Playlist Containers called Defeated, Victory, and Story. You’ll work with these new playlists throughout this and the following lessons, so go ahead and familiarize yourself with them now.

  2. Select and play each of the new Music Segments and listen to what the new segments sound like.

    Victory provides a brief celebration when you defeat the big boss and complete the map. Defeated provides a solemn mini requiem that you’ll, hopefully, not hear too often. The Story music is a musical detour that the player will take when presented with a particular gameplay scenario. You’ll be addressing the particulars of how that will work in the following lesson, but you’ll lay some groundwork for that within this lesson.

    For this lesson, your overall goal will be to hear the Combat music throughout regular gameplay, then switch to the Boss music when you reach the final room where the big nasty boss resides, and finally be celebrated with the Victory music when you teleport out of the map at the end of the level. If for some reason you fail in your quest, the Defeated music will be played to honor your courage and mourn your loss.

    To manage the transitions between these Music Playlists, Wwise uses a specialized object called a Music Playlist Container. Any Music Playlist Containers that you want to switch between need to be configured as children of the parent Music Switch Container.

  3. Select all of the Music Playlist Containers, right-click the selection and choose New Parent > Music Switch Container.

    The music you’ve been creating is designed specifically for the Wwise-201 game level in Cube, so it makes sense to indicate this in the object name.

  4. Name the new Music Switch Container Wwise 201 Music.

    Music Switch Containers have Time Settings for Tempo and Time Signature that will override those same settings in the Music Playlist Containers that are now contained within. This will cause significant issues in how Music Playlist Containers transition between each other as all of the Entry and Exit cues will no longer match the music. For this reason, you need to override the Time Settings for all of the contained Music Playlist Containers.

  5. Expand the Wwise 201 Music object, select the Boss Music Playlist Container, and, in the General tab, click the Override button for the Time Settings.

  6. Repeat this step for all of the remaining Music Playlist Containers and then collapse the Wwise 201 Music Music Switch Container.

    For all of the previous lessons, you’ve attached the Music Event to the specific Music Playlist Container you were working on at the time in order to test it in gameplay. Now, you’ll attach that same Music Event to the Wwise 201 Music Music Switch Container you just created, which will then decide which Music Segment to play based on various circumstances of the game.

  7. In the Project Explorer, click the Events tab, expand the Music Work Unit and select the Music Event.

    You see the Combat music is currently set to play as it was left in the previous lesson. It needs to be replaced with the Wwise 201 Music Music Switch Container.

  8. Click the Audio tab and drag the Wwise 201 Music Music Switch Container into the Event Action list on top of the existing Combat object.

    The Wwise 201 Music Music Switch Container will now be played when the Music Event is received by Wwise.

    While you’ve made the association between the Music Event and the Wwise 201 Music object, don’t expect to hear anything just yet.

  9. Select the Music Event.

    You see that the Play button in the Transport Control is not available. This is because you haven’t configured the Wwise 201 Music Music Switch Container to know which Music Segments should play. You’ll be configuring this in the next exercise.

    As you test your work throughout the remainder of this lesson, you’ll be playing the Music Event many times, so use the Transport’s Pin feature to ensure that the Transport Control stays focused on the Music Event as you continue to work.

  10. Pin the Music Event to the Transport Control. Go back to the Interactive Music layout.


Was this page helpful?