Randomizing Sequence of Tracks Vertically

Hey there,

we making a roguelike in which the music is dynamic. We want to do quite a lot so there is one part that we can’t figure out and I wonder if it’s possible in a good way.

So first the set up:
The music we play has 2 different modes. Combat and non combat. We have multiple combat and non combat sections. But switching between them with a parameter and some logic via transition regions is really simple. That’s our horizontal movement for progression and combat vs non combat.

Then we got vertical movement. We got the intensity in the game called “hype”. When the hype is down, only 1 track is playing. When the hype is up, tons of tracks can play. The higher the hype, the more tracks are playing. To simplify, it reflects the intensity of the gameplay. We do this with a parameter called “intensity”. Each track we gave a condition with the parameter intensity. Once the parameter is high, the track plays. We do that for all the tracks and we done.

So far so good.

Now the boring thing about this is, is that the tracks that come in and out are always in the same order. That order we want to change. So lets say normally we have track 1, 2, 3, 4. Then we want to have track 1 always to play first, track 2 or 3 to play next, then play the other one, and then to play track 4.
I know about multitracks to randomize one of them, but how can I make sure the next one played is the other one that hasnt yet been playing? Also we might have more than 4 tracks at time it will be around 7.

I hope this makes sense. If not please let me know what doesnt. If there is something I can read to learn about this please link me I couldn’t find what Im searching for yet.

Thanks for readin, have a good day!

I can’t figure out a way to do that directly in FMOD Studio. The best solution probably is to create a sub-parameter for each track you want to randomize, and control the triggering of those parameters in the game code.

Thank you for sharing that possibility Alcibiade. I was thinking of that as well but I want a cleaner and faster way! With only 2 tracks this wouldn’t be to bad but if we do 5 tracks to randomize, that would be a lot of work

Not really. In any programming langage, that’s easy to do. An array with the pool of tracks to randomize, take one random and remove it from the array, repeat the process until the array is empty. It doesn’t really matter if there’s many tracks or not.

I didn’t know it’s possible to take a logic track in FMOD in a programming language. How do I do that. I use Unity but I’m more asking for the procedure not specific code. Unless you happen to have that. With procedure I mean something like this “In FMOD you do this to get a logic track as a parameter, then in your game engine you do this and that”

The idea is to drive fmod from the game code using fmod’s parameters. For instance, you can create a parameter for switching the volume of a given track from muted to 0 dB, and use this parameter in the game code logic.
But maybe I don’t exactly understand what you want. What do you mean by “logic track”?

You are absolutely right. I was overcomplicating things in my mind but hearing it from you like this, I realize that it is actually really easy. Thank you a lot!

So to recap for whoever stumbles upon this:
Each logic track (the vertical stuff in FMOD) will be automated with a parameter to have its volume essentially “on” or “off”.
For that I create several parameters in FMOD and link each to a logic track.
Then in Unity I create a script that keeps an array of these parameters and knows when one of them is on or off.
Now at random I can select one of the off tracks and set the parameter in FMOD to “on” or “off”. That way we can randomize which track to activate without to much work.

To keep it consistent I would at the start of each level create a new Array with a specific order. Just to make sure that whatever track was activated last, is deactived first. And keep this order consistent through the level. Maybe not. A lot to play around with in my coding software so it’s easy to do. Thank you a lot! Saved me tons of work :grin:

1 Like