Ok. This is a tutorial on implementing custom footstep sounds on a custom gametype. This tutorial is being made assuming you are extending off of UTPawn classes, which I'll cover in a bit more detail. So if you want to extend other pawn classes, this should be a good jumping off point (if not just the same).
I'll also cover setting up the basic custom gametype for those who may need.
SETTING UP THE GAME TYPE
OK! First of all, set up your custom game. In your UDK folder, go to "Development" > "Src". Make a new folder and name it after your game (Such as "CUSTOMGAMENAMEHEREGame"). Now open that folder and make another folder and name it "Classes"
Now you wil have to create classes within this folder. Create a .UC and give it a name based off your game such as "CustomGame", or whatever you want to name it. This class is your game type. The code should look like this:
Save this and close it. Now create a new .UC file in the same folder and name it "CUSTOMGAMEPawn". This is your pawn. The code should look like this:
Save and close. Now create another .UC in the same folder and name it "CUSTOMGAMESoundGroup". This is the sound group for your game and where you will add the custom footstep sounds. The code should look like this as of now:
Save and close. Now create one final .UC, and name it "CUSTOMGAMEPlayerController". This class allows the player to move. The code should look like this:
Save it and close. You do not need to touch this PlayerController Class at all to get the sounds working so just leave it.
NOW! with all that set up go to your UDK Folder and open up "UDKGame" > "Config" and open up "DefaultEngine.ini". Under the section that says [UnrealEd.EditorEngine] place the following line of code at the very bottom of what is currently there:
after the equal sign is the name of the folder that you put all of your classes into. Now save and close. Lastly, Delete "UDKEngine.ini" from the Config folder. When you open UDK after this, it will remake this file with your custom game added to it. BEFORE OPENING UDK, MOVE DOWN TO THE NEXT STEP TO FINISH YOUR CLASSES
CODING THE FOOTSTEP SOUNDS!
Ok. Your first step is to open up the CustomGame.UC file (your custom game info class that extends off of UTGame). Add to the default properties so the code will now look like this:
this code of course is referencing the player controller and pawn classes you made, setting up the ability to use your custom character. Now save and close out of this class and open up your CUSTOMGAMEPawn class. Add to the default properties so the code will look like this:
after the equal sign is of course, the name of the custom sound group you made. Adding this allows you to now alter the footstep sounds.
MAIN PART OF CODING - YOUR CUSTOM SOUNDGROUP CLASS
BEFORE CONTINUING: I suggest UDK be opened for this part because you may need to use the Content Browser. When you open it, it should say the scripts are outdated. Simply hit yes allow the scripts to update.
Now open up your CUSTOMGAMESoundGroup Class. Copy the codes from the default properties section in the below example and paste them into the default properties of your CUSTOMGAMESoundGroup so it will look like this:
When you import footstep sounds into UDK and create a sound cue for them, you can do one of two things: Replace the sounds that are already in the game or add custom sounds.
If you replace the sounds that are in the game, you simply go to the code in the default properties that is in your CUSTOMGAMESoundgroup class, look at the lines that start with "FootstepSounds" and pick a line that has a "MaterialType" in it that matches what you want to replace. So if you have custom footstep sounds for walking on a metal surface imported into UDK in a sound cue, go to the line below:
in your soundgroup and change everything in between the apostrophes after "SoundCue" to the path of your sound cue. (The path can be found by hovering your mouse button over the soundcue in your content Browser. Type exactly what the path is follwed by a period and the name of your soundcue." That's it!
Now, if you want to add your own Custom sounds without removing the default sounds, You first have to import your sound and make the sound cue for it. Now you have to right click in the Content Browser and pick "New Physical Material". In this Physical Material's 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 the type of material you want to have a specific footstep sound. Say for example you made footstep sounds for walking on something made of Rubber. you would put "Rubber" as the material type then close it. Navigate to the material that you would use on this rubber object, open it, and in the Physical Material properties on the bottom plug in the Physical Material you just created. Now you have to go back to the CUSTOMGAMESoundGroup class that you created and find the footstep sounds. Copy and paste the bottom part of the footsteps section that starts with "FootstepSounds[10].
When you paste this in, the first thing you have to do is change that "[10]" to "[11]". This is the array number for the footstep sounds, and whenever a new one is added instead of replacing an existing one, this number must go up by 1 each time. Continuing with our example, the material type in this line should then be changed to "Rubber" (which, when you make your own, can be anything else you want) Then change the sound cue path the sound cue for your footsteps, save and close. Now all you need to do is close out of UDK, open it back up to rebuild the scripts. After all the scripts have updated, open UDK and load your map. Go to "View" > "World Properties" and expand the "Game Type" Tab. Change both drop down menus (Or one if you are on an older version of UDK) to the name of your custom game so it will use your custom Pawn and sounds. Add your materials with the custom Physcal Materials attached to something in the level and walk on it to test out your new footstep sounds!
I'll also cover setting up the basic custom gametype for those who may need.
SETTING UP THE GAME TYPE
OK! First of all, set up your custom game. In your UDK folder, go to "Development" > "Src". Make a new folder and name it after your game (Such as "CUSTOMGAMENAMEHEREGame"). Now open that folder and make another folder and name it "Classes"
Now you wil have to create classes within this folder. Create a .UC and give it a name based off your game such as "CustomGame", or whatever you want to name it. This class is your game type. The code should look like this:
Code:
Class CustomGame extends UDKGame; defaultproperties { }
Save this and close it. Now create a new .UC file in the same folder and name it "CUSTOMGAMEPawn". This is your pawn. The code should look like this:
Code:
Class CUSTOMGAMEPawn extends UTPawn; defaultproperties { }
Code:
Class CUSTOMGAMESoundGroup extends UTPawnSoundGroup; defaultproperties { }
Save and close. Now create one final .UC, and name it "CUSTOMGAMEPlayerController". This class allows the player to move. The code should look like this:
Code:
Class CUSTOMGAMEPlayerController extends UTPlayerController; defaultproperties { }
NOW! with all that set up go to your UDK Folder and open up "UDKGame" > "Config" and open up "DefaultEngine.ini". Under the section that says [UnrealEd.EditorEngine] place the following line of code at the very bottom of what is currently there:
Code:
+ModEditPackages=CUSTOMGAMENAMEHEREGame
CODING THE FOOTSTEP SOUNDS!
Ok. Your first step is to open up the CustomGame.UC file (your custom game info class that extends off of UTGame). Add to the default properties so the code will now look like this:
Code:
class CustomGame extends UDKGame; defaultproperties { PlayerControllerClass=class'CUSTOMGAMEPlayerController' DefaultPawnClass=class'CUSTOMGAMEPawn' }
Code:
class CUSTOMGAMEPawn extends UTPawn; defaultproperties { SoundGroupClass=class'CUSTOMGAMESoundGroup' }
MAIN PART OF CODING - YOUR CUSTOM SOUNDGROUP CLASS
BEFORE CONTINUING: I suggest UDK be opened for this part because you may need to use the Content Browser. When you open it, it should say the scripts are outdated. Simply hit yes allow the scripts to update.
Now open up your CUSTOMGAMESoundGroup Class. Copy the codes from the default properties section in the below example and paste them into the default properties of your CUSTOMGAMESoundGroup so it will look like this:
Code:
Class CUSTOMGAMESoundGroup extends UTPawnSoundGroup; defaultproperties { DefaultJumpingSound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_DirtJumpCue' 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') JumpingSounds[0]=(MaterialType=Stone,Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_StoneJumpCue') JumpingSounds[1]=(MaterialType=Dirt,Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_DirtJumpCue') JumpingSounds[2]=(MaterialType=Energy,Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_EnergyJumpCue') JumpingSounds[3]=(MaterialType=Flesh_Human,Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_FleshJumpCue') JumpingSounds[4]=(MaterialType=Foliage,Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_FoliageJumpCue') JumpingSounds[5]=(MaterialType=Glass,Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_GlassPlateJumpCue') JumpingSounds[6]=(MaterialType=GlassBroken,Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_GlassBrokenJumpCue') JumpingSounds[7]=(MaterialType=Grass,Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_GrassJumpCue') JumpingSounds[8]=(MaterialType=Metal,Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_MetalJumpCue') JumpingSounds[9]=(MaterialType=Mud,Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_MudJumpCue') JumpingSounds[10]=(MaterialType=Metal,Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_MetalJumpCue') JumpingSounds[11]=(MaterialType=Snow,Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_SnowJumpCue') JumpingSounds[12]=(MaterialType=Tile,Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_TileJumpCue') JumpingSounds[13]=(MaterialType=Water,Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_WaterDeepJumpCue') JumpingSounds[14]=(MaterialType=ShallowWater,Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_WaterShallowJumpCue') JumpingSounds[15]=(MaterialType=Wood,Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_WoodJumpCue') DefaultLandingSound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_DirtLandCue' LandingSounds[0]=(MaterialType=Stone,Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_StoneLandCue') LandingSounds[1]=(MaterialType=Dirt,Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_DirtLandCue') LandingSounds[2]=(MaterialType=Energy,Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_EnergyLandCue') LandingSounds[3]=(MaterialType=Flesh_Human,Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_FleshLandCue') LandingSounds[4]=(MaterialType=Foliage,Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_FoliageLandCue') LandingSounds[5]=(MaterialType=Glass,Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_GlassPlateLandCue') LandingSounds[6]=(MaterialType=GlassBroken,Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_GlassBrokenLandCue') LandingSounds[7]=(MaterialType=Grass,Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_GrassLandCue') LandingSounds[8]=(MaterialType=Metal,Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_MetalLandCue') LandingSounds[9]=(MaterialType=Mud,Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_MudLandCue') LandingSounds[10]=(MaterialType=Metal,Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_MetalLandCue') LandingSounds[11]=(MaterialType=Snow,Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_SnowLandCue') LandingSounds[12]=(MaterialType=Tile,Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_TileLandCue') LandingSounds[13]=(MaterialType=Water,Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_WaterDeepLandCue') LandingSounds[14]=(MaterialType=ShallowWater,Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_WaterShallowLandCue') LandingSounds[15]=(MaterialType=Wood,Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_WoodLandCue') }
When you import footstep sounds into UDK and create a sound cue for them, you can do one of two things: Replace the sounds that are already in the game or add custom sounds.
If you replace the sounds that are in the game, you simply go to the code in the default properties that is in your CUSTOMGAMESoundgroup class, look at the lines that start with "FootstepSounds" and pick a line that has a "MaterialType" in it that matches what you want to replace. So if you have custom footstep sounds for walking on a metal surface imported into UDK in a sound cue, go to the line below:
Code:
FootstepSounds[8]=(MaterialType=Metal,Sound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_MetalCue')
Now, if you want to add your own Custom sounds without removing the default sounds, You first have to import your sound and make the sound cue for it. Now you have to right click in the Content Browser and pick "New Physical Material". In this Physical Material's 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 the type of material you want to have a specific footstep sound. Say for example you made footstep sounds for walking on something made of Rubber. you would put "Rubber" as the material type then close it. Navigate to the material that you would use on this rubber object, open it, and in the Physical Material properties on the bottom plug in the Physical Material you just created. Now you have to go back to the CUSTOMGAMESoundGroup class that you created and find the footstep sounds. Copy and paste the bottom part of the footsteps section that starts with "FootstepSounds[10].
When you paste this in, the first thing you have to do is change that "[10]" to "[11]". This is the array number for the footstep sounds, and whenever a new one is added instead of replacing an existing one, this number must go up by 1 each time. Continuing with our example, the material type in this line should then be changed to "Rubber" (which, when you make your own, can be anything else you want) Then change the sound cue path the sound cue for your footsteps, save and close. Now all you need to do is close out of UDK, open it back up to rebuild the scripts. After all the scripts have updated, open UDK and load your map. Go to "View" > "World Properties" and expand the "Game Type" Tab. Change both drop down menus (Or one if you are on an older version of UDK) to the name of your custom game so it will use your custom Pawn and sounds. Add your materials with the custom Physcal Materials attached to something in the level and walk on it to test out your new footstep sounds!
Comment