Music and Map Transitions

One thing that’s always annoyed me (especially in the HL2 games) is how the music stops at loading screens. The worst part is that, often, when the next map loads, you are often continuing the same action that the music scored in the last map, yet now you’re music-less.

I know even Valve’s more current games like Portal 2 have this issue (even though, they are gracious enough to let the music fade out instead of it just suddenly stopping), and I noticed how Black Mesa skirted the issue by timing the tracks and designing the maps so that the song is guaranteed to be finished by the time the next map transition hits (if the game is played as intended). Joel also split the Inbound theme into 3 parts for the same reason.

I’ve heard that the reason this happens is because the sounds are linked to the maps, so when a new map loads, the sound isn’t in that new map, thus it stops. I’m not sure if this really is the issue, but I just wanted to bring it up.

Valve “recently” updated the Steam version of Half-Life (Goldsrc version) to now play music through the map transitions. Is this possible in the Source engine? And if so, if somebody could point me in the right direction to fixing it, that’d be tremendous. Even if it involves writing a CD with the music on it, or something like that.

TL;DR: I hate it when music stops at level transitions. Why does this happen, and how can I fix it?

Thanks!
Swaggless

The sudden stop of music, with the end of the map is no doubt an annoying thing, but I don’t think there is a way to fix that. There are only a very few features the team couldn’t realize they way they were in Half-Life. This is one of those.

FMOD is a thing. Maybe when the mod goes open someone’ll get that fixed up.

The thing that annoys me is that the Forget About Freeman final battle is poorly designed, so the awesome Forget About Freeman track is much, much too long for it. Hell, on my playthroughs, I find that the best course of action is to simply run past the battle, causing nearly all of the Forget About Freeman track to play in the elevator to Lambda Core, which it is hilariously ill-suited for.

Play on hard; don’t run past any battles and problem is solved.

“Don’t run past any battles.”

Immersion. You’re supposed to be Freeman. If my Freeman sees a way to get through a scuffle more safely by promptly running to the nearest exit instead of engaging, he’s damn well going to do it.

I do the same thing… except I kind of like the music in the elevator… I kind of feel like that music represents the chaos on the surface… Chaos I am leaving behind… Besides, having the doors open to that pool of toxic goo kind of makes it feel like the pressure’s still on… I dunno. It still works for me.

Now, what is FMOD? Because, Black Mesa was designed with the idea of not letting the tracks reach the end of a map… Half-Life 2 was not. I’m more looking to fix HL2 (+episodes) rather than BM. HL2s code is open, isn’t it? Could FMOD (depending on what it is…) be applied or referenced to help make this possible for HL2?

EDIT: Ahh. I see now. I’ll have to look at this later. I did see that it mentions music playing while a map is loading.

Then again, this is referring to making mods… but I’m trying to mod HL2, not make a standalone mod… Furthur reading is required! :smiley:

If anyone has any tips or anything, or can point me to another good page with info, I’d appreciate it! Thanks!

I’m pretty sure that page is implementing it into Source, so you should be set no matter what.

Hardly, because…

…the track was designed for that battle. You’re problem is with you running past the battle rather than playing it like the game intends. That’s like complaining that enemies can’t attack you when bunnyhopping.

Yes, on further inspection, it is. I only skimmed the page before, but I got to read it all of the way through today. I do know how to do some programming, but these are unfamiliar, and vast waters. :fffuuu:

From what I can gather, all of the music and sounds in Source are played through it’s proprietary(?) sound system, “Miles”. “FMOD” is a separate program that runs at the same time as the game, and the game can send out commands to FMOD telling it what to do. I don’t want to re-do and port Half-Life 2s entire audio system, because the sound effects and voices are fine. I just want to move the soundtrack to FMOD, which I assume requires me to remove the soundtrack queues from Miles, and have it call FMOD instead. I probably need to grab the MP3s out of the old GCFs and store those separately in an accessible location. I doubt that FMOD knows how to read files from GCFs or VPKs.

Again, any insight or pointers are welcome, and if anyone knows a useful website or page, that’d be awesome! I’ll be doing plenty of digging on my own as well, of course. :stuck_out_tongue:

True, the music could be too long. But Vortal Combat is too long for where it plays too (episode 2, fighting off antlions with griggs and sheckley). This could be solved like they did there; have the music fade out after making it through the battle.

:[

But seriously, though, I like the idea of having the music fade out post-battle. It wouldn’t even be hard, just put a trigger at a certain point after the battle was supposed to have taken place.

I believe the problem has to do with it being the same ‘trigger’ for both reloading of map and loading of next map.

If it is loading of the next map it isnt a problem, but if you do a reload of a map because you died, you now may face hearing the middle to ending of a song as well as an overlapping restart of the song.

Yes, I can see how this’d be a problem. In the HL2 games (last I checked), when you die during a song, if you reload to a time after the song trigger, but before the song ends (or the map changes) the song will just not play on your reload.

I never minded this too much, because it’s like a reward for completing the section the first time. What I don’t like, however, if the “punishment” for finishing the map quickly (having the song stop abruptly)

As for the songs overlapping, in my reading on FMOD, there is a “is sound playing” type command, so I could theoretically have it check if the song is playing already, and have it not play the song again, That that be the case. I may also be able to rig up a way for the song to stop playing when the player dies. That should clear up the issue of reloading the same map, and loading the next map being the same trigger!

I don’t really know for sure at this point. I’m still trying to figure out where to start! :stuck_out_tongue:
I’m gonna keep on poking around for info, of course, but does anyone know where the code
that handles music queues is located, or if I’ll have to decompile the maps and edit the triggers in there?

couldn’t they put a music trigger at the start of the next map?

my problem is that the tracks are too SHORT…

It would just replay the music from the beginning.

The best way to do it, is to create a looping music that plays right after the level changes.

Founded in 2004, Leakfree.org became one of the first online communities dedicated to Valve’s Source engine development. It is more famously known for the formation of Black Mesa: Source under the 'Leakfree Modification Team' handle in September 2004.