Audio design suitable for multiple simultanious intsances

Hey guys, I have used audio with mono game before.

When I have instances of many units playing the same sound, its like the sound waves overlap, and the volume jumps up…

To compensate, I have used a timer to ensure some delay between instances.

However, now I am working on a 2 player racing game, where sound needs to be accurate for each car, considering their own unique acceleration and so forth.

-So I need instances to overlap… While maintaining some control over the master output.

Since I plan to do the engine sound using a single “thud”, which will repeat in whatever tempo, should I count every active instance, and set the volume for each new one according to the number of instances?

Like (pseudo):

Play(engineSound, vol = 1f / (float)instances, pitch = acceleration)
instances++;

Or should I create a class for the thud sound, and handle each instance in a list?

Whatever I think of, it seems to leave one instance dominant, right? because they are fire and forget when it comes to volume.

Thoughts?

on a different note - is your game 3d?

no, its a top down 2d. But it does have automated panning and zooming and multiple terrain layers, and I have considered adding 3d graphics on existing coordinates, to get sweet lighting and shadows, metallic car-bodies and well, all the advantages of 3d camera manipulation, first-person view, isometric rendering option, all that stuff…

I did all the 3d geometry stuff for pacman once, and a little flight sim, I just never learned about textures and lighting/shading, I only got to vertex colors and such… Really none of the HLSL stuff I could find at the time seemed to compile for me… -Like I was was talking about in my response comment to that cool 3d setup code you posted the other day. Which looks awesome by the way :slight_smile: