weird sound issue but only for certain players

Vecc

L1: Registered
Feb 11, 2017
10
24
So, lately i've been running playtests for a map im working on and interestingly enough i've had some players have to exec "snd_restart" when spawning due to them lagging via sound?

It's only been two people total having to do this, the rest have been fine and i'm trying to figure out what could cause this for some players?

On mapspawn a short little song will play, 20 secs, then turn off and not be triggered again.

Is it my end, or is it theirs? I can't tell, racking my brain trying to figure it out o_O

ive been thinking of forcing an snd_restart but idk how to, would it be a server or client command? is snd_restart even something you can fire with a logic_auto?
 
Last edited:

Evatron

L2: Junior Member
Oct 23, 2021
54
1
oh yeah this is a familiar one. one of TF2's mystery bugs with no clear fix or cause. have had it happen to myself on 2fort inconsistently.

just gotta do the reset im afraid.
 

worMatty

Repacking Evangelist
aa
Jul 22, 2014
1,259
1,000
ive been thinking of forcing an snd_restart but idk how to, would it be a server or client command? is snd_restart even something you can fire with a logic_auto?
You can't do that.

A few possible causes:

1.

If you change your sound files somehow but keep the same filepath (let's say you changed the compression or length), then clients who have played an older version of the map will have out of date sound cache, so those sounds will be distorted or won't play. I haven't heard of this causing the game to lag but it's something to be aware of. The solution to this problem is for you to change the filepath so clients generate new sound cache, or of it's a private playtest, have participants delete all their sound.cache files. Not ideal.​

2.

There's an issue where if you play too many ambient_generics at once, the game seizes up until they are stopped. I don't fully understand why or who it affects but I have found it tends to happen like this:​
Sending the `volume 0` input to an ambient_generic to stop it doesn't actually stop it, it just pauses it. The sound presumably still occupies a sound channel. If the sound is not playing, sending it this will cause it to activate albeit paused.​
Mappers understandably think they can control the ambient_generics present in the previous round but this is not the case as most entities are deleted and respawned on round restart. Any emitted sounds playing on round restart will be orphaned, and stopped if they are 'looped' (in the entity spawnflags) or allowed to play to the end if not.​
Therefore as you may now see, sending ambient_generics `volume 0` in round restart will not stop anything playing and will in fact cause the entities to use up sound channels.​

3.

If you are using a custom soundscape and have a long sound file in there, then it will be cached when the player first encounters it, and not during map load. This delay is affected by the speed of the player's computer, and is made worse if the map is repacked. The solution is to precache the sound file somehow, either by putting it in an unused ambient_generic, or by using VScript.​
If you're also using a custom soundscript then you can add all the waves to one game sound entry as rndwaves and add that one game sound to an ambient_generic and they will all be precached.​

Does this all make sense and is it helpful?

Read the VDC wiki page for ambient_generic as it has a lot of bugs and quirks.