Stupid Question - Workshop and music

Hi there,

I’m around here for a while, but I never dared to post a message. Here we are.

So, my question may seem stupid (because I don’t know anything about the way the Workshop works) but I just wondered : is that possible to put your custom soundtrack instead of the official one (which is real good, btw) ?

The thing is : I’m currently working on a more noisy/electronic/ambient/atmospheric soundtrack, more like the way the original soundtrack was. I think about more ambient soundscapes, creepier and scarier.
Don’t know if this question has already been asked, though.

Consequently, I plan to post it on the workshop if it’s possible (once it’s finished) to let others enjoy it.

Anybody knows ?

Sorry if there was a topic on this matter already.

Totally possible.

You’ll need gcfscape to crack open the bms_sounds_misc_dir.vpk file in order to get the right file names for the music (under sound/music/) you want to replace so it works ingame, then convert the music you’re replacing it with into .ogg format.
Like other content, your custom music will probably have to be in a vpk for it to work. Just follow this guide to do that.

While I like the idea, there are some standing technical issues that we’ve been trying to get the BM team to resolve which may affect a mod like this:

  • In theory, just giving your music the same titles as the originals and putting it in an analogous file system will get it to replace- however, I have not tried this myself and some assets are weirdly resistant to replacement.
  • Soundscapes, and anything else in the Scripts folder for that matter, can be very difficult to replace. You may not be able to replace canonical ones, or add new ones at all.
  • Players may or may not need to use snd_restart to actually cause the mod to run.
    EDIT: Ninja’d. It’s also notable that you can open and recompress vpks just by dragging the vpk (or the folder produced) over vpk.exe in the bin folder of your game directory.

Thanks for theses replies.

I currently only plan to change the original soundtrack, not the ambient sound.
So I guess the only way is to try and see. I was thinking about change it directly .gcf (or .vpk now) files but I wondered if it would work.

About additional sounds : I guess I would need to re-compile maps (which is, I think, simply not possible) to add triggers to add more tracks during game ?
Or is there a trickshot of death to force the game playing a given track at a given moment ?

Okay, you answered the question I just asked.
When I was using Hammer, I learned about entities which play sounds (I think they are called ambient, if I remember well). Why are tracks or other ambient sounds not triggered by such entities, as you say this is a script ?

There are a couple of different things in Black Mesa that play sounds- the ones you seem interested in are ambient_generic entities, which play specific sound effects at specific times (including music tracks) and soundscape entities which play general background noises (like clanks and rumbles underground, distant gunfire topside, and sloshing water in flooded rooms) that don’t have one specific cue. Both reference outside sound files- if you change the files in question, every instance of the old sound will (in theory- see below) be replaced with the new one.

Ambient_generics reference an actual .wav file, by name. Since most music tracks are played in only one place, you can just name your new music to the old name and it will (hopefully) replace the music that plays without having to touch any of the maps. Given that there are a few people who have released soundtrack mods as is, this seems to work. However, if you wanted to create new music that plays where nothing played before, you would indeed need to edit the maps.

Soundscapes are more complicated. They too reference files that tell them what to play, but these are text-based and written in an odd sort of scripting language- it’s not hard to learn, but Black Mesa is terribly buggy about accepting modded content that uses these scripts. In theory if you changed one of the scripts the background noise in certain areas would change, but be aware that a lot of different places have the same soundscript referenced and changing one may change other areas you don’t expect. If you wanted to change the soundscape in one specific area to something else without affecting others, or wanted to add subsections of completely new background noises, you would need to alter the maps themselves.

All right, got it now.
Thanks a lot.

Well, I guess I got to work on the tracks right now.
I’ll try to give you some samples/examples of the kind of stuff I’m talking about sometime soon.

See ya around there !

Small note about custom sounds for workshop that isn’t overriding old files:

Sadly for custom .wavs and .oggs to work properly in workshop, you need to use a point_clientcommand, input command snd_restart

This is because the game doesn’t find the sounds when the map is loaded (You’ll see plenty of red lines whining about it).
This breaks ambient_generics with the Start Silent flag unchecked, as snd_restart mutes all playing sounds.

The sounds work when placed in folder in your bms folder, but when you upload them to the steamworkshop and remove them from the bms folder, you’ll see the errors.

The user can also run the snd_restart command themselves from the console.

Yeah but forcing the user to input console commands is bad practice.
Getting them to use the console and type in map mapname is hard enough, have them input snd_restart manually and you’ll
see your comment wall spammed to death on how sounds doesn’t play.

(Talking about custom maps here)

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.