Music and sound effects

Buildbox has made the implementation of music and sound effects super easy. It's a lot like replacing graphics on assets. You just drag your audio file (an MP3) onto the speaker icon in the properties field of whatever you'd like to assign it to. Let's get to it.

Adding a musical soundtrack to your game

There are lots of ways and philosophies for doing this. Each UI can have its own background music. It's important to know that with Buildbox, the music will keep playing until it is overridden by another piece of music. What does this mean? It means that if you set a piece of music to play, it will continue playing across all UIs unless another UI that pops up has its own music. For instance, menu music will continue to restart on each menu you go to (if each menu has music assigned). Also, if you assign music to a world...it will restart every time the player restarts the level.

This can get tiresome, and just downright annoying to a player. So what I do is create one MP3 file with several distinct pieces of music in it. I then assign that music to ONLY the Main Menu. Then, the user gets an uninterrupted string of music that repeats every ten minutes of gameplay...no matter what UI they go to (unless they revisit the initial Main Menu - which is rare).

Music is also extremely resource intensive (unless you want it to sound like someone passing gas in the soundtrack). So, by having only one MP3 file playing, we can lighten our resources a bit. But even this (by far) is the largest file of the whole game. It comes in at around 10 MB because it is a 128 Kb/s (kilo-bits per second) 48 KHz (48,000 samples per second) stereo file. It's the base quality for your standard broadcast FM radio station...so at least it'll sound decent.

We also mixed our music so that it's -9db. That means it's lower in volume from our sound effects by 9 decibels. We do this for two reasons: the sound effects in the game are more important than music because they let the player feel the game better, and because sound is additive, meaning that sounds piled all on top of each other can easily over-modulate (or overload) the audio and cause distortion.

Applying the music is a simple matter. You'll find the file GeneralGameplay.mp3 in the Sound/Music folder of our content directory. On the Game Mind Map screen, just select (don't open) the Main Menu UI. Drag the music from your file browser onto the speaker icon next to the Music field in the Properties window. And here is the result:

Adding a musical soundtrack to your game

And there we have it. Our game has music. Now that you've (no doubt) played through the game several times...see what a difference just adding a music track can make. Play it with music! Our sound effects will take it to an even higher user experience level.

Adding sound effects

Adding sound effects is a very similar process to adding music. It's just a drag and drop proposition. The important thing to remember is that all of the MP3 sample rates and quality settings should be the same across all our files. Although Buildbox can play them all together (no matter their rate), some devices have issues with playing different formats at the same time. Remember, music is always playing in the background, and you'd hate to have a bug in your game where, as soon as a sound effect is played, the game crashes.

If you don't have the benefit of a complete sound studio, free sound effects can be found at various websites. We used http://www.freesound.org for some of ours, and generated the rest ourselves. But as with graphics, you can always use contractors from websites such as fiverr (https://www.fiverr.com/) for sound effects, or even custom music.

Also, sound effects are not assigned to objects at the world level...they're global. So, if we go into our Mars Training Ground and assign sound effects to our Mars Training Rover if someone uses the Mars Training Rover on Gliese...that same sound effect will apply. Basically, they're assigned by object...regardless of the World. Since we used this as an example, let's set up our Mars Training Rover.

Inside any world, just select the Training Rover from the Asset Library and in the Properties window, navigate to the Sound section. Now, just drag the Explosion.mp3 file to the Defeated Sound field and the AirJet.mp3 file to the Jump Sound field. Both of these files are in the Sound/SFX directory. And that's all that there is to it. Your results look like this:

Adding sound effects

Great! Pretty simple, right? Unfortunately, there is no motor sound as of yet in Buildbox, but hopefully a future update will have this option. It'd be really cool to have our bigger rovers sound ominous, and the Training Rover sound like a Prius. No matter though, let's move on.

The following chart shows what sounds to assign to which parameters on objects in this game (starting with the object we just worked with). Go through each object and assign the sounds:

Object

Parameter

Sound file

Training Rover

Jump Sound

AirJet.mp3

Defeated Sound

RoverDeath.mp3

 K.R.A.B.B.

Jump Sound

RocketJet.mp3

Shoot Sound

LaserShot.mp3

Defeated Sound

RoverDeath.mp3

Phoenix

Jump Sound

RocketJet.mp3

Shoot Sound

MissileShot.mp3

Defeated Sound

RoverDeath.mp3

Taking Damage Sound

DamageExplosion.mp3

Rock001

Death Sound

Explosion.mp3

Lava

Idle Sound

Lava.mp3

Moosquatch

Idle Sound

Moosquatch.mp3

Death Sound

MoosquatchDeath.mp3

Moosquatch Shaman

Idle Sound

MoosquatchShamen.mp3

Death Sound

MoosquatchDeath.mp3

Mech Walk

Idle Sound

MechWalk.mp3

Death Sound

Explosion.mp3

Taking Damage Sound

DamageExplosion.mp3

Psycholpse Shooting

Idle Sound

Psychlopse.mp3

Death Sound

PsychlopseDeath.mp3

Laser Shot

Idle Sound

LaserShot2.mp3

Death Sound

DamageExplosion.mp3

Psychlopse Walking

Idle Sound

PsychlopseWalking.mp3

Death Sound

PsychlopseDeath.mp3

NormalCoins (Action)

Start Sound

10Credits.mp3

RedCoins (Action)

Start Sound

100Credits.mp3

And there it is! All of the sounds. The Laser Shot is a bit different. We used an idle sound with a long silence at the end in order to have a sound generated whenever an enemy fires their laser. Also, the Taking Damage Sound field is NOT in the Sounds area of the properties window. Instead, it is in the Damage area (because it is part of the Damage component).

Give your game a try with sound now! It's a much better experience for sure. If there are any sounds that are not to your taste, feel free to make sounds that are! Have some fun with it.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.226.251.70