Version
menu_open

Defining the contents and behaviors of Music Switch Containers

Music Switch Containers allow you to group pieces of music according to the different alternatives that exist for particular elements within a game. Each alternative is represented in the Switch Container by a Switch or state. For example, a Music Switch Container can be created for all the different types of action that can exist for your main character in the game. The container might contain Switches for fight sequences, stressful situations, and when the character is in stealth mode.

Within each Switch/State are the music objects related to that particular alternative. In this example, all the Music Segments related to fight sequences in the game would be grouped into the “Fight” Switch, all the Music Segments related to stressful situations would be grouped into the “Stress” Switch, and so on. When the game calls the Switch Container, Wwise verifies which Switch or State is currently active to determine which container or Music Segment to play.

The following illustration demonstrates what happens when an Event calls a Music Switch Container called “Character Action”. This container has grouped the music according to the different types of character action that can occur in game. In this example, there are two states: Stealth and Fight. When the Event calls the Music Switch Container, the character is in stealth mode (State=Stealth), so the music associated with stealth mode is played. A Music Playlist Container is used to group the different pieces of music within the stealth state so that different variations of the music can be played each time the character is in stealth mode.

Associating Music Switch Containers with game syncs

The Music Switch Container can be based on states, Switches, or Game Parameters. To link a Music Switch Container to a Game Parameter, you need to link a Switch Group to a Game Parameter in the Switch Group Property Editor. For more information on how RTPCs can be associated with Switches, refer to Mapping Game Parameter values to Switches.

The first thing you need to do to set up the Music Switch Container is to assign one or more Switch Groups and/or State Groups to the container. This defines the Switches, States, or RTPCs to which the music will react.

Before you can assign a State or Switch Group to the container or use RTPCs for Switches, you must create them first. For information on creating Switch Groups, State Groups, and RTPCs, refer to:

To associate a Music Switch Container with a game sync:

  1. Load a Music Switch Container into the Music Editor.

  2. Do one of the following:

    • Click the [>>] button in the top area of the editor to select a game sync.

    • Drag and drop a Switch Group or a State Group object from the Project Explorer to the top area of the editor.

Defining the behaviors of music objects within Music Switch Containers

If you are re-using different parts of your music, your Switches or states may contain several of the same music objects. If this is the case, you will need to decide what the playback behavior of these common music objects will be when a State change occurs. Depending on the situation, you may want the music object to continue playing or to stop at the next sync point and restart from the beginning.

In the following illustration, the Stealth and Stress Switches are associated with the same child playlist (S2_Playlist). When the game switches from Stealth to Stress and vice versa, you have the option to continue playing the S2_Playlist or to stop the current Music Segment at the next sync point and restart the playlist from the beginning.

To define the playback behaviors of music objects within a Music Switch Container:

  1. Load a Music Switch Container into the Property Editor.

  2. In the Play Options group, do one of the following:

    Select the Continue to play on Switch change option if you want to force the music object that is in both the source and destination Switches/States to continue playing during a change in Switch/State.

    Clear the Continue to play on Switch change option if you want the music object that is in both the source and destination Switches/States to stop playing at the next sync point and to start playing again from the beginning.

    [Note]Note

    You can define the exact sync point and use fades to make the transition seamless.

Associating music objects with States and Switches

After you have assigned one or more State or Switch Groups to the Music Switch Container, you can associate different music objects to various combinations of States or Switches within the assigned groups.

A particular combination of States or Switches, which may also include wildcards, is referred to as a path. Paths are then associated with music objects that are children of the Music Switch Container.

To assign a music objects:

  1. Load a Music Switch Container into the Music Editor.

    The State Groups and Switch Groups for this container are displayed in the Music Switch Container top area.

  2. Select one state for each State Group or Switch Group in the top area.

  3. Click the Add Path button to create an entry in the entry list.

    The entry appears in the entry list, with no object assigned.

  4. To assign a music object to the entry, click the […] button on the entry.

    The object browser appears showing the children of the Music Switch Container.

  5. Select an object, and click OK.

To assign a music objects using drag and drop:

  1. Load a Music Switch Container into the Music Editor.

    The State Groups and Switch Groups for this container are displayed in the Music Switch Container top area.

  2. Drag and drop one of the Music Switch Container's children over a Switch or state on the top area section to create an association with this children.


Was this page helpful?

Need Support?

Questions? Problems? Need more info? Contact us, and we can help!

Visit our Support page

Tell us about your project. We're here to help.

Register your project and we'll help you get started with no strings attached!

Get started with Wwise