Take the 2-minute tour ×
Sound Design Stack Exchange is a question and answer site for sound engineers, producers, editors, and enthusiasts. It's 100% free, no registration required.

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?

share|improve this question
add comment

3 Answers

up vote 3 down vote accepted

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.

alt text

share|improve this answer
    
@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 Jan 29 '11 at 2:45
add comment

@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;

function Activated() { if (InputLinks[0].bHasImpulse) // Plays Sound (quick fade in) { mySoundAC.FadeIn(0.2f,1.0f); }

    if (InputLinks[1].bHasImpulse)      // Stops Sound (quick fade out)
        {
            mySoundAC.FadeOut(0.2f,0.0f);   
        }

    if (InputLinks[2].bHasImpulse)      // Fade Sound according to user defined values
        {
            mySoundAC.AdjustVolume(myFadeTime,myFadeLevel);     // (fade time (f), end volume (f))
        }

    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

// defining input links
InputLinks(0)=(LinkDesc="Play")
InputLInks(1)=(LinkDesc="Stop")
InputLInks(2)=(LinkDesc="Trigger Fade")
InputLinks(3)=(LinkDesc="Pass to Cont. Mod.")

// defining variable links
VariableLinks(0)=(ExpectedType=class'SeqVar_Float',LinkDesc="Fade Time",PropertyName=myFadeTime)
VariableLinks(1)=(ExpectedType=class'SeqVar_Float',LinkDesc="Fade Level",PropertyName=myFadeLevel)
VariableLinks(2)=(ExpectedType=class'SeqVar_Float',LinkDesc="CM Param Value",PropertyName=CMParamValue)
VariableLinks(3)=(ExpectedType=class'SeqVar_Object',LinkDesc="Target",PropertyName=Targets)

}

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

share|improve this answer
    
@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 Feb 1 '11 at 4:15
    
amazing thread guys thanks for sharing !! –  studio13 Feb 8 '11 at 4:33
add comment

@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;

function Activated() { if (InputLinks[0].bHasImpulse) // Plays Sound (quick fade in) { mySoundAC.FadeIn(0.2f,1.0f); }

    if (InputLinks[1].bHasImpulse)      // Stops Sound (quick fade out)
        {
            mySoundAC.FadeOut(0.2f,0.0f);   
        }

    if (InputLinks[2].bHasImpulse)      // Fade Sound according to user defined values
        {
            mySoundAC.AdjustVolume(myFadeTime,myFadeLevel);     // (fade time (f), end volume (f))
        }

    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

// defining input links
InputLinks(0)=(LinkDesc="Play")
InputLInks(1)=(LinkDesc="Stop")
InputLInks(2)=(LinkDesc="Trigger Fade")
InputLinks(3)=(LinkDesc="Pass to Cont. Mod.")

// defining variable links
VariableLinks(0)=(ExpectedType=class'SeqVar_Float',LinkDesc="Fade Time",PropertyName=myFadeTime)
VariableLinks(1)=(ExpectedType=class'SeqVar_Float',LinkDesc="Fade Level",PropertyName=myFadeLevel)
VariableLinks(2)=(ExpectedType=class'SeqVar_Float',LinkDesc="CM Param Value",PropertyName=CMParamValue)
VariableLinks(3)=(ExpectedType=class'SeqVar_Object',LinkDesc="Target",PropertyName=Targets)

}

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

share|improve this answer
    
The code wouldn't display properly. Select everything between: "/** Generates" and the final "}" teed –  teed Jan 31 '11 at 11:48
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.