Dynamic Music for horde slaughtering, running from hordes, and other scenarios

I’m imagining running through zombies slaughtering them while a metal song from Wolfenstein plays in the background. This would mean the game would have to sense what kind of situation your in whether you’re running from zombies or facing them head on. I’ve never programmed c++ but I have extensive experience with C# and I’d love to expand my horizons and make this happen. It would also be cool to have extra eerie music play when you can’t see any enemies, but you here thumps nearby. I think it could add loads to the atmosphere.

Iirc there was a program that allowe this type of behavior but i dont know about getting it working with cataclysm, though i doubt its open source.

Edit* i think it was called FMod or wwise, and bfxr is an open source alternative.

Sfx API is only one part of the problem, second one is actual in game sfx hooks, aka way in which game recognizes the event that you want to link to playing the music/sfx.

As far as CDDA goes the SFX engine is SDL audio which is… well… underdeveloped to say the least. But it has some tools like pitch shift etc. Not good not bad as they say. Seen better like Audiere. In fact original music and sfx author for the game had made an Audiere version on his branch, but never pushed it toward the main version.

The second part is much more complicated. In simple events like actions it’s not problematic. You use a jackhammer? Play jackhammer sfx. Of course there are some quirks in that too, but more or less - simple.

Complication comes with context. For example as of now game has 4 danger levels and it plays different music for each. That is a second level of complication, because you may base it on number of zombies seen. Other idea would be using their perceived difficulty according to player experience.

And here comes the problem with the OP idea - the game will never know what sits in the mind of a player, so how would it define the context? A player moves away from horde? Is he running or just moving along. Is he fighting the horde, flanking it, or avoiding it? Is he afraid of the horde or does it not worry him at all. No way to judge. If there is a way to define an in-game set of conditions to hook on, you’re in the clear (if no technical problems stop you). If not - well - you know the answer.

But if we shift away the focus from player to the character, couldnt we better predict the mindset of the character. We have many variables that could affect their reaction, such as time survived, zombies killed, traits and skill levels, overall gear and locations, time of day, all of these could predict how you would feel towards a situation, if the character had a weapon out and were moving closer to hostile enemies or attacking them, intentions could be easier (not easy but easier) to predict. While the game can’t predict whats in the mind of the player, it can deduce whether your fleeing by basing how long your moving away from a horde, and whether that horde has seen you, and if they are chasing you, however if that horde has seen you, and your moving closer your effectively telling the game your getting ready to do something dangerous like combat, flanking and attacking are effectively the same thing.

One of the greatest things about audio, is its ability to change how we feel, and experience the world and our surroundings. Take COD Nazi zombies for example, once you activate the easter egg song “115” in a high round, you basically turn into an unkillable badass, or for a more horror example, the conjuring, im not moved by most horror movies but that had me spooked, the audio engineers and composers were able to ochestrate our reactions and emotions, using the audio to build tension and suspense in the right spots, and thats what a system like this would provide, the tools for sound and music contributers to manipulate us in the right ways.

Granted its a ton of complex work, and beyond my experience with programming, i feel its something that would pay off immensely to the gameplay experience. Forgive any typos or half assed logic im on cellphone and short on time.

I’d imagine anytime my character goes up against a creature with a firearm music would slow down and it would turn into slow breathing. For me personally, those kinds of situations are less battle Royale and more cognitive survival.

1 Like

I agree wholeheartedly to the importance of music and sfx. However for the rest my opinion is as stated earlier.

In a linear game it’s easy, you know what the next step is, thus you set up the mood with music, for example in anticipation for a jumpscare. Even within the limits of freedom you’d be able to identify some boundaries and triggers to link with the sfx.

In an open world it’s not that easy. Let’s make an example: I’m in a fight with a zombie. At half of my HP I decide it’s time to bail out and run. You’d want to differ those actions to trigger different sfx. What do you hook on? If you hook on 1/2 my max HP and I as a player decide that I want to bail out at 1/4 and not on 1/2 I’d be confused to hear the music change from “fight” to “run”. I might even misinterpret it as game giving me some strong hint or something. If you hook on the fact I move away from the zombie while I was previously attacking it, how would you account for a scenario where my intention is kiting the zombie and fighting it from distance? I’d be confused as hell if the game would misinterpret my intention and play something weird.

In other words with more freedom the error for placing a wrong hook raises expotentialy. I’m not saying it’s impossible - the danger theme wouldn’t be possible if it was - but it’s a walking on a minefield, and it’s technically easier said then done. You may end up with the effect far from what you desired or even the opposite to intended. The most risky part is that at any point you don’t want to tell the player what to do; don’t interfere with freedom of choice. Only some in-character things like certain traits are allowed to do that.

Of course I’m generalizing here. It it was a discussion over some particular sfx and it’s potential hook, it’d easier to distinguish between doable and not-doable.

1 Like

I was gonna suggest something like this myself, it could start it simple. Just have different boss themes like hulk currently has. Different ambient music sets for exploring in city and in the wilderness, as well as night and day. I don’t see why there couldn’t be a danger level 0 where there are enemies nearby but they aren’t seen.