Audiokinetic Wwise Knowledge Base

What is the difference between a State and a Switch, and when should I use one or the other?

States are global, whereas Switches are bound to game objects. Usually, use a State whenever the state of the game needs to have an effect on all sound instances. For example, the game would set the State globally on the sound engine depending on what mode it is in, so events triggered by the game would use the corresponding sound, regardless of the game object.

Consider the opposite scenario: your weapon sounds are children of a WeaponType switch container. If you can have several characters (game objects) using different weapons at the same time, then you would more likely use Switches, so that the game can select a Switch value for each individual game object.

Internally, Switch values are stored for every game object, while State values are stored once, therefore the latter option is more efficient if you don't need the flexibility of switches. Also, with a State, you can affect the properties (volume, LPF, ...) of all sound structures which are bound to it (through the State tab in the Property editor).

One last note: Music Switch Containers of the Interactive Music hierarchy are more efficient to compute music transitions when they are registered to a Switch Group, because State changes have the ability to be delayed depending on the music time (meaning more computations).


Article Details

Last Updated
26th o March, 2008

Would you like to...

Print this page Print this page

Email this page Email this page

Post a comment Post a comment

Subscribe me

Add to favorites Add to favorites

Remove Highlighting Remove Highlighting

Edit this Article

Quick Edit

Export to PDF

User Opinions (0 votes)

No users have voted.

How would you rate this answer?



Thank you for rating this answer.

Related Articles

No related articles were found.

Attachments

No attachments were found.

Continue