How is sound tied to terrain textures
by Frank Sutton · in Torque Game Engine · 02/09/2006 (12:24 pm) · 9 replies
How is sound from a player (let say footsteps) tied to a terrain texture type? I know the basics from scripting point of view. Where's the link in the code? How does it work, etc?
#2
02/09/2006 (2:10 pm)
Thanks Billy. This is exactly what I've been missing. I've added the audio profile, audio description, set the player foot sounds, and nothing. Adding this makes it work. It took me a week to get this to work with the tutorial base. I could not see how footsteps were connected to the terrain. Thanks again!
#4
I haven't checked the 1.4 ,but i can make it a try if this not working for you guys.
Make some kind of tutorial from a clean 1.4.
02/09/2006 (4:55 pm)
@Eric I haven't checked the 1.4 ,but i can make it a try if this not working for you guys.
Make some kind of tutorial from a clean 1.4.
#5
What I've noticed is this:
I had them, overwrote a texture; they disappeared.
Using stock 1.3 code, I get footprints, footpuffs, but no footstep sounds.
If I put the full path in the addMaterialMapping parameters[as I've seen in several Threads], I get footstep sounds, footprints, but then my footpuffs seem to disappear.
I get footsteps when textures used aren't even referenced in the propertyMap.cs...?!?
I get footsteps when running on interior .diff structures...?!?[no reference to these textures]
all this with no source code changes...? I'm baffled about how it all works together....I thought on an earlier build, it all worked?
02/09/2006 (5:31 pm)
I am noticing the weirdest stuf with footsteps/footpuffs/textures/terrain.What I've noticed is this:
I had them, overwrote a texture; they disappeared.
Using stock 1.3 code, I get footprints, footpuffs, but no footstep sounds.
If I put the full path in the addMaterialMapping parameters[as I've seen in several Threads], I get footstep sounds, footprints, but then my footpuffs seem to disappear.
I get footsteps when textures used aren't even referenced in the propertyMap.cs...?!?
I get footsteps when running on interior .diff structures...?!?[no reference to these textures]
all this with no source code changes...? I'm baffled about how it all works together....I thought on an earlier build, it all worked?
#6
@Rex, Yep I get sounds/puffs/Interiors working out of the box (1.4) but any changes/additions to the MapProperty.cs aren't working correctly? The sound I think is an issue deeper in the TGE sound code itself. Sound dosen't work at all for me in the 1.4 tge game demo but seams to work ok in the sdk....
02/09/2006 (6:04 pm)
@Billy, That would be great to have a current 1.4 resource for this and very much appreciated. @Rex, Yep I get sounds/puffs/Interiors working out of the box (1.4) but any changes/additions to the MapProperty.cs aren't working correctly? The sound I think is an issue deeper in the TGE sound code itself. Sound dosen't work at all for me in the 1.4 tge game demo but seams to work ok in the sdk....
#7
If the foot puffs change color then you know this is working and if you get strange sound behaviors change the footstep sounds to wave files.
set some weird colors on the footpuffs like red, blue, bla bla to see if they change, something like this below.
I made this on a clean 1.4 and it worked.
02/10/2006 (3:07 am)
The only fix you need to make terrain foot puffs and sounds working is this.player.cc around line 2098 change S32 mapIndex = tBlock->mMPMIndex[0]; to S32 mapIndex = tBlock->getTerrainMapIndex(rInfo.point);
If the foot puffs change color then you know this is working and if you get strange sound behaviors change the footstep sounds to wave files.
set some weird colors on the footpuffs like red, blue, bla bla to see if they change, something like this below.
addMaterialMapping( "sand" , "sound: 0" , "color: 0.96 0.36 0.26 0.4 0.0" ); addMaterialMapping( "grass" , "sound: 1" , "color: 0.46 0.96 0.26 0.4 0.0" ); addMaterialMapping( "patchy" , "sound: 2" , "color: 0.46 0.36 0.96 0.4 0.0" );
I made this on a clean 1.4 and it worked.
#8
02/10/2006 (12:53 pm)
@billy: very cool.
#9
02/10/2006 (1:43 pm)
Thanks Billy. I'll test it out later.
Torque 3D Owner Billy L
something like this
addMaterialMapping( "sand" , "sound: 0" , "color: 0.46 0.36 0.26 0.4 0.0" );
If you now have painted the mission with the sand texture you should get the footpuff color to change and the sound .
from player.cs
sound 0 = FootSoftSound = FootLightSoftSound = datablock AudioProfile(FootLightSoftSound)
Fast Tutorial :)