Game Development Community

Tank pack] sounds

by kcpdad · in Torque Game Engine · 06/06/2005 (3:23 pm) · 6 replies

Hi,
I'm trying to get sounds working with the tank pack. I uncommented the assignments of AudioProfile datablocks in the datablock TankFxData. E.g. hardTankCollSound = "TankCollSound";.
TankFxData allows you to define separate sounds for hard and soft collisions with other tanks, static shapes, and the terrain. Also for a running and idling engine. When none of them worked apparently(after I added AudioProfiles for each separate sound), I started to dig into the code and found at least for collisions with tanks and static shapes, it would never work because the playing of those sounds in updateCollisionSound() will never be executed because no where in the code do the masks HitTank and HitStatic( defined in TankShape.h) never get set.
so, I'm asking, has anyone else run into this and if my diagnosis correct? And has anyone fixed it and would be willing to lend some guidance on how they did it(or code even)?
Thanks!
p.s. I'm researching why the engine sounds don't seem to work as well.

About the author

Hobbyist working on a tank game when time allows. Play the prototype at => http://www.sytrept.com/60tons/


#1
06/06/2005 (3:53 pm)
Joseph, make sure you have the latest openAL installed on your machine. If I've gathered correctly that none of your sounds are working, that may be the cause.

-justin'
#2
06/06/2005 (4:30 pm)
I have the sounds working with the tank pack. When I get home, I'll look through what I have and post back here.
#3
06/06/2005 (5:21 pm)
Hi Justin, some sounds are working, e.g. the explosion sounds that the tank pack reused from crossbow work fine. I'll check on another machine to make sure though. Some of the sounds I'm pretty sure won't work since I looked though the code and found that certain bits aren't being flipped.
Thanks
#4
06/06/2005 (8:30 pm)
Here's an example my datablocks for the sounds, one for collision and one for the engine sound (there are more but I cut them out, QED):
datablock AudioProfile(TankCollSound)
{
   filename = "~/data/sound/tankColl.ogg";
   description = AudioClose3d;
   preload = true;
};

datablock AudioProfile(TankIdleSound)
{
   filename = "~/data/sound/tankIdle.ogg";
   description = AudioCloseLooping3d;
   preload = true;
};

Incorrect diagnosis: HitTank and HitStatic are used as masks (defined in the enum) and used with bitwise operator "&" against smCollisionMask (which is set in tankShape.cc).

Edit: One more thing - make sure the AudoProfiles are before the DefaultTankFx datablock. Otherwise you'll see this in your console when tankFx.cs is compiled:
Object 'TankEngineSound' is not a member of the 'AudioProfile' data block class
#5
06/07/2005 (11:37 am)
Hi Jerry,
Thanks for posting that, I had started down the same path but I forgot to make the idling sound looping as you did.
However there is still missing sounds, the ones you cut out were the ones I originally tried to get working, i.e. tank on tank collisions and collisions against static shapes. Those seem partially implemented in the tankshape code because there is masks for those type of collisions but I don't have them set in the version I have. Only the terrian collision masks are set. Therefore the only collision sounds are with the terrian.
In your implementation, do you have separate working sounds for static shape and tank collisions?
I'm going to try and implement those missing collision sounds in script first since I don't fully understand the tankshape collision code, yet
#6
01/07/2006 (7:13 pm)
Hi all..

I'm looking for tank sound but I didn't found them... where could I download?

thx