Game Development Community

Some audio glitches

by Henry Todd · in Torque 3D Professional · 05/03/2009 (12:01 pm) · 3 replies

First, it seems that firing state sounds are getting cut short. I'm wondering if the sounds now cut off as soon as the fire state ends. For my rapid-fire weapons, this means that only about half of the fire sound gets played.

This could be an intentional change, but it seems inconvenient at best; any rapid-fire weapon currently plays nothing more than a blip of sound.

The second issue is old.. dates back to the addition of getRenderTransform() in around 2002. Seems like it should be fixed at this juncture since it's so simple.

Most of the audio calls use getTransform() to pick up the position of the source object. To line up correctly with where the object appears to be, they should use getRenderTransform(). You can easily pick out most of these audio calls by doing a find in files for "&getTransform()" - only the SFX play function and a couple others call getTransform this way.

The shapeImage system seems to be the only thing that does this right:
image.animSound = SFX->createSource( stateData.sound, &getRenderTransform(), &velocity );

Here's an old post about it, which links to an even older post in which Tim Gift confirms this was a bug: www.garagegames.com/community/forums/viewthread/69729

#1
05/03/2009 (12:09 pm)
Weapon sounds longer than the state timeout have always got cut off since TGE. But here's a man with a fix, at least for TGEA1.8.1.
www.garagegames.com/community/forums/viewthread/90269/1#comment-614389
#2
05/03/2009 (12:30 pm)
I feel like an idiot for missing that. I am a bit confused about one thing, though, which is that the weapon datablock I'm using hasn't changed since TGE 1.5.2, and the sounds played in full there. Maybe the timing has just gotten more precise since then.

Either way, thanks for the fix.
#3
05/04/2009 (8:47 am)
I'll make sure Gerald's fix gets into Torque 3D beta 2.