Sound/Audio Engine Implementation


This post is shadowed from our community forum Adventures in Lestoria Forum

Music/sound is very important in a video game. It adds a ton of immersion and having awesome background tracks to go with each and every moment in a game can make the experience so refreshing.

Tonight I finished an implementation of the audio engine for the game! I had a discussion with my composer over what techniques we could implement to make the music/sound in the game more dynamic and as it turns out, with a couple of tracks muted/unmuted you get a completely different experience in any song!

This led us to use a simple technique where we load up multiple channels into the game at once and define what the volumes at various times should be. This will give the effective result of hearing different tracks at different moments in a game without having to add any extra technical strain or complex features to the game!

Take one of our early tracks here:

If we split up our track into lows and highs, we have effectively separated the bass track from the main melody and all the accompaniments.

Now let's spin up a configuration system that allows us to define the volumes of the two tracks at various points in a game. I'll make a few in-game events we can respond to. `Default Volume`, `LowHealth`, `InCombat`, `Underwater`. A few likely scenarios we can expect to put the player into.

Now onto the configuration:



I've thrown in an underwater version of each track as well. In foresty0, we can see I have just a normal version of the track and an underwater version of the track. However in foresty1_1, we can see that I've taken the low and high pass filter versions of my track and added them as separate channels on top of the underwater versions. Now to put it all together with some code and a parser for these and we can run some code like 


and we can hear different events! Here's a sneak peak of it in action! 

While at first it sounds like you are hearing one track, you are actually hearing 4 tracks being played simultaneously! Their volumes are just adjusted to fit the ebb and flow of what's going on in-game!

We will be using this system to great effect to give the user some great immersion while fighting and exploring the lands of Lestoria! Thanks for reading!

Get Adventures in Lestoria Demo

Leave a comment

Log in with itch.io to leave a comment.