Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to reproduce several sounds in a game I'm developing in AS3.

The game is like a TD game, and when I got 10+ of the same tower firing at the same time, I hear a horrible: "PRRRRRRRRRRRRRRRRRRRRRR"...

How should I manage this problem? How do PC games (specially RTS ones) manage this in order to hear something decent instead of an obvious and horrible loop?

share|improve this question

I haven't had to run into this issue too many times, but what I've done is have a SoundManager class managing all my sounds - creating, calling, disposing.

If I'm finding overlapping sounds gets annoying (take a massive battle in SC2), I'll have the SoundManager keep track of "currently playing sounds" - increment this when a sound plays, decrement when it's complete, and not allow new sounds to play until AFTER that limit is back at a mangeable level.

Hey a bullet's a bullet. You don't need to hear 50+1 to get the idea of a ton of lasers firing and a battlecruiser.


share|improve this answer
+1 Battlefield Bad Company's audio followed the mantra of do more with less, and look how that turned out. – michael.bartnett Apr 6 '11 at 5:13
Thanks man. Love that game! – Dominic Tancredi Apr 6 '11 at 14:01

Typically what I do is I have the sound manager prevent the same sound from being played over top of each other within a small period of time.

So let's say you have 5 towers that all would start firing at the same time (for the sake of argument, let's say the same frame). They would all tell the sound manager to play a "tower type X fire" sound. The sound manager would see this, and only play a single instance of this sound. That sound type won't be allowed to play again until some short period of time later (a couple of frames at least, maybe close to something like a quarter of a second or so). That'll at least prevent the sound from being really loud.

There's some game/audio design that can go into that as well. Keep the pace of the game slow enough and your sounds short enough that you don't have so many bullets firing on screen at a given point in time.

share|improve this answer
Yes, I think Ill do that, thx for your advice. However, what if when two or more sounds play at the ~same time, I play only one sound but at a higher volume?, would that look fine? – Artemix Apr 7 '11 at 12:57

When you ask to play a sound, it helps to play a 'logical' sound rather than directly triggering a physical wave. Instead, leave the logical sound object to handle that part, and it can do something like playing 1 of several different versions of that sound in sequence (aka 'round-robin' samples), or picking one at random, or pitch-shifting and changing the volume on them slightly to give the impression of them sounding unique, etc.

Most AAA games have dedicated editors so that the audio guy can specify the different samples that go into each logical sound without needing to do any programming. The game then just loads in the sound bank that the tool generates.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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