Boss Music Implementation


A small change was made this week that makes all the difference in game feel for the project. In terms of music, the only things the project was missing was boss music. With our final track provided by Anthony Marks, I was able to start tackling some of the mechanics needed to implement the new music. A list of the things we wanted to achieve with the new music was, playing boss music only while a boss is alive on a current save, fading music out on defeat of the boss, playing regular zone music on return to a defeated boss's room, and switching to the boss music mid scene in the case of the Crystal Warden.

Playing the right music depending on the boss's 'alive' status was easily solved with some other systems we already had in place. The calling cards for bosses is something that we had attached to the bosses themselves for months. When the calling card is first activated it will start playing the boss music for the current scene. And since the calling card object will be destroyed on Awake() on subsequent loads of the scene, the music is not changed from the normal zone music. This also perfectly lines up with solving the edge case with the Crystal Warden. This is the only boss fight that does not start as soon as the scene is loaded. Instead, the player must go into the ominous arena and meet the boss face-to-face before the calling card is activated and thus starting the music. As far as fading the music out on defeat, there was two nifty little tricks I had to employ. First, if the player preferences already had a low sound setting, .05f for example, then the music would fade out far too quickly. It was simple enough to make the fade scale based on the player preferences with division, but it felt tricky on my end, nonetheless. Then to reset the volume, on load of a new scene the music player singleton will set its volume back to the player preferences instantly.

Files

Disavowed Play in browser
Dec 05, 2022