**Sound Optimization Tricks**

FallacyStudiosFallacyStudios Member Posts: 970
edited March 2012 in Working with GS (Mac)
I was wondering if there are any good sound optimizing tricks. It's not so much that they take up space as it is on my android when I had a few sounds going off at the same time it would cause a crash or lag spike.

I was wondering for example if I lowered the volume of the game music in audacity and lowered the volume of other sounds within the game would that help at all?

Are there any other tricks?

Its from my game posted here:
http://forums.gamesalad.com/discussion/41136/survive-zombie-defense-released-today#Item_8

For example when the lag spikes were happening I had sounds on the gun firing. Even when I set it so that lets say the pistol is being shot by numerous guys that it would only fire the sound once per 2 seconds instead of each shot. When I had it at each shot it would cause crashes. I've noticed games like plants vs zombies has each of the things placed making sounds so not sure why mine would cause a crash instead. Any help is appreciated.

Also does making sounds positional help (even though if you look at my game and they are lined up close to the middle you would likely hear all of them right?

Comments

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922

  • FallacyStudiosFallacyStudios Member Posts: 970
    edited March 2012
    @FryingBaconStudios Thanks, good video. Do you know how many sounds GS can handle at the same time? Since your good with audio, how would you suggest I go about including SFX in that game. If you watch the video you would get an idea of the set up of the chars. Do you think it would be best to have just one gunshot SFX for a whole group of the same guys or do you have any better ideas?

    I wouldn't be able to do your last suggestion on your video even though I liked it. Because different guys could be placed or you could simply have one guy on the screen and if it sounded like multiple shots from multiple guns with only one guy out it might be odd.
  • SlickZeroSlickZero Houston, TexasMember, Sous Chef Posts: 2,870
    Positional sound is pretty cool. I'm using it in my game, and it works well for my airplane that flys from the left to the right. I don't think it will help your problem, though. Just a guess. Give it a try and see if you like the effect it has.

    If they all fire at the same time, you could probably get away with one sound. Or you could have maybe just 2 or 3 sounds, each one a slightly different pitch than the other, just to give it the feeling of more than one gun going off.

    Not sure what the magic number is for sound files playing at the same time, and have something go wrong. I have some games where 4 or 5 sounds are going off, and I haven't had a problem, personally. I have a machine gun on one of my main players, and it sounds off with a timer every 0.5 seconds, and I haven't had any crashing problems. Is that on the Android or iPhone when it crashes? I do know you can only have 1 music track at a time, but that probably doesn't help you.
  • FallacyStudiosFallacyStudios Member Posts: 970
    @SlickZero

    Well it crashes on Android. Basically when I had the sounds in it would have multiple going off. It would be fine at first. I'd continue placing troops and eventually the sounds would still sound great, but suddenly the game would slow drastically. I'd have like a stream of bullets still in mid air with a bunch of lag spikes and then it would crash.

    I'm not positive on whether this happens on iPhone or not. The iPhone I use for testing is one of the older ones now and doesn't run quite as smooth with that game where as the newer versions run just fine so I was never really able to test out the sounds well on that device. I just took all the sfx out because after I saw it do that to Android i figured it wouldn't be far off from doing that on iPhone.
  • HoneyTribeStudiosHoneyTribeStudios Member Posts: 1,792
    If you're getting lag because of sounds try this:

    At the start of your scene pre load your audio.
    By that I mean play your sounds silently. Now they are loaded into RAM. So they won't need to load in the first time hey are triggered in-game.
    If you have sounds or images loading in mid-game with lots of action happening you will get a drop in frame rate.

    With crashing, well it just sounds like your sounds are using too much RAM. Use the viewer to figure out exactly which sounds are taking up a lot of RAM.

    You can use Audacity (free tool) to make your sounds mono so they use less RAM. Also make them as short as possible. Sometimes you can re-use the same sounds and use the in-built pitchshifter in GS to get decent results.
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    Also you could add an attribute that knows when more than one enemy is firing and trigger a sound file with multiple gun fire. Then you could have fewer files so if more than three are firing at once play multi fire sound.
  • FallacyStudiosFallacyStudios Member Posts: 970
    @HoneyTribeStudios @FryingBaconStudios

    Thanks, those seem like they may be useful. I'll give them all a shot. Thank you.
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    Also, the next update has a better fix for the sound issues.
Sign In or Register to comment.