T3D footstep issues [not resolved]
by Manni Medeiros · in Torque 3D Professional · 10/31/2011 (7:57 pm) · 19 replies
So i was working with a blank template but there were issues getting the sound to work and other things so i decided to play with the full template now the player datablock has sounds set for footsteps and im not hearing anything at all. If i manually play the sounds they work fine and if i use other sounds in game ex. shooting my gun it works fine. What could cause my computer to not play sounds on the full template?
Edit: I found out more! Everything seem to play fine except his footsteps, i got guns and exiting water to work fine with any sound but I am having issues with footsteps themselves could there be code somewhere i have to change to get the footsteps working?
further edit: Ok so i tried the tutorial at http://www.garagegames.com/community/forums/viewthread/112317
which should have hopefully fixed this but it still is not giving footsteps but i did not understand the part about "This works only with properly set up triggers on the player's shape" i was hoping someone could explain this better.
Edit: I found out more! Everything seem to play fine except his footsteps, i got guns and exiting water to work fine with any sound but I am having issues with footsteps themselves could there be code somewhere i have to change to get the footsteps working?
further edit: Ok so i tried the tutorial at http://www.garagegames.com/community/forums/viewthread/112317
which should have hopefully fixed this but it still is not giving footsteps but i did not understand the part about "This works only with properly set up triggers on the player's shape" i was hoping someone could explain this better.
About the author
Awkward Monkey was created by me and consists of me my wife and a few friends we are looking into expanding and love developing. Http://www.awkwardmonkey.com
#2
Just so you are aware. I am using the terrain tutorial and gideon (Solder does not have proper points for terrain sounds).
The problem im having is it will only play the sound for layer 3 (currently snow) whatever that layer is set to is the sound it plays no matter what. but I need multiple sounds for different terrains. This in theory should be possible but it is not working.
please take a look at the tutorial and the code and see what I am doing wrong as the posts i read state this should work.
11/02/2011 (6:41 am)
Ok after expanding the code i am still having an issue and was hoping someone could see what was going on. I have the code below added to materials.cs under terrain for now, and some of it is working but only part of it. Just so you are aware. I am using the terrain tutorial and gideon (Solder does not have proper points for terrain sounds).
The problem im having is it will only play the sound for layer 3 (currently snow) whatever that layer is set to is the sound it plays no matter what. but I need multiple sounds for different terrains. This in theory should be possible but it is not working.
please take a look at the tutorial and the code and see what I am doing wrong as the posts i read state this should work.
singleton SFXProfile(FootStepRock1Sound)
{
filename = "art/sound/shot.ogg";
description = AudioClosest3d;
preload = true;
};
singleton SFXProfile(FootStepSnow1Sound)
{
filename = "art/sound/orc_death.ogg";
description = AudioClosest3d;
preload = true;
};
singleton Material(Ter_Rock)
{
mapTo = "rockwall_base";
customFootstepSound = FootStepRock1Sound;
};
singleton SFXProfile(FootStepGrass1Sound)
{
filename = "art/sound/footstep_grass.wav";
description = AudioClosest3d;
preload = true;
};
singleton Material(Ter_Snow)
{
mapTo = "snow_base";
customFootstepSound = FootStepSnow1Sound;
};
singleton Material(Ter_Grass)
{
mapTo = "prairie_base";
customFootstepSound = FootStepGrass1Sound;
};
new TerrainMaterial()
{
diffuseMap = "art/terrains/Demo_world/rockwall/rockwall_base";
normalMap = "art/terrains/Demo_world/rockwall/rockwall_normal_specular";
detailMap = "art/terrains/Demo_world/rockwall/rockwall_detail";
detailStrength = "2";
detailSize = "3";
detailDistance = "250";
internalName = "Rock";
};
new TerrainMaterial()
{
diffuseMap = "art/terrains/Demo_world/snow/snow_base";
normalMap = "art/terrains/Demo_world/snow/snow_normal_displacement";
detailMap = "art/terrains/Demo_world/snow/snow_detail";
detailSize = "3";
detailStrength = "0.8";
detailDistance = "250";
internalName = "Snow";
};
new TerrainMaterial()
{
diffuseMap = "art/terrains/Demo_world/prairie/prairie_base";
normalMap = "art/terrains/Demo_world/prairie/prairie_normal";
detailMap = "art/terrains/Demo_world/prairie/prairie_detail";
detailSize = "3";
detailStrength = "2";
detailDistance = "250";
internalName = "Grass";
};
#3
In my case, I was able to import the model with animations into Ultimate Unwrap 3D app - edit the animations to include footstep triggers and then - re export.
... looks like you figured that part out though.
11/02/2011 (2:21 pm)
foot step triggers ... they are typically built into the animations, to trigger the footsteps. I ran into this when trying to get (literally) foot steps to show up.In my case, I was able to import the model with animations into Ultimate Unwrap 3D app - edit the animations to include footstep triggers and then - re export.
... looks like you figured that part out though.
#5
Edit: Currently the sounds are in material.cs as it said in the system to keep it all together and make sure its loading at the right time. The datablock shows the sounds loading so it is not the case of the stuff not loading into the datablock for sure. Maybe im missing the point.
11/02/2011 (8:42 pm)
I am using gideon which has the triggers and so that is fine. Where in player.cs do sounds go ive never seen any information on this...Edit: Currently the sounds are in material.cs as it said in the system to keep it all together and make sure its loading at the right time. The datablock shows the sounds loading so it is not the case of the stuff not loading into the datablock for sure. Maybe im missing the point.
#6
So now when i saved this another issue cropped up. The wrong sound is playing...
It is playing snow for grass texture also it is not lining up properly to what is on the terrain. I run cross rock and the sound does not change but then im back on grass i get rock's sound for a few steps then back to snow's sound.
Somthing is off here anyone got any ideas?
11/03/2011 (6:28 am)
ok so I added the sounds to the player.cs once i figured out how to do that and the code I added looks likesingleton SFXProfile(FootStepRock1Sound)
{
filename = "art/sound/shot.ogg";
description = AudioClosest3d;
preload = true;
};
singleton SFXProfile(FootStepSnow1Sound)
{
filename = "art/sound/orc_death.ogg";
description = AudioClosest3d;
preload = true;
};
singleton SFXProfile(FootStepGrass1Sound)
{
filename = "art/sound/footstep_grass.wav";
description = AudioClosest3d;
preload = true;
};So now when i saved this another issue cropped up. The wrong sound is playing...
It is playing snow for grass texture also it is not lining up properly to what is on the terrain. I run cross rock and the sound does not change but then im back on grass i get rock's sound for a few steps then back to snow's sound.
Somthing is off here anyone got any ideas?
#7
Edit: After quadruple checking my code I still cannot find an issue I've even tried changing the order where it load the while gambit but that did not help. So then i re imported the terrain one that i had not smoothed or coloured and also this did not help.
There must be something wrong inside the engine code but i dont know what it could be and it appears others have successfully got it up and running although i font know if it works with t3d 1.1 final. Can anyone let me know and show a copy of your code cause somthing is not right.
11/04/2011 (10:16 am)
After running a bunch of tests for some reason something is getting mixed up i have to map to Snow_base to get sound on the material Prairie_base And the sound is not perfect when walking on prairie sometimes the sound plays other times other sounds was to play. So what i would like to know is how the system decides this and how to manipulate this so that it is corrected. Cause there must be code somewhere else doing this.Edit: After quadruple checking my code I still cannot find an issue I've even tried changing the order where it load the while gambit but that did not help. So then i re imported the terrain one that i had not smoothed or coloured and also this did not help.
There must be something wrong inside the engine code but i dont know what it could be and it appears others have successfully got it up and running although i font know if it works with t3d 1.1 final. Can anyone let me know and show a copy of your code cause somthing is not right.
#8
11/04/2011 (11:30 am)
I have moved this thread to a more appropriate section for more exposure.
#9
11/04/2011 (12:49 pm)
What's happening in layer 3 of your terrain? I'm going to have to play with this now - you've piqued my curiosity....
#10
Layer 3 I believe ended up being a snow layer that from what i can tell looks like the other layers so i don't really know but if you follow the tutorial you get what i got except i did some leveling to the terrain to add a town. The leveling was at a height of 15 and then I painted some of the rock to grass and added the sounds. So as you can see its pretty easy to follow.
Edit I did a few tests using a flat plane with the materials to see what would happen. It appears to play the layer 3 material every time so you can reorganize your materials to make any of the sounds play in the terrain painter and this actually changes the sound playing but is not practical for changes in game.
Now looking at this information, I am wondering if the issue is in the demo I used to create this terrain. I don't know if something specific is needed for footsteps that was not in the demo or if it should just work. Hopefully someone will know.
11/05/2011 (12:50 am)
Honestly Richard you just lost me. Follow the terrain tutorial and you will see what I got. Im not a super t3d guy just yet so a lot of the stuff just goes over my head, lolLayer 3 I believe ended up being a snow layer that from what i can tell looks like the other layers so i don't really know but if you follow the tutorial you get what i got except i did some leveling to the terrain to add a town. The leveling was at a height of 15 and then I painted some of the rock to grass and added the sounds. So as you can see its pretty easy to follow.
Edit I did a few tests using a flat plane with the materials to see what would happen. It appears to play the layer 3 material every time so you can reorganize your materials to make any of the sounds play in the terrain painter and this actually changes the sound playing but is not practical for changes in game.
Now looking at this information, I am wondering if the issue is in the demo I used to create this terrain. I don't know if something specific is needed for footsteps that was not in the demo or if it should just work. Hopefully someone will know.
#11
So, I think that in your material you would define something like
And then in your PlayerData add a field FootSnowSound = FootStepSnow1Sound;
I found some info while editing docs and thought of your issue - hope it is helpful.
11/09/2011 (10:31 am)
Check out PlayerData::FootHardSound, FootMetalSound, FootSnowSound, FootSoftSound and materials - FootHardSound plays on materials with footstepSoundId 1, metal is 2, snow is 3 and soft is 0So, I think that in your material you would define something like
new TerrainMaterial()
{
diffuseMap = "art/terrains/Demo_world/snow/snow_base";
normalMap = "art/terrains/Demo_world/snow/snow_normal_displacement";
detailMap = "art/terrains/Demo_world/snow/snow_detail";
detailSize = "3";
detailStrength = "0.8";
detailDistance = "250";
internalName = "Snow";
footstepSoundId = 3;
};And then in your PlayerData add a field FootSnowSound = FootStepSnow1Sound;
I found some info while editing docs and thought of your issue - hope it is helpful.
#12
create a materials.cs file.
place this in that file:
that material will now have sounds and footPrints and footPuffs.
rinse, wash, repeat for any other materials.
done.
NOTE: it will NOT work for a terrainMaterial tag, only on regular material tags.
11/09/2011 (11:52 am)
open up Examples-FPS Example-game-art-terrains-desert_sand_01create a materials.cs file.
place this in that file:
singleton Material( desert_sand_01_base )
{
MapTo = "desert sand 01_base";
diffuseMap[0] = "art/terrains/desert_sand_01/desert sand 01_base";
detailMap[0] = "art/terrains/desert_sand_01/desert sand 01_detail";
normalMap[0] = "art/terrains/desert_sand_01/desert sand 01_nrm";
effectColor[0] = "0.5 0.5 0.5 1";
effectColor[1] = "1 1 1 0";
FootstepSoundId = 1; // Hard footstep sound defined on player datablock.
ImpactSoundId = 1; // Hard impact sound.
ShowDust = true; // Do/Don't show dust particles (footpuffs, hover trails, etc.)
ShowFootprints = true; // Do/Don't show footprints.that material will now have sounds and footPrints and footPuffs.
rinse, wash, repeat for any other materials.
done.
NOTE: it will NOT work for a terrainMaterial tag, only on regular material tags.
#13
11/09/2011 (1:55 pm)
Thanks Deep! I haven't had time to really look around, I just happened to be editing a doc on the ShapeBase class and noticed the fields.
#14
I did vary the number up for each terrain type and also I added the dust and footstep code and this did nothing but im not really working on that.
Odd fact: When i change the order of the terrains in the terrain painter it changes which footstep plays but still not right for the terrain but i can get it much closer...
Honestly im so frustrated with this code im ready to give up on these sounds in my game but they would be a nice touch since there is not much music n stuff.
FOILED AGAIN! I'll get you next time footsteps, next time...
So i reread the information given above and tried my code as:
Still getting the snow sound even with the proper mappings.
I am not sure what is going on at this point...
But wait are those... Yes they are! Footsteps in the grass! Odd though there not appearing under my feet but almost a player length away... This might mean something, What I am not sure time to look into this.
Further testing shows moving stuff around in the code is not doing anything. I also decided to see if the footstepsoundid is working I changed snow to 4 and it does work cause snow sound stops playing. So i know my sounds work like intended. There has to be a problem with the terrain stuff making it play wrong, although I cannot test this because i don't have another terrain at this time! Can someone please just quickly do the terrain demo for torque3d and then see if you get the same problem. I'm gonna try painting my map with example textures from the system and see if this changes anything then i will test a different height map. Hopefully something comes out of this.
11/10/2011 (8:35 pm)
Ok so i added some code to my materials (Below) as well as mapped the sound in player.cs and this still did not help i even tried the below coded added to my terrain materials and this still did not help. The more I work on this the more I think its the materials used from the demo that maybe the cause but unless someone else uses the terrain demo and then does the sounds I'll never truly know.FootstepSoundId = 1; // Hard footstep sound defined on player datablock. ImpactSoundId = 1; // Hard impact sound. ShowDust = true; // Do/Don't show dust particles (footpuffs, hover trails, etc.) ShowFootprints = true; // Do/Don't show footprints.
I did vary the number up for each terrain type and also I added the dust and footstep code and this did nothing but im not really working on that.
Odd fact: When i change the order of the terrains in the terrain painter it changes which footstep plays but still not right for the terrain but i can get it much closer...
Honestly im so frustrated with this code im ready to give up on these sounds in my game but they would be a nice touch since there is not much music n stuff.
FOILED AGAIN! I'll get you next time footsteps, next time...
So i reread the information given above and tried my code as:
singleton Material(Ter_Grass)
{
mapTo = "prairie_base";//prairie_base
diffuseMap[0] = "art/terrains/Demo_world/prairie/prairie_base";
normalMap[0] = "art/terrains/Demo_world/prairie/prairie_normal";
detailMap[0] = "art/terrains/Demo_world/prairie/prairie_detail";
//customFootstepSound = FootStepGrass1Sound;
FootstepSoundId = 1; // Hard footstep sound defined on player datablock.
// ImpactSoundId = 1; // Hard impact sound.
ShowDust = true; // Do/Don't show dust particles (footpuffs, hover trails, etc.)
ShowFootprints = true; // Do/Don't show footprints.
};Still getting the snow sound even with the proper mappings.
I am not sure what is going on at this point...
But wait are those... Yes they are! Footsteps in the grass! Odd though there not appearing under my feet but almost a player length away... This might mean something, What I am not sure time to look into this.
Further testing shows moving stuff around in the code is not doing anything. I also decided to see if the footstepsoundid is working I changed snow to 4 and it does work cause snow sound stops playing. So i know my sounds work like intended. There has to be a problem with the terrain stuff making it play wrong, although I cannot test this because i don't have another terrain at this time! Can someone please just quickly do the terrain demo for torque3d and then see if you get the same problem. I'm gonna try painting my map with example textures from the system and see if this changes anything then i will test a different height map. Hopefully something comes out of this.
#15
I loaded a flat world no terrain material so i got the orange terrain that says no material. Then I added paint of 3 materials that already exist in a full template i added dirt_grass and grass1-dry and sand. I then sprayed them onto the ground with impact 100 at a size 6. I then added the code below:
This was added to materials.cs in the art folder although i also tried the one in the terrain folder same problems.
Then I added the below code to the player.cs under art/datablocks
finally i double checked and the code for the materials i used is in the materials.cs under art/terrains
I looked in the terrain painter and the order of the materials was:
warning_material
grass1-dry
sand
dirt_grass
Final result of the new terrain:
I walked around and there was no sound...
I triple checked my code its all the way i think im supposed to set it up. So I moved sand to the top using a drag and drop.
Now i hear rock1.
I move sand back and the sound is gone again so i move dirt_grass to the top ad i hear snow1 finally i placed grass1-dry and heard grass1. This tells me even when i setup the terrain using engine stuff it is not working properly. I will give everyone till the late morning to respond if anything is wrong then im going to uninstall everything and reinstall and see if that fixes the issue
Edit:
Also wanted to add that i tried this using the code suggested like the line below
FootstepSoundId = 2;
Lastly i am posting my console log just in case
See next post too many characters.
11/13/2011 (10:17 pm)
ok so i have been running a test and i think there is something very majorly wrong here.I loaded a flat world no terrain material so i got the orange terrain that says no material. Then I added paint of 3 materials that already exist in a full template i added dirt_grass and grass1-dry and sand. I then sprayed them onto the ground with impact 100 at a size 6. I then added the code below:
This was added to materials.cs in the art folder although i also tried the one in the terrain folder same problems.
singleton Material(Ter_grassdry)
{
mapTo = "grass1-dry";//snow_base
diffuseMap[0] = "art/terrains/Example/grass1-dry";
detailMap[0] = "art/terrains/Example/grass1-dry_d";
customFootstepSound = FootStepGrass1Sound;
};
singleton Material(Ter_dirtgrass)
{
mapTo = "dirt_grass";//snow_base
diffuseMap[0] = "art/terrains/Example/dirt_grass";
detailMap[0] = "art/terrains/Example/dirt_grass_d";
customFootstepSound = FootStepSnow1Sound;
};
singleton Material(Ter_sand)
{
mapTo = "sand";//snow_base
diffuseMap = "art/terrains/Example/sand";
detailMap = "art/terrains/Example/sand_d";
customFootstepSound = FootStepRock1Sound;
};Then I added the below code to the player.cs under art/datablocks
singleton SFXProfile(FootStepGrass1Sound)
{
filename = "art/sound/footstep_grass";
description = AudioClose3D;
preload = true;
};
singleton SFXProfile(FootStepRock1Sound)
{
filename = "art/sound/lgtStep_mono_01";
description = AudioClose3D;
preload = true;
};
singleton SFXProfile(FootStepSnow1Sound)
{
filename = "art/sound/snowstep_mono_01";
description = AudioClose3D;
preload = true;
};finally i double checked and the code for the materials i used is in the materials.cs under art/terrains
new TerrainMaterial()
{
internalName = "grass1-dry";
diffuseMap = "art/terrains/Example/grass1-dry";
detailMap = "art/terrains/Example/grass1-dry_d";
detailSize = "10";
detailDistance = "100";
isManaged = "1";
detailBrightness = "1";
Enabled = "1";
diffuseSize = "250";
detailStrength = "2";
};
new TerrainMaterial()
{
internalName = "dirt_grass";
diffuseMap = "art/terrains/Example/dirt_grass";
detailMap = "art/terrains/Example/dirt_grass_d";
detailSize = "5";
detailDistance = "100";
isManaged = "1";
detailBrightness = "1";
Enabled = "1";
diffuseSize = "200";
};
new TerrainMaterial()
{
internalName = "sand";
diffuseMap = "art/terrains/Example/sand";
detailMap = "art/terrains/Example/sand_d";
detailSize = "10";
detailDistance = "100";
isManaged = "1";
detailBrightness = "1";
Enabled = "1";
diffuseSize = "200";
};I looked in the terrain painter and the order of the materials was:
warning_material
grass1-dry
sand
dirt_grass
Final result of the new terrain:
I walked around and there was no sound...
I triple checked my code its all the way i think im supposed to set it up. So I moved sand to the top using a drag and drop.
Now i hear rock1.
I move sand back and the sound is gone again so i move dirt_grass to the top ad i hear snow1 finally i placed grass1-dry and heard grass1. This tells me even when i setup the terrain using engine stuff it is not working properly. I will give everyone till the late morning to respond if anything is wrong then im going to uninstall everything and reinstall and see if that fixes the issue
Edit:
Also wanted to add that i tried this using the code suggested like the line below
FootstepSoundId = 2;
Lastly i am posting my console log just in case
See next post too many characters.
#16
http://pastebin.com/jAecpvuD
Expires in 30 days
11/13/2011 (10:43 pm)
Hrrm console log is too long so im gonna post a link if you say something about the console log please copy the piece that's an issue.http://pastebin.com/jAecpvuD
Expires in 30 days
#17
11/15/2011 (11:23 am)
So I reinstalled t3d on both win 7 and my vista laptop and copied the information of my game to both systems and tried again. I got the same issue on both installs so there is nothing wrong with my installs I must just be misunderstanding the code... I am not sure what I am doing wrong but there must be something. back to the drawing board.
#18
many folk tend to do it their way first, and end up not succeeding.....
this is kinda a life rule too ;)
11/15/2011 (11:39 am)
follow instructions exactly. only when you have success by that route, then try variating from instructions.many folk tend to do it their way first, and end up not succeeding.....
this is kinda a life rule too ;)
#19
Now i know there is something wrong with either my machine or my torque (Although i used a clean install to do as you said) and this is assuming you tried the code you handed to me and it worked for you.
11/15/2011 (7:55 pm)
Ok Deepscratch I followed your information in your previous post and when i did what you said (Made the material.cs and added the code) I then went in and tried every level of the fps example and got no sound from any level then i reloaded the Deathball Desert and moved the terrain files around and eventually got the same issue I had before which is it plays just not on the right terrains. i could not get it to play just following your information without messing with the order of the terrain in terrain editor.Now i know there is something wrong with either my machine or my torque (Although i used a clean install to do as you said) and this is assuming you tried the code you handed to me and it worked for you.
Manni Medeiros
Awkward Monkey
http://www.garagegames.com/community/forums/viewthread/112317