Game
Just Keep Running

2 years ago

For JKR, I wanted the soundtrack to be responsive to what was happening in the game.
So, we developed a relatively simple but effective Music System, and in this article, I explain how it works and how it was executed! #soundtrack #article #devlog


Adaptive Music: How the Music System in "Just Keep Running" Works

Written by Victor Ahlin, creator of "Just Keep Running"

PLEASE NOTE: This article contains spoilers for Level 1-3 of the game. You have been warned

Intro

Before I started making games, I had already gotten into music production. In fact, I still make music to this day (Victor Ahlin on most major streaming platforms, fyi ;D). So, of course, a good bit of thought went into the game's soundtrack. And with the help of FMOD (not sponsored), I could set up a system that reacts to what's happening in the game and actively modifies the soundtrack to suit the momentum and intensity of the game. So, for anyone curious, here's how the Music System in "Just Keep Running" works!

The System

system_showcase.jpg

The system is relatively simple. Each piece of level music is divided into three states of rising intensity; Calm, Alert, and Action. Each track also has optional states that I can utilize if I want the soundtrack to shift a little bit during a specific section of the game (such as in 1-3 when the player is prompted to escape, you can hear the soundtrack slightly shift as the cutscene gets closer to the BOOM!)

The Music System looks at what is going on in the game each update cycle, and (if a custom section of the soundtrack isn't currently playing) it determines and changes the music's intensity using a variety of factors.

  • If the player is not in a stage, the music state is Calm.

  • If the player is in a stage and the stopwatch is ticking, the music state is Alert.

  • If the player is in a stage, and either of the following is true... (a) they've started a Time Trial, or (b) the player is being attacked by an enemy (such as a Roof Turret), the music state is Action.

The Setup

fmod_setup.jpg

The setup for a music track is not super complex. Once the Music System changes its state, it sends that state to FMOD, which causes the current state to try to transition to the next state as smoothly as possible without disruptively interrupting the current one, taking into account the beats per minute of the track so that the transition can happen in time with the music.

The current state keeps looping until either a transition is ongoing or the track is stopping, which is determined by the "Reached Level End" parameter. This is so that while the song is fading out and reaches the end of that state, all the instruments cleanly chime out.

script_variables.jpg

The script also has some variables to track the momentum of the game.

"Tension Release Wait" determines how long the music should stay in Alert or Action while the player is outside of a stage before transitioning back to Calm so that if the player quickly leaves a stage and enters another one, the music won't try to quickly transition between both states. This tends to sound very artificial and ruins the momentum of both the game and the soundtrack.

The horribly named "Shooting Pause Timer Length" variable determines how long the soundtrack should stay in Action once an enemy attacks the player. The timer resets every time an enemy attacks the player and transitions back to Alert or Calm after that timer has run out.

In Conclusion

While this system isn't perfect, it is simple yet easily customizable; if I wanted to do more with this system, I could! Plus, it's a neat introduction to Adaptive Game Audio and Music. I will talk more about FMOD and Adaptive Game Audio in a future article. But for now, if you want to learn more about Adaptive Music in video games, I'd recommend checking out Game Maker's Toolkits video "Adaptive Soundtracks in Games". It showcases some neat and complex uses of adaptive audio than what goes on in "Just Keep Running", and I think it's a really interesting video!



0 comments

Loading...

Next up

Yo yo yo! 😀

We’ve had a productive June, and we’re coming at you with many QoL features and changes. Keep reading for more deets! 🙂

#jkr #update #steam #platformer #puzzle

I'm studying game development at the University of Skövde next month! 🥳

I won't be as active with I.M.I.Self, but I'll keep working whenever I find time. I'm determined to get JKR Early Access and T-1000 demo out by Dec/Jan.

Hope you all understand! :D

We’re back! And we’ve got an update for you 🎉

More upgrades, dyslexia-friendly fonts, and other small but cool additions, that’s what this is all about!

Read more about it below...

CGDannyB will be live soon on Twitch @ 4:30PM EST to talk about Just Keep Running with the developer, Victor!

You can catch the stream on Twitch here: https://www.twitch.tv/cgdannyb/

#jkr #interview #devtalk #announcement

😁We’re back with some significant changes!

Today focuses on replacing the previous Climbing and Wallrunning tutorial with one that should hopefully teach both mechanics in a much better way!

#jkr #update #gameplay #leveldesign #announcement

🥳WE’RE ₛₜᵢₗₗ ALIVE! - V. 2.3.0, JKR for Charity, and Project T-1000

Read more below...

#jkr #devlog #update #charity

2.3.0 IS OUT NOW! 🥳🎉

We’re starting to add Stealth mechanics, QoL changes, and tweaks to levels to make it easier for the baby birds dipping their feet into the game! 😀

Read more below...

Hey there! Despite Steam Next Fest, we’ve still kept busy bug fixing and making adjustments to Just Keep Running, and that’s what this update is all about! :D

#jkr #update #steam #platformer #puzzle

👋Happy Friday, ya scallywags! Today we’ll be talking about NEW STEALTH FEATURES, as well as a lil CHARITY EVENT we’re running, and about our TWITCH DEV STREAMS!

STEAM NEXT FEST IS HERE!

And in celebration, we are hosting a showcase of Just Keep Running 24/7 for the next 7 days!

#steamnextfest #steam #puzzleplatformer #parkour #platformer