Game Development Community

TGEA 1.7.1 - Weapon Fire sound getting clipped

by Dusty Monk · in Torque Game Engine Advanced · 07/10/2008 (3:32 pm) · 2 replies

Apologize for littering this bug across other forums... I only just now found my way to this one, which would appear to be the most appropriate place for it, thanks to someone helpfully pointing it out.

Here's the bug:

Basically it appears that any sound over a few hundred milliseconds in length is getting clipped when used as a weapon fire sound in TGEA 1.7.1. For me, at least, this repro-ed with stock Stronghold. Replace the default crossbow fire sound with any 44 kHz sound that is like 1.5 secs in length. You'll see that the sound is immediately clipped upon playing. A few data points:

1.) I'm pretty sure this was working okay in TGEA 1.7.0.
2.) It's not all sounds. So far, just the sound associated with image state "fire". I suspect it's happens with any image state sound, but I haven't verified this.

About the author

Dusty Monk is founder and president of Windstorm Studios, an independant game studio. Formerly a sr. programmer at Ensemble Studios, Dusty has worked on AAA titles such as Age of Empires II & III, and Halo Wars.


#1
07/11/2008 (12:36 pm)
Noted.... i'll take a look at it over the weekend.
#2
07/11/2008 (12:42 pm)
Someone else just posted in the thread over in the SDK forums that removing the SFX_DELETE's in ShapeImage.cpp seemed to fix the problem. I investigated a bit further, and it appears to be specifically this SFX_DELETE that's clipping the image sound:

ShapeBaseImageData& imageData = *image.dataBlock;
   ShapeBaseImageData::StateData& stateData = *image.state;

   // Stop any looping sounds or animations use in the last state.
   // WINDSTORM - don't stop prematurely
   // SFX_DELETE( image.animSound );

   // Mount pending images
   if (image.nextImage != InvalidImagePtr && stateData.allowImageChange) {
      setImage(imageSlot,image.nextImage,image.nextSkinNameHandle,image.nextLoaded);
      return;
   }

That's my code, with the SFX_DELETE commented out. I'm guessing that's not the "right" fix, but I thought I'd offer it up as additional info.

edit: This is in the ShapeBase::setImageState function, around line 1530.