**Sound Optimization Tricks**
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?
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
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.
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.
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.
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.
Thanks, those seem like they may be useful. I'll give them all a shot. Thank you.