In a previous Dev Diary, I briefly touched on the tools I use when making games and as a part of that article I listed the tools I use for sound design, I didn't really go into too much depth about the process, however... but while doing some new effects for my game Skein, I realised that sound design is one of the only subjects that this dev diary hasn't really talked about properly, and I feel that my neglect to touch on this subject reflects an overall attitude amongst small devs - sound design isn't as important as the gameplay or the visuals.
I can illustrate this simply by going through my own general progress on a game: it begins with a tech demo, then some graphics, then core gameplay elements, then more graphics, then testing and only then, when I'm pretty far into the project, do I start to add sounds, almost as an afterthought. I'm sure I can't be the only dev that works this way, but THIS IS WRONG! I know this is wrong and with Skein I've been trying to treat sounds with the same importance as I do the graphics and the core gameplay. I doubt that games like Journey or Limbo had the audio slapped in at the last minute...
But why is this so wrong? Just play any game you enjoy with headphones on and close your eyes for a few seconds at a time while playing... Listen to the effects, ask yourself if you can tell what's happening by the sounds you hear. Ask yourself if the sounds all "fit" and work together or if anything sticks out. Ask yourself if the sounds convey a feeling or a mood. This advice was given to me a while back, and I've only recently started to put it into practice and it's incredible the nuances in the sound that some games have. Things like position, volume, fading, and tone all influence me while I'm playing and my final reaction to the game is also affected by them - albeit almost subconsciously - and games which have poor sound design are quickly put down.
Good games use sound in the same way as they use graphics, to communicate with the player and to immerse them in the game world, and this requires that each sound be carefully crafted to fit into the situation in which it is required - something that is best achieved by adding it in at the same time as the graphics or the gameplay and not later as an afterthought. You've made a lovely fireball graphic? Then go make a beautiful swooshing fireball effect that fits before moving on.
Note: Before reading on, I feel that I should point out that I am not a professional sound designer by any means, and that the article you are reading simply reflects my own workflow and methods. I should also confess that if I had the budget I'd seriously consider hiring a sound designer - the reasons for which I'll explain later on.
Sourcing My Effects
Okay, sound is important but where do I get my effects from? Generally I either make my own (see the note at the bottom of this section) or I use samples. Samples are the essential building blocks of great sound design and in my opinion you should never use samples under 22050Hz, and certainly nothing below 44100Hz for music. Anything lower and you'll start to miss the high tones and the samples become "muddy", so try to keep the quality/size balance in favour of quality over file size. In Skein all my sounds are 16bit 22050Hz and my music is authored at 16bit 48000Hz - I can downsample again later in GMS itself from the sound properties window.
I'd love to show here how I made that "squelch" sound when a slime monster is destroyed, or that door breaking sound when you smash into a room, but I didn't make the core samples, I only edited them. Making samples is an incredibly tedious and time consuming experience and you need some pretty dedicated kit to be able to make good base sound effects. For that reason I use samples and then edit them as best I can to suit my game, but if you have the budget for it then I thoroughly recomend getting a sound designer on your team. They will have the equipment and (hopefully) the experience to make the sounds you need, whether it's from scratch or from high quality base samples, and they will also save you a lot of time and energy when it comes to balance and volume in your game.
However, until you can afford a sound designer, you need to go it alone and to get started you can scour the web for free audio samples to use - sites like FreeSound make this easy - or you can pay a small amount and get access to some of the royalty-free sound effects that are available from sites like SoundDogs (my personal favourite and where I'm sourcing most Skein sounds from) or AudioBlocks. Note that you are not guaranteed to find the exact base sample you require, but that doesn't mean that other unexpected and common sounds can't be substituted instead - for example, a close-up recording of an automatic car window can double as the servo-motor of a robot leg - and most times a little modification will be necessary.
NOTE: You can also create your own core samples from scratch using some audio tool like BFXR or LabChirp, and indeed, the audio for Skein started out using BFXR, but I felt that I needed something more immersive for the game. The samples these tools make can then be manipulated and merged or added to, etc... to create a more complex sound sample. These sounds won't generally sound "real", but then that may not be important - it never hurt Mario!
That brings us nicely to the sound design. This is when you take your core sample (or samples) and manipulate them to fit into your game and the situation they are to be used in. I almost always edit sounds in one or more ways before adding them to a project, and I don't think I've yet found a sample that I can use "as-is" off of the web. This means that you will need to get some kind of basic audio tool and learn a bit about how to use it. As I mentioned in a previous article, I use Goldwave for all my audio editing as it is very powerful and has a great pricetag (don't be put off by it's website!), but a lot of people swear by Audacity, which is free.
No matter what you use, you will need to make sure that it covers the basics required for your sample editing:
- Cut, paste, merge, etc...
- Volume controls (fade in/out, maximise, etc...)
- Pitch shifting
It's also handy if the tool permits you to use VST plugins, as with them you can then start to add effects like reverb or flanging to your samples, but it's not essential.
Using Pitch, Speed and Tempo
While creating sounds for a game I find myself using the options to change the pitch, playback speed, or tempo of the sample an awful lot. It's surprising the effect that lowering the pitch of a sound by a tone can make to the overall feel of the game, and these effects are easy to experiment with, often producing interesting results. Even pretty massive adjustments of as much as 500% on the pitch can be used to completely change a sound for a different purpose, and the more minor changes can also create useful multiple variations on a sound.
In Skein, for example, I have a very subtle "footsteps" sound effect that plays whenever the player is moving. However it didn't quite fit in with the player animation speed, so I had to adjust the playback speed (but not the pitch) a couple of times until I got a loop that sounded and looked right in the game. I also found myself lowering the pitch on certain explosion sounds (but maintaining the playback speed) so that there was more in the bass end of the spectrum - there's nothing worse than tinny explosions!
Cutting, Pasting & Mixing
I often find that only a section of a longer sound is interesting to me for my game, which is when the cut, paste and trim/crop tools come in handy. It's often worth looping through sections of a longer sound even if you haven't instantly found what you need, as when taken out of context a snippet can sound completely different and be used for something else, so keep an open mind when working with your samples.
Another cool thing to do is copy and merge samples to create new sounds from them. For example, a gun shot may sound a bit too light for the game, so take a bass rumble sound and speed it up (preserving the tone) and then cut and merge it with your gunshot to give it that "meaty" sound that devs like Vlambeer are so fond of. You can also simply cut and paste two sounds together to create a longer sound, or (if your audio tool permits it) paste them with a partial overlap so that one merges into the other (this will probably require some volume balancing before being done). Note that, in general merging, sounds works best when they are complimentary and don't occupy the same "space" within the aural range.
It's worth keeping in mind the fact that GameMaker can easily play multiple sounds at once, so instead of creating complex layered samples you can save them out as individual sounds and then play them together in GMS to create dynamic sound effects at run-time. This is not something I'll be doing in Skein, as it's time consuming to find what works and what doesn't, but it's worth bearing in mind, especially for those effects that are repetitive as it is a way of adding extra "colour" and dynamism to the sound.
Volume And Fading
When I'm creating new sounds from samples, I pay close attention to the overall volume of them, and I'm also careful not to leave any pops or clicks where I've have cut out a section. This is when the fading tool comes in handy as I can zoom in on the sample and simply add a fade from (or to) 0 covering the initial (or final) 10-15ms of the sample - this will remove the noise and be unnoticeable to the player. I also use longer fades when mixing sounds so that the overall volume is maintained or I even add more subtle fades where samples have been mixed to create a more dynamic effect.
All this requires a careful control of the final volume of the sample, and although I can tweak the playback volume in GameMaker: Studio, I've found that it's best to have a baseline for all my samples... Remember that although the player should be able to set the sound effects volume, this is usually a global setting so if that shotgun sound is too loud, it'll always be too loud no matter what volume the player chooses.
So how to make sure all your samples are consistent? Well, I always choose a "reference sample" when working on a new game. For Skein I chose a magic effect that I really liked as it had high tones, bass rumbles and a great dynamism to the way it sounded. it's peak volume was set to roughly -0.75 decibels (digital files are usually referenced to dBFS - decibels full-scale, i.e. the maximum volume is 0dB), which means it's pretty loud but has space for other sounds to be louder if required. I always have this sound file open in Goldwave and every time I work on a new sound I can play it along with the new sound to get an idea of the way it'll sound in game. If all sounds are compared against the same reference, then I can expect the final results to be fairly normalized when they’re all in the same game.
If I were to talk about audio effects, you'd probably think of echo, flanging, stereo field, etc... but there are more subtle effects that I find myself using far more frequently when creating my samples. For example, I make frequent use of the compressor function in Goldwave. What this does is lower the loud parts of a sample and/or raise the quiet parts, giving the sound a denser feel, or eliminating those annoying peaks in the waveform. It's tempting to just compress everything as it's a great way to keep all your sounds to a normalised level, but I've found that too much compression will suck the life out of a sound, so use it with care!
Goldwave (and I would assume most other audio editors) also has an effect to remove clicks, pops and hum from a sample. While this isn't always a good thing, as it can remove other parts of the sound too, it can sometimes be very handy to clean up a sample or even to remove a part of a sound which you wish to mix with another. Along the same lines is the graphic equalizer, which is another great tool when used in moderation for bumping up the brightness or the bass of a sound.
So that's pretty much how I go about creating my sound effects, not just in Skein but in all my games. Personally I find working with sound a bit of a chore, but now I've found some great sound resources, tools that I'm comfortable with and have established a routine and methodology for creating my sound files it's less of a pain than it was! One thing I would also recommend to anyone creating their own effects is to get a couple of pairs of headphones - at least! - and play your game with the sounds added through them. It's surprising how different your game can sound when there's little or no bass being heard, or the mid-range is over compensated! Oh, and I always save out my sounds as wav format PCM files. This is a lossless format which preserves my sound exactly as it was created, and GameMaker: Studio will do any converting that needs done when compiling.