TTT-2 / TTT2

Trouble in Terrorist Town 2 for Garry's Mod (gmod)
https://steamcommunity.com/sharedfiles/filedetails/?id=1357204556
172 stars 72 forks source link

Option to edit voice chat range #1482

Closed Spieler2301 closed 4 months ago

Spieler2301 commented 6 months ago

My ttt group is currently really interested in using the ingame voice chat instead of discord (or simmilar). But we noticed that the range of a players voice is relatively short, and that ttt2 doesnt seem to add an option to adjust it

I think a good and modular approach would be a 2 slider system. One to define a small range where a players voice stays at a consistent 100%. And a second one to define the range where a players voice can no longer be heared. (Between those two point the loudness could just drop linearly. This approach would probably need a small description next to the second slider that reminds the player what the default 100 to 0 distance is. If, by default, a players voice cant be heared after more than 800 hammer units, the tooltip could remind the player to keep the distance between slider 1 and 2 at roughly 800.)

Alternative Solution: If this approach turns out to be to complicated for users to understand, a more straight forward but less interesting solution could be to just add the first slider to define the area where the voice stays at 100%. (After that range, the voice drop off could stay the same as it currently is.)

TimGoll commented 6 months ago

This is definitely something I will consider in my current voice chat rework for v0.14.0! Thanks!

EntranceJew commented 6 months ago

fwiw the can-hear hook that SMORE uses for this can only diminish the audible range of speaking and cannot increase the base range

to implement the sliders it would be ideal to use a 0 to 1 scale against the SetVolume scale actively against the preferrential volume that is already assigned so that there is not a sharp cutoff like SMORE's implementation

i'm not certain how taxing an implementation like this would be but there is very little one can do to do this without a dll, but it should NOT be done in the canhearplayer hook because it is called way too often, this should be done in Think or slower

the reasoning is that voice playing during post-round from a spectator or from a player no longer nearby will still receive at full volume for up to two seconds afterward

also look into DarkRP's spatial canhear hook because a simple optimized blocked distance check is insufficient, as occasionally out of range players still within the PAS will be audible from 0,0,0 and suffice to say it will never be fixed

TimGoll commented 4 months ago

Sadly, I don't think this is possible as discussed here: https://github.com/TTT-2/TTT2/issues/1491#issuecomment-2049963387

If someone has any idea how to implement the request I'm all for it as I'd like to have that as well. But for now I'll close this as I don't think we can do anything about that