Custom audio not playing in Workshop UGC

Sound mounting via the workshop appears to be broken. When mounting the content as a folder directory using gameinfo.txt, or using a vpk and mounting with gameinfo.txt, the audio plays fine, but the same vpk mounted via the workshop system will not play any custom sounds, instead spitting out error messages with the following format:

[tt]Cannot figure out which search path sound\stojkeholm\sh_sinetone.wav came from. Absolute path is A:\Program Files\Steam\steamapps\workshop\content\362890\1282390981\stojkeholm.vpk\sound\stojkeholm\sh_sinetone.wav[/tt]
I have opened up the workshop version of the vpk and confirmed that the file does still exist in the vpk and hasn’t been pruned from the package by the publish tool somehow, so this is a mounting issue.

I’m just about wrapped up with a workshop release but the map relies heavily on custom audio for story and atmospheric purposes, so I’m unable to do a proper release on the workshop until this is fixed - once this is diagnosed and solved internally, I’d appreciate it if a dev responded to this thread or PM’ed me so I know I can launch the map on the workshop when the next patch is released.

EDIT: I should also mention that the same symptoms occur with .ogg files, not just .wavs, though the error message is different -
[tt]
Failed to create decoder for MP3 [ {filepath/filename}.ogg ]
[/tt] is repeated constantly after attempting to play one.

The reason they don’t work is because you haven’t included a soundcache file. https://developer.valvesoftware.com/wiki/Soundcache
But Black Mesa doesn’t have the command to generate a soundcache file. snd_writemanifest

So I guess you could load up ep2 and just put all the custom sounds in it and then generate the soundcache file there.

Or you can do my shitty way I did for the Spy maps:
call snd_restart with a point_clientcommand called from a trigger_once when the player starts the level.
The problem with snd_restart is that it stops all currently playing sounds, so you can’t have any sounds play from the start, instead you have to play them with inputs.
However if the player starts the map fresh with a load save, it will not run the snd_restart, thus they will not get the custom sounds.

I suppose I’ll have to look into building a manifest externally then, since I do have a few sounds I play from the beginning. It looks like if you call snd_restart before loading the map the sounds will be fixed for that entire instance, including through load screens, until you restart the local server by loading a save file - but I don’t want to put the burden on the end user if I can avoid it.

If the devs can re-add snd_writemanifest, that would be very helpful!

EDIT: Actually, after a few attempts to build one, I noticed that the VPK I have up on the workshop currently actually does include a sound.cache file, so I guess they’re autogenerated now. Unfortunately, sound still isn;t working on my machine, though oddly enough it did work on another machine one of my playtesters was using, which is very odd.

Are you aware of the [tt]snd_buildcache[/tt] console command? It allows you to build a sound.cache file manually:

[code]“snd_buildcache”

  • Rebulds sound cache for a given search path.[/code]The path must be relative to the “Black Mesa” root folder. So, for example, if you have a folder called “mymod” in the bms folder containing your mod’s folder structure, then if you type the command:

[tt]snd_buildcache bms\mymod[/tt]

a sound.cache file will be created in the bms\mymod\sound folder.

If it’s a .vpk, then you would type:

[tt]snd_buildcache bms\mymod\mymod.vpk[/tt]

and the file mymod.vpk.sound.cache will be created in the bms\mymod folder.

Note that the game will exit as soon as snd_buildcache command finishes regardless of whether the sound.cache file was created or not.

I’m not really sure about manifest files, though. The snd_buildcache command seems to work without them. I note that the stock maps folder contains a soundcache folder which contains manifest files for every map.

I tried the [tt]-makereslists[/tt] command-line option as described on the VDC page, but there seems to be a bug in which the engine tries to read the maps as maps/maps/mymap.bsp.bsp. Assuming you have a map called mymap.bsp, and you launch with the options [tt]-makereslists +map mymap[/tt], you’ll see something like this in the console log:

engine: -makereslists usage: engine: [ -makereslists <optionalscriptfile> ] -- script file to control more complex makereslists operations (multiple passes, etc.) engine: [ -usereslistfile filename ] -- get map list from specified file, default is to build for maps/*.bsp engine: [ -startmap mapname ] -- restart generation at specified map (after crash, implies resume) engine: [ -condebug ] -- prepend console.log entries with mapname or engine if not in a map engine: [ +map mapname ] -- generate reslists for specified map and exit after that map engine: [ -rebuildaudio ] -- force rebuild of _other_rebuild.cache (metacache) file at exit engine: [ -forever ] -- when you get to the end of the maplist, start over from the top engine: [ -reslistdir ] -- default is 'reslists', use this to override engine: [ -startstage nnn ] -- when running from script file, this starts at specified stage engine: [ -collate ] -- skip everything, just merge the reslist from temp folders to the final folder again engine: CModelLoader::Map_IsValid: No such map 'maps/maps/mymap.bsp.bsp' engine: reslists: No maps found