Jump to content
  • Advertisement
EddieK

Dealing with large amount of sounds playing at the same time

Recommended Posts

Hello, I'm new to OpenAL and audio programming in general so I might not explain everything clearly, but bear with me.

Essentially I'm making a tower defense game where I have dozens of turrets shooting at approximately the same time and each shot makes a sound. So there are few problems/questions which I have:

1) While one turret is shooting the volume of the shot is low, but when dozens of them are shooting the sounds seem to add up and make everything too loud. Is there a way I can fix this?

2) When there are many turrets shooting, the music becomes quiet. And when they stop shooting I can hear the music gradually up in volume. Does OpenAL use some sort of compression? If so, how can I tweak it?

I tried making it so that there would be a max number of shot sounds at any given time, but sometimes you can see a turret shooting and it doesn't make any noise, which looks weird. 

 

Share this post


Link to post
Share on other sites
Advertisement

One thing I do when I have lots of entities that can do the same action at once is wait a random delay before doing the action. That way, it looks a lot more natural and the sound problem is lessened. 

If you have a large map, then you will naturally use positional sound effects which will reduce the volume of sounds that are far from you if not mute them.

If it's still too loud and lots of sounds happen all the time, I will lower the volume simply. If few sounds happen, it's fine if they are quiet because it gives auditive strength to the more intense action.

For limiting the number of sounds, I presume that you count how many sounds are currently playing and skip newer sounds if it reached a limit. Instead of playing sounds directly, send a sound event to a sound manager. This sound manager will receive events from everywhere it's needed and it will keep track of the number of received events for each individual sound. Once the sound manager has received all the events for this current frame, it will decide which sounds should be played. For example, if I count 100 events to play the sound "laser_gun", I can play the sound once, but adjust the volume with the following algorithm.

for each (soundEvent) {
      // Each additional sound event increases the volume by 5%
      // instead of 100% if you'd play it twice.
      float vol = 1.f + (soundEvent.counter - 1) * 0.05f;
      SoundAPI.play_sound(soundEvent.sound, vol);
}

That way, many sounds are still louder, yet not too loud. Notice that I used a linear function to increase the volume, but you could use an exponential function so that a second sound event increases the volume by 50% and the tenth only increases by 5%, etc.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement
  • Advertisement
  • Popular Tags

  • Similar Content

    • By CpawsMusic
      **The game must be in the final stages of development and be close to release. Willing to do SFX or Music for free since Horror games heavily interest me.**
      Hey there! My name is Cpaws and I compose music, sound effects and overall sound design for video games and film. I've worked on numerous games and I'm looking to specifically pick up a Horror game.
      If you're interested in working together, don't hesitate to contact me at cpawsmusic@gmail.com
      Here's a few demo reels of my past projects: 
      Game Music I've Composed: https://soundcloud.com/cpawsmusic/sets/cpaws-video-game-film-music
      Website/Portfolio: https://CpawsMusic.com/
      E-mail: cpawsmusic@gmail.com
    • By Carradine
      Hello!  I am looking for someone to create some simple female sounds effects for my "cave woman" model in my game Vantage: Primitive Survival Game".

      I only need 8-10 simple, very quick "grunts" and other primitive noises.
      I already have the male versions as a guideline, so I only need someone to create these with a female voice (with their own artistic flair of course  )
      If you want more information, just check out my Steam page here:
      Vantage: Primitive Survival Game
    • By TheRealm
      Hi, I've just finished a 4-year course studying Music Technology.
      I'm looking for work in Composition, SFX, Audio Programming, 3D Animation, 2D Game Design and more, on request.
      Some of my projects include:
      A 3D animation made from scratch + music:
       
      A 2D rhythm-based platformer game, made from scratch + music (Skip to 1:50 for gameplay):
       
      A small collection of my music:
      Message me at therealmmail@gmail.com for inquiries.
    • By danys
      Bluezone Corporation is proud to present 'Alien Planet Ambiences and Sound Effects', a brand-new immersive SFX sound library for immediate download. This inspiring downloadable sample pack offers a wide range of meticulously recorded nature ambience sound effects : immersive rainforest sounds, flowing water and mountain stream sounds, blowing winds and also includes textured night creatures, mysterious alien insects, dark and disturbing animal / organic sounds. 'Alien Planet Ambiences and Sound Effects' has been designed to enhance science fiction, mystery, suspense and fantasy video game and scoring projects. WAV files are provided as 24 Bit / 96 kHz. Like all Bluezone sound libraries, you can inject these inspirational elements into your commercial projects without having to worry about any additional licensing fees.
       
       
      Editor : Bluezone Reference : BC0247 Delivery : Download link Download size : 984 MB Extracted size : 1010 MB Format : WAV Resolution : 24 Bit / 96 kHz Channel : Stereo License : Royalty free Total files : 113 Total samples : 98 WAV   More information and download : Alien Planet Ambiences and Sound Effects
      View full story
    • By danys
      Bluezone Corporation is proud to present 'Alien Planet Ambiences and Sound Effects', a brand-new immersive SFX sound library for immediate download. This inspiring downloadable sample pack offers a wide range of meticulously recorded nature ambience sound effects : immersive rainforest sounds, flowing water and mountain stream sounds, blowing winds and also includes textured night creatures, mysterious alien insects, dark and disturbing animal / organic sounds. 'Alien Planet Ambiences and Sound Effects' has been designed to enhance science fiction, mystery, suspense and fantasy video game and scoring projects. WAV files are provided as 24 Bit / 96 kHz. Like all Bluezone sound libraries, you can inject these inspirational elements into your commercial projects without having to worry about any additional licensing fees.
       
       
      Editor : Bluezone Reference : BC0247 Delivery : Download link Download size : 984 MB Extracted size : 1010 MB Format : WAV Resolution : 24 Bit / 96 kHz Channel : Stereo License : Royalty free Total files : 113 Total samples : 98 WAV   More information and download : Alien Planet Ambiences and Sound Effects
    • By CraneM
      Hello

      In our game we want to use sounds based on  https://gamesounds.xyz/. I mean that sounds in game would be mix of  those from GameSounds and our own recordings. For example sound of explosion would be mix of burning effect from GameSounds and 'boom' made by our sound designer. I know that all sounds on this sites are free for use commercially, but what about licences? It would be enough that in credits would be mention that some part of sfx were made with those from GameSounds.xyz ? Is there another for of reference needed?

      Regards
      Crane
    • By bvincent
      Hello everyone,
      I am doing a survey to understand better what are the pain points in terms of music composition in video games, what are the game studios / developers expectations in the future and how the industry could be improve: https://docs.google.com/forms/d/1NycMla5fhQd1fMbLy3c28alxCbhIYvkD6Fv9lqhxEJ0
      It is not a promotion of any kind, I am just interested in getting feedbacks from game developers, studios and gamers (and composers as well). 
      The answers are completely confidential and no personal information will be published, or used for any other purpose.
      Thanks for your time and help  
      Vincent 
    • By Eetutah
      Hello guys and gals! My name is Eetu.
      I'm a sound design student from Finland, looking for a project to work on. As I'm very much of a beginner I wouldn't take any money from it as experience is what I'm looking for.
      My background is in music (electronic mostly) but as I was more introduced to sound design in my school, it feels more like the field I'd like to work on.
      I have some experience on Audio recording but mostly editing and mixing. I'm also working on a project on Wwise at the moment so I have the basics of it covered.
      So if you have any project you need sound design on, contact me here or with e-mail: eetu.tahtinen@hotmail.com
      Here's some earlier stuff I've worked on:
       https://vimeo.com/261660005
       https://vimeo.com/261661580
       https://vimeo.com/261664743 (The audio and video went offsync during the upload to vimeo.)
      Thanks in advance!
      Eetu
       
       
    • By Jacob Ornberg
      Hi!
      I have always liked the concept of writing my own work. From my middleschool pop songs written while getting a grasp of the piano to my planned concept album in the works, the need of creative output has always been there. Parallell to this I have also been a huge fan of video games and particulary video game music. Although I have not always had the time to play I still try to keep myself up to date regarding the industry and what new games are releasing.
      My biggest inspiration when it comes to game music I would say is Koji Kondo and his simple yet timeless melodies. Outside of that my musical references span from soul to modern pop to jazz or even classical music. I produce myseft and am a fan of music production of all kinds. I like experimenting with diferent soundscapes and all kinds of ambience. More than that I am experinced with musical theory and harmony while still valuing a good melody the most.
       
      Genres I would like to compose for: (anything really, always up for a challenge), Adventure games, RPG's, singelplayer in generall
       
      My soundcloud, with the first steps towards an album (quite frequently updated); 
       
      Music I wrote a couple of years ago (some pieces are quite influenced by VG music, also note the lesser production value): http://pocketband.net/song/166783240 , http://pocketband.net/song/162594038
    • By SimonFelix
      Hi!    
       
      My name is Simon Felix, and I am a composer and sound designer based in Ghent, Belgium. I started out in the electronic music scene, but gradually branched out to orchestral music and soundtracks.     
       
      I just finished the soundtrack for Shift Quantum, and I'm looking for a new project!
       
      Samples
       
      Here you can listen to some of my work:       
      Blazing Sails: The main theme for an upcoming pirate-themed combat game.
      The Necropolis: One of the themes for an upcoming RTS.
      Adventure Awaits: One of the themes for an upcoming RTS.
      Winds of White: The main theme of an upcoming RPG.    
      Zerhen's Grace: A calming piece for a cancelled RPG project.    
      Rooftop Botanist: A soothing piano theme made for a cancelled project. 
      Submarine Waltz: Title says it all, could be a theme for an adventure or point-and-click game.  
       
      Compensation
      Rates are negotiable.  
      I might be open to rev-share agreements, providing that the project is near completion.
      Contact
      I hope you enjoy, and feel free to contact me at simon.felix09@gmail.com, or send me a PM, if you are interested in working together. You can follow me on twitter here: @SimonFelixMusic, and on Facebook here: https://facebook.com/SimonFelixMusic
       
  • Advertisement
  • Popular Now

  • Forum Statistics

    • Total Topics
      631374
    • Total Posts
      2999661
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!