Here is a brief tutorial on how to add custom footsteps into UDK. Before I get started please be aware that this tutorial is designed for people who have an intermediate understanding of Unreal Script and UDK. Certain aspects such as importing sound waves into UDK will not be covered in this tutorial since it should be prior knowledge on the readers end. Also note that the scripts used in this tutorial are all custom scripts but the information can applied to the default scripts UDK provides.(Note:  if you do edit the default scripts make copies of the original code prior to any alterations)

To start off in your Custom Pawn script’s default properties you will add a Sound Group Class that the pawn will reference instead of the default Sound Group Class that the UTPawn uses.( Assuming you are extending off of UTPawn). It should look something like this:

class CustomPawn extends UTPawn;

defaultproperties
{

SoundGroup'CustomGameSoundGroup'

}


Next you will need to create a new script that will act as your custom sound group that extends off the UTPawn sound group like this:

Class CustomGameSoundGroup extends UTPawnSoundGroup;

defaultproperties

{

}


In the default properties of this script is the location where you will place your custom footstep sounds that your pawn will use in the game. By default UDK comes with an array of footstep sounds that can be overridden, so for good measure I usually copy and paste the default footstep sounds present in the original sound group used by the UTPawn:

Class CustomGameSoundGroup extends UTPawnSoundGroup;

defaultproperties

{
FootstepSounds[0]=(Material,Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_StoneCue')


FootstepSounds[1]=(Material,Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_DirtCue')


FootstepSounds[2]=(Material,Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_EnergyCue' )


FootstepSounds[3]=(Material,Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_Flesh Cue')


FootstepSounds[4]=(Material,Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_FoliageCue')


FootstepSounds[5]=(Material,Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_GlassPlateCue')


FootstepSounds[6]=(Material,Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_WaterDeepCue')


FootstepSounds[7]=(Material,Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_WaterShallowCue')


FootstepSounds[8]=(Material,Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_MetalCue')


FootstepSounds[9]=(Material,Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_SnowCue')


FootstepSounds[10]=(Material,Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_WoodCue')

}


In UDK footsteps are produced and recognize by the material texture applied to the static mesh or bsp the pawn is walking on. Sound effects like footsteps are applied to material textures by a physical material as shown below:
The physical material that is applied to the material texture actually houses the location of where the custom sound group script looks at to apply the footstep sounds. Looking back at the default footstep sounds you will see that before the sound cue is referenced in the line of code, a material type is called with a unique name. This material type is what connects the sound cues present in the script to the physical material.

First create a custom physical material and in its properties, go to the very bottom and click the blue arrow on the right of "Physical Material Property" and click "UTPhysicalMaterialProperty". A section called "Material Type" should appear. This is where you put in the type of material you want to have a specific footstep sound.  For example in my game I made footstep sounds for walking in a junkyard.
I put "HeliosJunkYard" as the material type then close it. Navigate to the material texture that I’m going to use it on, open it, and in the Physical Material properties plug in the physical material I just created. Next I have to go back to the CustomGameSoundGroup script that I created and add the sound pathway to the physical material like so:


FootstepSounds[11]=(Material, SoundCue'Helios_SFX.GroundSFX.DirtFS')

(Note: keep in mind that if you have multiple footstep sound effects you will need to number them properly in an array)

Lastly with a quick recompile of my scripts my custom footstep sound is all set to be used in the game.

 


Comments

10/19/2013 11:38am

This is missing a critical piece of the puzzle. It confused me until I looked at the source code for UTPawnSoundGroup. Your code for CustomGameSoundGroup is incorrect. The material is missing an = section. It should be:
defaultproperties {
FootstepSounds[0]=(MaterialType=Stone,Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_StoneCue')
FootstepSounds[1]=(MaterialType=Dirt,Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_DirtCue')
FootstepSounds[2]=(MaterialType=Energy,Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_EnergyCue')
FootstepSounds[3]=(MaterialType=Flesh_Human,Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_FleshCue')
FootstepSounds[4]=(MaterialType=Foliage,Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_FoliageCue')
FootstepSounds[5]=(MaterialType=Glass,Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_GlassPlateCue')
FootstepSounds[6]=(MaterialType=Water,Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_WaterDeepCue')
FootstepSounds[7]=(MaterialType=ShallowWater,Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_WaterShallowCue')
FootstepSounds[8]=(MaterialType=Metal,Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_MetalCue')
FootstepSounds[9]=(MaterialType=Snow,Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_SnowCue')
FootstepSounds[10]=(MaterialType=Wood,Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_WoodCue')
}

Reply



Leave a Reply