I was looking through the sound code earlier and I came across something interesing.
It seems that in the code the maximum amount of SAME samples added to the audio queue (i.e. two object playing the cannon noise) is hard coded at 2....
Bascially if two tanks are fighting it out just outside ear shot (which will be almost silent) the tanks you are looking at directly infront of you will be silent.
And that sucks imho.
So as a quick fix I came up with this:
Code: Select all
Index: audio.c
===================================================================
--- audio.c (revision 6391)
+++ audio.c (working copy)
@@ -29,7 +29,7 @@
// defines
#define NO_SAMPLE - 2
-#define MAX_SAME_SAMPLES 2
+#define MAX_SAME_SAMPLES 20
// global variables
static AUDIO_SAMPLE *g_psSampleList = NULL;
It increases the amount of SAME sounds allowed to be played simultaneously, this should help those busy scenes. It's not perfect and the alogrithm for detecting what is in ear shot needs to be revised (I'll look into this).
Tbh I think 20 is more than enough and a more fair amount. To test this I put 35 hellstorms in my base and them placed a WSS Tower in an enemy's and let em rip. All the sounds played perfectly, the firing, flight and explosions all played nicely and god did it scare the bejesus out of my GF xD (Read high volume and subwoofer lol)
What do you Dev's think? Hack patch I know but what isn't in this game xD xD
For those of you interested the algorithm starts on Line 611 in lib\sound\audio.c


