7
\$\begingroup\$

The problem is that when I play 100 sounds almost at same time, all I hear is noise. It's not very attractive to listen it for 30 minutes straight.

I tried to fix this by allowing only 1 sound of each sound type to be played at once. But it still sounds really ugly; eventually my brain keeps hearing only the very end of the shot sounds (or the start of it?), and that gets on my nerves really quickly. Eventually I would just decide to turn off the sounds completely. So is there any point of using sounds in a game like this at all?

How does our dear reality handle this problem? If there is a war out there, how does it sound when hundred of men shoot almost at the same times?

Edit: Here is how the game sounds currently; there isn't even 100 sounds playing at once, maybe 20? http://www.speedyshare.com/VTBDw/headache.mp3 At the beginning it sounds OK, but then it becomes unbearable! In that audio clip there is allowed only 1 sound to be played at once, so it will stop the previous playing sound when new sound is played.

Edit2: And here is same headache but 32 simultaneous sounds allowed to be played at same time: http://www.speedyshare.com/TuWAR/headache-worse.mp3 Quite a torture, eh?

\$\endgroup\$
  • 3
    \$\begingroup\$ Is this actually a question about game development? Playing 100 sounds at the same time would be annoying, I agree. If the sounds you're adding to your game are annoying (and they're not supposed to be), you need to choose different sounds or choose which ones to play more carefully. Reality has sound coming from different sources at different frequencies and amplitudes. 100 men shooting at almost the same time sounds very loud. \$\endgroup\$ – MichaelHouse Aug 17 '13 at 18:09
  • 2
    \$\begingroup\$ @Rookie you're probably clipping the audio pretty bad. Reality doesn't have the problem of a maximum amplitude. Additionally reality is a lot more complex, it's not discrete, so "at the same time" has a different meaning (As does "the same sound"). You can prevent the worst somewhat by mixing the audio similar to what HDR lighting does, adjust a flexible window over a huge range. Also, varying the "same sound" by choosing from a random pool of similar sounds and vary speed/pitch and timing ever so slightly. \$\endgroup\$ – PeterT Aug 17 '13 at 18:48
  • 2
    \$\begingroup\$ Can you further define what the actual problem is? Clearly "destroying your hearing" is not what's actually happening. Further, "gets on my nerves" is not a very good description either as that can easily vary from person to person. \$\endgroup\$ – MichaelHouse Aug 17 '13 at 22:52
  • \$\begingroup\$ @Byte56, non-annoying sound generation method could be a solution to my problem as well. So if you know how, tell me. So far, all the sounds give me headache. Only thing i can think of, is to make very bassy sounds, then perhaps i wouldnt need to cover my ears when i play my game. \$\endgroup\$ – Rookie Aug 18 '13 at 8:36
  • \$\begingroup\$ @PeterT, what do you mean by clipping the audio? How can one clip it correctly? I doubt that randomized sound effects give me less headache. Especially when the sound is a simple laser sound (sinewave). The problem is that when i have 100 turrets shooting every half a second, they start to generate crazy amount of noise. No matter what type of sound they give. At beginning it sounds tolerable, but after certain point its just noise, no matter how awesomely good the sound was made. \$\endgroup\$ – Rookie Aug 18 '13 at 8:41
5
\$\begingroup\$

In reality, our hearing is adaptable. Just like our vision adapts to different light conditions by becomming more or less sensitive, our hearing adapts to different noise coditions. Unfortunately this doesn't work as well for computer audio output.

But you could simulate it. When the game gets particularly noisy, reduce the overall volume down to a bearable level.

There is a name for such an audio filter: It's called dynamic range compression. An advanced audio API might even provide it out-of-the-box.

Also, when events technically happen at once, you should still try to offset their sound effects by some microseconds. When 10 enemies fire their guns in the same game-logic-frame, the 10 gunshot sounds should not play in perfect unison. This will sound like one very loud gunshots, not multiple which happen simultaneously. They will sound more realistic when they are slightly offset (chorus effect).

\$\endgroup\$
  • \$\begingroup\$ Randomize pitch (playback speed, rather) by a tiny amount too. \$\endgroup\$ – Kevin Reid Jan 12 '15 at 17:19
2
\$\begingroup\$

Your sound files are gone, but just attenuate the sounds that are further away, severely.

So use an INVERSE CURVE, or an EXPONENTIAL CURVE to attenuate the noise volume.

enter image description here

If that's not enough, you can even use an exponential curve:

enter image description here

In OpenAL, use the function alDistanceModel with any of:

AL_INVERSE_DISTANCE AL_INVERSE_DISTANCE_CLAMPED
AL_LINEAR_DISTANCE AL_LINEAR_DISTANCE_CLAMPED
AL_EXPONENT_DISTANCE AL_EXPONENT_DISTANCE_CLAMPED
AL_NONE

The default is AL_NONE, so that would be pretty noisy if you have many sounds playing at once.

\$\endgroup\$
  • \$\begingroup\$ I have no camera object at all, the game is basically board game, where everything is shown at once, so all sounds should play the same volume no matter where they are on the map. Im thinknig to just not use sounds at all. they really get on my nerves after some time. \$\endgroup\$ – Rookie Nov 4 '13 at 18:00
  • \$\begingroup\$ If the game has a Starcraft-like view, I'd still say fade sounds that are out of view by a lot. If the entire board is viewable, you could just attenuate all sounds by a lot, while keeping the music at full volume. Then the sounds at least add some ambience. \$\endgroup\$ – bobobobo Nov 4 '13 at 19:33
  • \$\begingroup\$ if i "attenuate" all sounds, doesnt that mean i would barely hear them? \$\endgroup\$ – Rookie Nov 5 '13 at 19:01
  • 1
    \$\begingroup\$ Yes. If there's a bunch of chanting going on say 4 blocks away, and you can barely hear it, you get the ambience of (there's something going on 4 blocks away) without having to feel disturbed by it. So instead of turning off all the sounds, just make them quiet, so the user still gets the feeling that something is going on, without having to be overwhelmed by the sound. \$\endgroup\$ – bobobobo Nov 5 '13 at 23:45
2
\$\begingroup\$

Try limiting the total number of things that can play a sound at a given time. For example if numberOfSoundsPlayingRightNow > 5, then ignore the sound effect that just got triggered.

Also try bringing the volume down for sound effects that are less important.

Another thing to try is to limit how often a single game object can emit sound to prevent a single object form spamming the same SFX over and over. For example an object would check before playing: if lastTimePlayed < 1 second, then the sound trigger.

You can also look into an game audio tool like Wwise where you can easily tweak the audio from the game.

\$\endgroup\$
  • 1
    \$\begingroup\$ Probably that is the only thing I can do at the moment, but I also think it wont solve the problem completely. For example, if there are 100 different objects which emit sounds, its hard to prioritize them. With only few sound emitting objects its still doable. \$\endgroup\$ – Rookie Dec 18 '13 at 12:44
  • \$\begingroup\$ If for example you have 100 space soldiers shooting their lasers over and over, and you trigger a sound effect each time they shoot for each soldier, this will sound terrible because the sound will overlap and sound very bad. Try this approach instead: When there is at least 1 soldier shooting , turn on a looping laser sound. This will keep the sound nice and clear. Just beacuse there are 100 soldiers shooting, that doesnt mean the player has to listen to all of them, a few will do. \$\endgroup\$ – Jose Llausas Dec 29 '13 at 7:09
2
\$\begingroup\$
  • Leave at least -3dB headroom for your sounds. In your case it can be -6dB or more. This way you will get rid of the digital distortion caused by reaching the maximum capacity of how a sound can be represented digitally.
  • Apply a good randomization or use sufficiently big enough number of recordings of the same sound.
  • Ask the question that "Do playing that many sounds tell something meaningful?". Integrate a system that attaches priority indexes to sounds and put a cap to maximum number of sounds can be played simultaneously. Most background sounds become a part of background noise when there are significant sounds in the front. Some game engines do that for you.
  • Instead of assigning a sound to every object, let only important objects have their dedicated sounds and design one long ambiance sound loop for other sounds. Again, background sounds are a part of the background. You don't need to attach a sound file for everything.

It is also a burden and waste of CPU to play sounds that you won't hear or associate with the source object. Use your resources wisely.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.