Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

How to do sound effects for an rts game?

Discussion in 'General Discussion' started by Velo222, May 6, 2014.

  1. Velo222

    Velo222

    Joined:
    Apr 29, 2012
    Posts:
    1,437
    Hey guys,

    I have a specific question regarding sound, sound effects, and rts games in general (or any game where there could be hundreds of units).

    My problem is that I have lots of warriors/swordsmen in my rts game. They ALL have a sword "clanging" sound for when they're fighting or in battle. When all of them are fighting at once, the game tries to play all the sounds at relatively the same time. This causes the sound to be amplified sometimes, and in some cases even combines with each other to produce a new sound. In small numbers (of units), the sound effects sound okay. But in large numbers, it kind of gets annoying hearing all the sounds playing at once (especially if they're the same exact sound). The shear number of swords clanging becomes somewhat overbearing and repetitive.

    How do you think RTS games handle sound effects like this, where they might all be on the same unit, but in large quantities?

    Thanks for any advice.
     
  2. MarkrosoftGames

    MarkrosoftGames

    Joined:
    Jan 5, 2012
    Posts:
    442
    you could have it so that no matter how many units are fighting at a time, there is only one sound track for them playing the right sound fx in a certain order and frequency.

    you could also do something like, for every x units, have one instance of the sound.

    you could even say for every x units in y range have one instance of the sound.

    you could even get into stuff like basing it on distance from the camera, so you would only hear the ones your looking at, or it would be quieter when zoomed out.
     
  3. Kondor0

    Kondor0

    Joined:
    Feb 20, 2010
    Posts:
    596
    Yeah, make a "battle sound" instead of individual sounds. It seems Total War games do it that way, you are not actually listening to every sword strike but to a single source for group of fighters.
     
  4. JovanD

    JovanD

    Joined:
    Jan 5, 2014
    Posts:
    205
    Make sure to have same exact "roger that" or "acknowledged" track play every time player clicks on unit or orders it to do anything. (joking ofc)
     
    VictorKs likes this.
  5. swyrazik

    swyrazik

    Joined:
    Apr 21, 2013
    Posts:
    50
    I would create a SoundManager script/object that would take care of all the sounds, like banreaxe above said.
     
  6. Velo222

    Velo222

    Joined:
    Apr 29, 2012
    Posts:
    1,437
    Thanks for the ideas. I'm just starting with sound in my game, so I'm really new at this.
     
  7. Games-Foundry

    Games-Foundry

    Joined:
    May 19, 2011
    Posts:
    632
    Create a SoundManager class that implements buses with a maxPolyphony property on each bus. Then a PlaySFX method that checks if the maxPolyphony has been exceeded or not before playing. When playing a new sound you need to add it to increment a currentPolyphony property, and then when the sound finishes playing reduce the currentPolyphony count.

    There are assets in the AS that provide this sort of implementation, but we haven't tried them.
     
    VictorKs likes this.