Hello everyone, I've found what seems to be a bug with the engine relating to looping sounds from ambient_generics (yellow sounds on snd_show 2).
When testing my mod, which is based on Source SDK Base 2013 Multiplayer, I noticed that some map sounds weren't playing, and the console was being filled with "total_channels == MAX_CHANNELS" messages. I investigated using snd_show 2 and it seems that every flavor sound ambient_generic that played a fire sound (as there was lots of torches in the map with a small fire sound next to it) was in the sound list (thus showing up on snd_show 2), regardless of whether or not the sound was actually audible - every ambient_generic playing a looping sound anywhere on the map is in the list. These sounds can't actually be heard audibly. This isn't the same behavior that was in Source SDK Base 2006, as running the map there, sounds from ambient_generics only appear in the sound list if you get close enough to actually hear them. The trail in the mod code ends at engine->EmitAmbientSound(), so on a hunch I investigated Half-Life 2 and found this: If the map "d2_prison_06" is loaded, there are two constantly looping ambient_generics, combine_shield_loop3.wav, coming from combine shield walls. If the map is loaded in Source SDK Base 2006, if you noclip far away enough from the map, they disappear from the sound list, as expected as they cannot possibly be heard. If you load the map in Half-Life 2 though, which has the new engine code, no matter how far away you noclip, the sound is always showing in snd_show 2. Finally, I investigated Team-Fortress 2's map koth_sawmill, which has looping ambient_generic saw sounds, and those play in the sound list regardless of where you are anywhere in the map, or noclipping out of the map. The problem is definitely with ambient sounds from ambient_generics, as using stopsound, ent_fire to stop the sound of ambient_generics, then playing the sounds again, results in the sounds returning to the sound list well out of audible range. The issue going from there appears to be with engine->EmitAmbientSound(). This normally wouldn't be a problem if a map has a small amount of looping ambient sounds, but if the map does have a lot (like flavor sounds from fire), the sound list rapidly gets filled up and new sounds won't play, resulting in "total_channels == MAX_CHANNELS", or audio glitches can be heard. Has anyone else encountered this problem? I'm sure this isn't something I've caused myself, because it happens in Half-Life 2 and Team-Fortress 2 as well. One other note is that the "l" and "r" columns of each sound seem to increase when they should be audible, and this coincides with them appearing in sound list in SDK 2006. In 2013 though, both l and r are 0, yet still playing. Please note that noclipping outside the map does not cause this bug, in fact it causes sounds to stop being played in the 2006 engine. A screenshot of a map suffering from this bug with snd_show 2 and snd_visualize output is available at http://i.imgur.com/MCraGiA.jpg
_______________________________________________ To unsubscribe, edit your list preferences, or view the list archives, please visit: https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders