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
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
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.
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!
Get Just Keep Running
Just Keep Running
Run, leap, and uncover the truth in an adrenaline-fueled parkour odyssey.
Status | In development |
Author | I.M.I.Self |
Genre | Platformer, Action |
Tags | 3D, 3D Platformer, Action-Adventure, Fast-Paced, First-Person, Parkour, Puzzle-Platformer, Singleplayer, Voxel |
Languages | English |
Accessibility | Color-blind friendly, Configurable controls, Interactive tutorial |
More posts
- “Yo Vic, where have you been?”77 days ago
- I'm going to University! 🎓🥳Jul 25, 2024
- V. 2.5.0 - Quality++ 📈🆙Jul 12, 2024
- NEW UPDATE SOON + Direct Relief Sale! 🥳❤️Jul 09, 2024
- V. 2.4.0 - The “Steam Next Fest” Update!Jun 15, 2024
- STEAM NEXT FEST HAS BEGUN! JOIN OUR SHOWCASE 🥳🎉Jun 10, 2024
- We're taking part in Steam Next Fest! 🥳May 30, 2024
- V. 2.3.1 - Fixing the UI! 😁May 10, 2024
- V. 2.3.0 - 🤫Stealth, 🛠️Tweaks and 🤓GeeksMay 05, 2024
Leave a comment
Log in with itch.io to leave a comment.