Sound Effects

In contrast with the synthy background music track I created, I’ve actually been experimenting with 8-bit NES style noises as sound effects elsewhere in the game. These started off as placeholder sounds so that I could work out what type of noises to include, but they all seem to fit really well.

I’ve been making the majority of my sound effects using a browser-based software called as3SFXR, which generates random 8-bit sounds that you can adapt and customise in your web browser before saving and downloading your generated sound. You can see from the image above that its possible to customise all settings of any sound created, generate sounds based on category or create completely random sounds using the randomise button. You can export sounds as good quality .wav files!

Sound effects I’ve currently created in as3SFXR are:

  • jump & double jump
  • hurt sound
  • door sound
  • “flower squash”
  • “flower unsquash”
  • blossom collection
  • sushi box collection

As luck would have it, a couple of days ago an article came up on TIGsource about a lesser known piece of software that could be used to generate multi-channel sound effects called LabChirp.

This works very similarly, you can generate random sounds or create your own very easily. The main difference about LabChirp is that you can use the 8 channels listed down the right hand side of the first window to create complex sounds which utilise up to 8 instruments playing at once. You can see here that I’ve set the category to footstep, which is a category not covered by as3SFXR! I’ve made myself a very simple footstep sound based on a random generation which I customised to be softer and quieter. This only uses one channel, but was much easier to make from the starting point presented by the program. I’ve also made a “death” sound which uses two channels, and plays when the player runs out of health. You can also export sounds created in LabChirp as .wav files.

As I’ve mentioned before, I’m trying to avoid using Game Maker’s built in sound functions because there are much better ways of implementing sound effects and music. I had a go at using the Caster extension for Game Maker, which supports .ogg playback. Ogg Vorbis files are a great alternative to mp3s, especially with the restrictions on mp3 files and as Game Maker support for mp3s is temperamental at best. Game Maker plays .wav files fairly well, but using many .wav files can result in an unnecessarily large game file. Caster uses many of the same sound calling functions as the built in GM functions, but allows better customisation of things like volume and panning. In the end though, I’ve decided to use the SuperSound.dll because it seems to have much more support on the internet. This .dll still support the use of Ogg Vorbis files, and many of the same functions as Caster, but works much differently as it is a .dll rather than an extension.

The Super Sound System comes with several scripts for GM. This example is a script called SS_Init, which is called in any instance where a sound is played. There are several other scripts (you can see some of them in the browser on the left hand side) including scripts to play and stop sound, and change various settings. In order for an external sound to be played, it must first be loaded. This can be done individually within each instance, but to save memory I’ve created an instance which loads all sounds as globals. This is created once, meaning that all sounds are only loaded once but can be played several times.

Here are all the sounds I currently have loaded (this list really needs some sorting out and arranging-it’s a bit messy!) I start off by initialising the Super Sound System, then use the SS_LoadSound function to load sounds from their location in the “Sound” folder. I’ve given each sound a handle, which acts as a unique ID for each sound. for example:

is the background track which is continuously looped;

is the sound that the footsteps make.

You can see I’ve also used the SS_SetSoundVol function, which allows you to change the volume of individual sounds. Because my sounds files have been brought in from various places, volume levels are a little erratic! This is only there temporarily, as eventually I’m planning to change the volume of the actual files to decrease the amount of functions called. I’ve been using Audacity to convert my files from .wavs to .oggs, and changing the volume is no problem.

Here’s a really simple example of how a sound is played. This script runs when the Z button is pressed (making the player jump). The Super Sound System is initialised with SS_Init();. If the player is on the ground when the Z button is pressed, the SS_PlaySound(global.sndjump) function is called. The second section of code applies to when Z is pressed and the player is in the air performing a double jump. This plays the global.snddoublejump handle, which is a higher pitched version of the jump sound.

Most of the sound effects have been fairly simple to implement, based on various parameters like the ones above. The most complex so far has been the step sound, which uses a timer between plays that I had to time perfectly to the point when each foot touches the floor! You’ll be able to hear some of these sounds in my next devlog video!


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s