Welcome to Dev Blog #8- SFX Addition and Integration!
The video above demonstrates some of the sounds of our spells as they sound in-game (music disabled) (we’re also showing off some of the new color schemes, so we hope you enjoy the much-improved visuals!). There’s still a bit more polishing to ensue, but the current setup seems to be ideal.
Sounds are very easy to do in Unity- we create a variable for our ‘travel’ sound, and then our ‘hit’ sound, and transition between those within code at the correct spots. The same goes for things like dying, spawning, acquiring special things like Resources and Tomes, and so on. We can conveniently trigger all these events as they occur from their main event within the code.
Sound Management is also quite simple- except, things need to be done in a reverse order. With Music, we can control the music almost directly, since its just a single entity. But with Sound Effects, since they are so spread out across so many different things, handling them all directly would be a bad idea. Instead, handling them in a reverse order- ie, have the SFX themselves figure out what the current control scheme is via a global handler is the most ideal.
This is done by, on SFX call, the SFX itself looks at the global GameManager class to understand all its various parameters (namely volume). It then takes those parameters and updates its own information with them, then plays the sound. This allows us the ability to control dozens of different SFX objects very easily, and simplifies the scaling process. So, instead of the GameManager controlling the sounds directly, when the sound is needed, that sound instead looks at the GameManager to determine its volume, etc. We imagine this is the same setup we’ll use for handling things like ambiance effects and so forth.
The other task we needed to overcome was handling sounds in massive quantities. RTS games are known for having dozens of spells flying across the screen at once, and if each of them are playing a sound (different, or same), all those sounds get added together to create one overpowering element. Therefore, we need to manage the output levels of sound so it doesn’t get too loud.
To do so is quite simple- using Unity’s Audio Mixer, we can have the output sound essentially ‘check itself’ to ensure that it doesn’t go over a desired volume limit. This differs from simply lowering all volume- we have both a minimum and a maximum volume to maintain. The minimum is easy- its the base sound on its own. But the maximum is a bit more complicated- when dozens of the same sound play simultaneously, the result is that 1 sound at a much higher volume.
Utilizing the Audio Mixer, we can feed every sound into a base, and from there, determine if we need to apply volume lowering. The desired goal is to make it so dozens of spells sound fairly similar compared to just one being cast. The result is even as dozens of spells are cast, the overall amount of sounds do not overwhelm the player.
There is still some tweaking to do- we’re still playing around with the volumes of sounds at their base level to ensure all are very similar in volume. But right now, its at a state that is both good and fairly smooth to listen to.
Thank you for viewing our post! Support and interest for the project has been rapidly growing ever since we began posting here, and we're incredibly grateful for all the wonderful feedback so far! We hope this project interests you as much as we love developing for it, and please look forward to more updates coming in the very near future!
If you’re brand new, consider checking out our trailer and overall description of the game here: Indiedb.com