ValveSoftware / Source-1-Games

Source 1 based games such as TF2 and Counter-Strike: Source
647 stars 75 forks source link

[TF2] Sound Issues on the Team Selection screen and how to fix them. #5529

Open Bumbo-Walrusoni opened 8 months ago

Bumbo-Walrusoni commented 8 months ago

This specially regards the Team Selection Screen and not the Class Selection Screen.

On TF2's launch, when hovering over the Spectate TV, rapidly hovering over it would not cause the sounds to overlap. This is shown below.

https://github.com/ValveSoftware/Source-1-Games/assets/86118282/8f626dae-ae34-47a1-9860-17b5fa0d004a

After TF2's many updates, this is no longer the case (Ignore the weird buzz when it's completely silent, that is an issue with my headphones registering my mic when it's put up.)

https://github.com/ValveSoftware/Source-1-Games/assets/86118282/b7115961-f3d1-4cfd-a35e-60667ffed2a6

From what I've found, this is due to being in the "CHAN_STATIC" as opposed to the "CHAN_ITEM" that it was on release. Setting the channel to that fixes the overlapping issue, but there still is one problem.

Included since TF2's release, there is a sound called "tv_static" that was intended to play when on the team selection screen. It even has a sound definition. Despite this, it marked to play "misc/null.wav", meaning that it just plays silence briefly. Setting to play "ui/tv_static.wav", (as well as also changing the channel from "CHAN_STATIC" to "CHAN_ITEM", as despite being unused, it was also changed at some point in time) has it play as intended. A demonstration of both of these fixes are shown below:

https://github.com/ValveSoftware/Source-1-Games/assets/86118282/82ca4e55-6c8e-4fe0-8bc6-800d3f2732e7

This also fixes the Arena Mode Screen as well:

https://github.com/ValveSoftware/Source-1-Games/assets/86118282/7f8e074f-78a0-4568-ac36-374e3e8f907a

The sound definitions for both are located in "game_sounds.txt" Here is what both should look like after the changes have been made.

"TV.Static"
{
    "channel"   "CHAN_ITEM"
    "volume"    ".15"
    "pitch"     "100"
    "soundlevel"    "SNDLVL_NONE"
    "wave"      "ui/tv_static.wav"
}

"TV.Tune"
{
    "channel"       "CHAN_ITEM"
    "volume"        "1"
    "pitch"     "100"
    "soundlevel"    "SNDLVL_NONE"
    "rndwave"   [$WIN32]
    {
        "wave"  "ui/tv_tune.mp3"
        "wave"  "ui/tv_tune2.mp3"
        "wave"  "ui/tv_tune3.mp3"
    }

    "rndwave"   [$X360]
    {
        "wave"  "ui/tv_tune.wav"
        "wave"  "ui/tv_tune2.wav"
        "wave"  "ui/tv_tune3.wav"
    }
}

Here is what they both currently look like for reference:

"TV.Static"
{
    "channel"       "CHAN_STATIC"
    "volume"        ".15"
    "pitch"     "100"
    "soundlevel"    "SNDLVL_NONE"
    "wave"      "misc/null.wav"
}

"TV.Tune"
{
    "channel"       "CHAN_STATIC"
    "volume"        "1"
    "pitch"     "100"
    "soundlevel"    "SNDLVL_NONE"
    "rndwave"   [$WIN32]
    {
        "wave"  "ui/tv_tune.mp3"
        "wave"  "ui/tv_tune2.mp3"
        "wave"  "ui/tv_tune3.mp3"
    }

    "rndwave"   [$X360]
    {
        "wave"  "ui/tv_tune.wav"
        "wave"  "ui/tv_tune2.wav"
        "wave"  "ui/tv_tune3.wav"
    }
}
JoriKos commented 8 months ago

To be honest the static sounds kinda annoying, I wouldn't want that

Whurrhurr commented 8 months ago

the tv static sound also keeps playing even when you're not in the team selection menu, closing and re-opening the team selection menu results in multiple instances of ui/tv_static.wav playing. image

Bumbo-Walrusoni commented 8 months ago

One thing the TF team could do would be once you select a team, the game could specifically clear sounds currently playing in CHAN_ITEM, which only contain the Sentry's, Teleporter's, The Dragon's Fury, The Thermal Thruster, and a few miscellaneous taunt sounds (Soldier Firing his Shotgun, Soldier's clothes rustling on the class select screen, the bell during Heavy's boxing glove taunt, and the class select sounds for Pyro and Heavy.)

You could just also do the channel change, but not change the sound that plays from "misc/null".

One solution is more complicated than the other though.