[Background Blog] Astatos Sound & Music Systems
Added 2021-04-03 13:15:42 +0000 UTCHi everyone, Compymono here!
Today I wanted to dive into the production side of the sound design and music systems of the video game version of Astatos. Including both our design process and the technical side of things.
Technical Background
Looking back at our previous 2 games, Nekojishi, and Beek - Familiar Spirit. Both of them have very different implementations of music and sound effects. Nekojishi was fairly straightforward, while Beek started to stretch to more complex dynamic audio systems.
Since Nekojishi was made on the Ren'Py visual novel engine, it uses all of Ren'Py's inbuilt sound systems.

In Ren'Py you can directly play sound effects and music in-line along with the rest of the scene scripting. For music we also defined a start and end point for the music to loop at. (Meaning you can have a song that loops after an intro section)
With Beek, we moved to Unity for development, meaning that along with more freedom we also had more work to do on every system as requirements for audio expanded. Beek features a dynamic soundtrack driven by triggers in the scenario scripts.

Each track is comprised of sub-compositions that can be looped individually. So the same track can be adjusted to fit the different mood for each point. You don't know how long the player could be spending looking at one section of the story, so we wanted the progression to be very tightly tied to what you were reading in Beek's messages.
From the technical side of things, Unity by default allows you to play a single audio file once or looping once it reaches the end of the file. In this case we had to create a system which could control the playback logic of the audio to match the requirements described above.
The first approach to this would be to write a script that can load the loop times and play the song until each time is met then move the song playback position back to the start of each loop as required. It's a little tricky but once we sorted out the structure we had this working... well mostly.
In a game engine like Unity your scripts only run once per frame. As it turns out, your ears can hear more than 60fps, meaning when we checked the position of the music the script would usually overshoot the loop point and you would hear the next bit of music playing before it would start again. By the time of release, this was mostly solved by some functions I discovered late in the development which allowed you to work in the time system of the Unity audio system. [AudioSettings.dspTime and AudioSource.PlayScheduled for anyone interested into looking into this for themselves]
In the end, Beek didn't have a flawless system since it definitely had a few cases were it would break but we were proud of what we tried to do with the audio in that game. Soon we would learn we were doing everything the hard way.
Starting on Astatos
During the Kickstarter for Nekojishi: Lin & Partners we started prototyping the first versions of the video game version of Astatos. Back then it was just a simple prototype but in the time since, we've been using Astatos to try out new stuff and develop our skills and production pipelines to help make our games even better. As a part of Astatos we decided to move away form Unity's internal audio engine and look towards an external solution.
In game development, the two most common audio middleware programs are Wwise and FMOD. Wwise has expensive licensing fees so for our projects we're using FMOD as our audio engine since it's a lot more indie friendly!
Audio middleware is basically a program dedicated to the playback of sound in a video game. In our case, FMOD is used to replace the audio functions of Unity entirely. (And save us weeks of engineering time in the process!)

FMOD handles the file management, compression, playback, and most importantly logic of audio in the game. In a more advanced project you can use this software to control dozens of audio sources, overall mixing, post effects, and more.
For Astatos we're using FMOD to implement a far more robust version of the dynamic audio we started working on in Beek. In the above screenshot of FMOD Studio, you can see the single music track is split into two seperate tracks we can fade between in-game.

Then in this track, we have the same song split into 3 different themes, chill, serious, and uplifting which we can move between at defined points.
The awesome part about FMOD Studio is that it lets us set up rules for audio and the game only needs to worry about when to trigger audio events.
Production Pipeline
Now moving onto our production pipeline for sounds; in the game our sound can generally fit into 3 categories, Music, UI SFX, and Story SFX. Music is handled by the composer for the game Tamashiro Esteban who also worked on the music for the Astatos Kickstarter video and some music for Nekojishi: Lin & Partners. While SFX work is handled by Angel Ignace. Both of which are way more experienced at sound design in the industry then I am so it's been a pleasure to have them around to push us in the right direction on our current projects.
Our general production pipeline revolves around a Trello board to keep things simple and organised in a way we can share feedback and files.
Whenever the production needs a sound in one of the three categories, someone creates a card to request that asset along with a description of what's required in a brief.

From here the composer and sound designer get to work and there's a back and forth on draft files until we end up with something that matches what's required for the game. Once the file is complete, we're able to add it to FMOD and include it in the game with just a few lines of code!
And that's the general layout of where our team is currently at with audio systems in our current projects. Over the past year we've made massive strides towards reaching a professional production standard and I'm really excited to be able to get this game out towards you all. Hope to be able to share some more in the coming months!
- Studio Klondike