We’ve worked on quite a lot of features so far: instantiating and moving units, setting up a camera, lighting up the scene with some FOV and fog of war… there is, however, one thing we haven’t talked about yet: sounds

Since we need to prepare quite a lot of little things, I’ll split this tutorial in two parts — in this article we’ll focus more on why sounds are paramount in games, how Unity’s sound system works and how you can avoid consuming too much memory with your audio clips. Then in part 2 we’ll actually implement the system and play our audio files during the game.

Sounds in video games

Sounds are crucial for immersion — when you’re faced with a multimedia content like a movie or a video game, they are about as important as images. Over the years, video games have improved in their rendition of sounds: from the 8-bit musics we had in the 70s to the grandiose soundtrack we now have on big titles, we’ve certainly come a long way. As technology advanced, we’ve been able to include sounds that were more and more realistic, and even some spatialization effects (in particular thanks to binaural recordings).

In most video games, you can differentiate between 3 types of sounds.

The background music

Ever since the beginning, video game designers have worked on finding a unique musical identity for their creation — think of Mario’s or Sonic’s themes, or more recently of the amazing soundtrack of The Last of Us series! The musical theme will be there all along the player’s experience and it will most likely have a big influence on it: just like in films, it can increase the emotional impact of an important scene, or it can help with creating an ambiance.

Video game composers can face various challenges. They may have to make coherent soundtracks for series of games like Glen Stafford’s work at Blizzard (for the World of Warcraft and Starcraft games); or music can be an inherent part of the game as in Crypt of the NecroDancer; or it can be licensed music that is left in the control of the player by providing him/her with radios and CDs to choose from in-game…

Overall, you have to remember that with video games gaining more and more renown, their soundtracks are becoming more and more spectacular, too — but that even a lo-fi or retro 8-bit vibe tune can work, as long as it conveys the right meaning for your game.

#tutorial #development #3d #csharp #unity #rts game

Making a RTS game #16: Introducing a sound system 1/2 (Unity/C#)
1.70 GEEK