Devlog #10: The Player is the Sound Mixer


Hello, this is Warren McClain again. I became responsible for the game’s menu system as our project was nearing completion.

Sound became a particularly important aspect of our game during development. To ensure player comfort, we added volume sliders to the options menu. These sliders control the three types of sound that can appear in the game: Voice lines, sound effects and music.

For this post, I will go over the process of how these sliders were built, as well as the process of classifying the sound files in the project as one of those three types. Let’s begin by enabling an important feature that is typically hidden by default: engine content, which is in the settings menu of the content browser.

In the folder located at /All/EngineData/Engine/EngineSounds, there are files labeled “Sound Class.” Every sound file used in the game needs to have one of these classes attached, so its volume can be changed by one of the sliders.

Each Sound Class will need its own Sound Class Mix.

Open it up, add an array, open the index settings and add the appropriate Sound Class from Engine Content.

Now we need a save file, which is a blueprint file that will store the volume settings.

The recorded values in the save game must be floats.

 

You can play sounds in the content browser to find out what they are before classifying them.

This file is a clock ticking noise, so it should be double clicked and put in the SFX class.

 

Now we must go back to the options widget.

In the options widget’s event graph, the sliders’ default values are reinforced on startup.

Then, if a save game with audio settings exists, the data from that save will overwrite the current slider values. Furthermore, if the player then moves the sliders while the widget is open, that new value they’ve chosen will be written onto the save.

 

 

 

When the “back” button is pressed and the widget is about to close, either a new save game is created from scratch, or the current slider settings are reapplied onto the current save.

Now we need something to call this options widget. Here, I’m scripting the MainMenu level blueprint to open this widget and display it onscreen on startup.

 

I’m also scripting this level blueprint to either load the save game data on every tick, or set the volume sliders to a default value until the player creates a save file.

At the end of its script execution, the main menu will play a music file.

 

Because this music file was put in the “Music” class, its volume should be effected by the music slider. I’ve also added button press sounds that were put in the “SFX” class, so they should be effected by the Effects slider. Let’s see.

 

There it is. Bugs may crop up, but we can address those later.

So, do you have any questions or comments about the process? Did you know about engine content and how important it can be to a project? Have you discovered the property matrix, under asset actions, and you feel confident in using it to change the class of many different sound files at once? Let us know in the comments and thanks for reading.

Leave a comment

Log in with itch.io to leave a comment.