Into Sound

Jun 26 2011

UDK Audio Implementation

I recently received a copy of The Game Audio Tutorial and so far, it is AWESOME. Finally getting to see how to implement audio into a game environment is a real eye opener.

I’ve only worked through around 30 pages but I thought I’d post a video of what I’ve done so far. Hopefully this blog post will explain in more detail how exactly I’ve achieved what’s going on in the video.

So in the first video, the key points are as follows:

  • A non-spatialized sound plays when you cross the laser threshold near the crystal.
  • This sound plays indefinitely until it is told to stop.
  • The player can stop the sound by approaching the button on the wall and pressing “E”.

Look at the diagram of the Kismet to see what’s going on, then look at it again after reading the following information.

For this, firstly we need what is referred to in UDK as a Touch Trigger. The central pillar has a trigger that is activated by touch attached to it, that is, when the player crosses into a developer-defined radius around the Trigger object, the Trigger Object’s status changes to “Touched”. This is “Touch Trigger 6” in the above image.

I programmed this status to switch a Toggle to on. This Toggle outputs its status to the ToggleAble sound actor in the environment. (the alarm). The Trigger Object also has an “Untouched” status for when the player is not within the radius around it. Since I didn’t tell the untouched status to do anything, our sound keeps playing even after the player has left the radius.

The “Trigger 7 used” is a Trigger which sends out a message when the player “Uses” it. I linked this trigger to the Off status of the toggle, to turn the target sound off.

The second video uses a few different concepts. Without otherwise specifying, a sound will emanate from wherever the developer places the source. Obviously this is a problem if the sound is, for example inside a building. The player shouldn’t be able to hear that sound outside.

To get around this we use what UDK refers to as Trigger Volumes. In this case, Volume refers to a shape, and not amplitude. We create a Trigger Volume in the shape of the cafe as shown in this picture:

From this point, we can attach toggling sounds to the states of the Trigger volume, to change the ambient sound when the player is inside, and when the player is outside.

The Kismet diagram should be reasonably easy to interpret. The Trigger Volume is called “TriggerVolume0_Touch”.

The two sounds are the two different ambient sounds for each area (outdoors and inside). You can see from the Kismet image that when one sound is turned on, the other is turned off (so you won’t hear the birds indoors and vice versa).

Obviously these are just small and simple examples, and it takes a lot more than one sound to make a true ambience, but I wanted to show off what I was learning because it’s incredibly satisfying to finally be working on the aspect of game audio I hear my cohorts on Twitter talking about so often.

If anything about this isn’t clear, please contact me and I’ll try and edit it so it’s easier to understand.

Definitely my Day 12 AND Day 13 of #30daysofcreativity

2 notes

  1. anne-collins reblogged this from joecavers
  2. joecavers posted this
Page 1 of 1