4

1

Im used to creating an Engine for a vehicle/ship in Wwise or Fmod where you can pull velocity variables to crossfade between engine loop speeds. Even start and stop with a skid sfx if you wanted. Furthermore, to process it with EQ's and other DSP given other variables as well.

In UDK, I have pulled velocity information to determine whether or not a swimming loop plays in water if you are moving or standing still. This was done in Kismet and not the Cue Editor.

So I am a bit stumped in UDK how to create an adaptive engine noise. Is there a way to crossfade between audio loops? Do I need to use Kismet again or can I use solely the Cue Editor? Right now I just have figured they limit you to 1 engine loop, and a start and stop sound.

Any ideas?

3

The best way I have found to make an engine loop in a UDK soundcue is through a combination of concatenators and continuous modulators. The concatenator node will trigger one sound after another so use this to transitions between your start and engine_idle. Or have start and engine_loop trigger separately from code.

To loop and pitch your engine use a looping node and continuous modulator into the second input of the concatenator. The continuous modulator uses a float parameter that can be changed from code to drive pitch and volume. This node has Min/Max values for input and output, as RPM increases so does the pitch. Reference the UDK hoverboard or most vehicles for an example of how they use the continuous modulator for vehicle engines. The stop sound is triggered from a separate cue when the player leaves the vehicle.

@ChrisEngineAudio Dude, sick answer! I figured UDK would allow you to change the pitch on one loop, but I didnt know if it sounded realistic enough, hence my crossfade reference. I think this will work though since vehicles arent a primary of the games main idea. Thanks again Chris! – C3Sound – 2011-01-29T02:45:43.353

3

@C3Sound, I've been playing around with trying to crossfade different engine loops as I was disappointed with the default system in UDK of simply using a single wav and changing it's pitch and volume. The only way to modify a playing sound's volume and pitch within UDK is to use the [Modify Property] object within Kismet. The only downside to this is that it actually changes the properties of the SoundCue so unless you reset the values when then any other reference to the SoundCue will playback at the new property values.

I did come up with a different solution! I created my own Custom PlaySound object for use within Kismet. This object enables you to apply a fade to a given value over a given time by passing variables and then triggering the object. I also set it up so that if your SoundCue has a Continuous Modulator within it then you can pass additional variables from the Custom PlaySound object to the CM so that you also have control over the pitch of a sound.

here's the source code of the object so you can experiment with it. If you've not done any scripting before, just copy the following text and paste it into a text editor and save as "SeqAct_GATPlaySound.uc", then recompile your scripts. The object should appear within Kismet next time you run the Editor.

/** * * Generates Kismet errors if "Targetted" to a specific actor. * - the AudioComponent doesn't have a spatialise function by default * --- working on a fix * */

class SeqAct_GATPlaySound extends SequenceAction;

// defining variables var() AudioComponent mySoundAC; var float myFadeTime; var float myFadeLevel; var() name CMParamName; var float CMParamValue;

    if (InputLinks[1].bHasImpulse)      // Stops Sound (quick fade out)
{
}

{
}

if (InputLinks[3].bHasImpulse)      //Pass incoming value to the Coninuous Modulator (Param. defined within properties)
{
mySoundAC.SetFloatParameter(CMParamName, CMParamValue);     //CMParamName = Name within Cont. Mod.
}
}


defaultproperties { Begin Object Class=AudioComponent Name=YourSoundSound //"imports" AudioComponent functionality End Object

mySoundAC=YourSoundSound    // defines the AudioComponent

ObjName="GATPlaySound"  // the name of the object as it appears in the New Action menu
ObjCategory="GATKismetActions"  // where the object will appear within the New Action menu



}

If you have any questions about the object, I'd be happy to help out.

PS. This object was developed as part of an upcoming book I'm working on (with a colleague) called the Game Audio Tutorial - which looks at practical implementation of audio within the UDK engine. Due out 29th March. Amazon Link

Hope this helps, teed

@teed Epic. Teed - shoot me an email at ccc@c3sound.com - Let me know more about your book, ill buy it. Is it just UDK or Wwise and Fmod as well? Any other proprietary engine audio stuff? – C3Sound – 2011-02-01T04:15:10.520

0

@C3Sound, I've been playing around with trying to crossfade different engine loops as I was disappointed with the default system in UDK of simply using a single wav and changing it's pitch and volume. The only way to modify a playing sound's volume and pitch within UDK is to use the [Modify Property] object within Kismet. The only downside to this is that it actually changes the properties of the SoundCue so unless you reset the values when then any other reference to the SoundCue will playback at the new property values.

I did come up with a different solution! I created my own Custom PlaySound object for use within Kismet. This object enables you to apply a fade to a given value over a given time by passing variables and then triggering the object. I also set it up so that if your SoundCue has a Continuous Modulator within it then you can pass additional variables from the Custom PlaySound object to the CM so that you also have control over the pitch of a sound.

here's the source code of the object so you can experiment with it. If you've not done any scripting before, just copy the following text and paste it into a text editor and save as "SeqAct_GATPlaySound.uc", then recompile your scripts. The object should appear within Kismet next time you run the Editor.

/**


* * Generates Kismet errors if "Targetted" to a specific actor. * - the AudioComponent doesn't have a spatialise function by default * --- working on a fix * */

class SeqAct_GATPlaySound extends SequenceAction;

// defining variables var() AudioComponent mySoundAC; var float myFadeTime; var float myFadeLevel; var() name CMParamName; var float CMParamValue;

    if (InputLinks[1].bHasImpulse)      // Stops Sound (quick fade out)
{
}

{
}

if (InputLinks[3].bHasImpulse)      //Pass incoming value to the Coninuous Modulator (Param. defined within properties)
{
mySoundAC.SetFloatParameter(CMParamName, CMParamValue);     //CMParamName = Name within Cont. Mod.
}
}


defaultproperties { Begin Object Class=AudioComponent Name=YourSoundSound //"imports" AudioComponent functionality End Object

mySoundAC=YourSoundSound    // defines the AudioComponent

ObjName="GATPlaySound"  // the name of the object as it appears in the New Action menu
ObjCategory="GATKismetActions"  // where the object will appear within the New Action menu