Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proximity Voice Chat Enhancements #1491

Open
3 of 4 tasks
ruby0b opened this issue Mar 29, 2024 · 11 comments
Open
3 of 4 tasks

Proximity Voice Chat Enhancements #1491

ruby0b opened this issue Mar 29, 2024 · 11 comments
Labels
type/rework Big changes or overhaul of an existing feature

Comments

@ruby0b
Copy link
Contributor

ruby0b commented Mar 29, 2024

Planning to implement most of these myself as mentioned on the Discord, just putting a cleaned up list here to keep track / discuss:

Server-side:

Client-side:

@Histalek Histalek added the type/rework Big changes or overhaul of an existing feature label Mar 30, 2024
@Histalek Histalek added this to the v0.14.0b milestone Mar 30, 2024
@TimGoll
Copy link
Member

TimGoll commented Mar 30, 2024

Nice to see you working on that. Together with my UI rework, the 0.14.0 update will feature quite a lot of voice chat improvements!

@TimGoll
Copy link
Member

TimGoll commented Apr 6, 2024

Voice chat toggle keybinding (upstreaming https://github.com/ruby0b/ttt2-voice-chat-toggle)

What's the general consensus on this? Should this really be a secondary keybind? Or a setting in the client voice setting where you can switch between different modes like "push to talk", "push to mute", "toggle" and "voice activation"?

IMHO we don't need a new keybind for this. It could use the already existing one. We should also make sure that the global voicechat is automatically muted as soon as the team voice chat is engaged.

@ruby0b
Copy link
Contributor Author

ruby0b commented Apr 6, 2024

I agree that it's probably unnecessary to introduce another keybind, we should just use a dropdown for the different options.
Toggle and voice activation would be the same thing though because as far as I can tell the voice chat always uses some built-in threshold, right?

I found it a bit difficult to wrap my head around how team chat should work when using anything other than push-to-talk, so I made some diagrams.
I guess for toggle it would be like this (G = global voice chat key, T = team voice chat key):
image

Push to mute seems a little more confusing since pressing the key is supposed to mute you.
But I guess it could work like this, where you switch voice chat by pressing and then releasing the key:
image

@TimGoll
Copy link
Member

TimGoll commented Apr 6, 2024

as far as I can tell the voice chat always uses some built-in threshold, right?

Yes, but you still have to press a key to start talking. I'd like to add an option to use voice without. Maybe it doesn't work like I thought, then I'll scrap that idea.

About your other question: I thought these fancy voice modes are only relevant for global voice chat. I think team voice can always be push to talk, this would make it so much simpler. No matter what mode you are in, as soon as the team chat key is pressed, the global voice is muted.

@ruby0b
Copy link
Contributor Author

ruby0b commented Apr 6, 2024

Makes sense, there's probably no reason to use anything other than push-to-talk for team voice.
Would releasing the team voice key always put you back to being muted or would it be "smart" and put you back into the global voice state you had previously? (The former would probably be simpler to implement)

About having to press the toggle to start talking: I think you essentially want the game to automatically press the toggle bind once whenever you join, right?
So something like this line that I'm using in my addon:

hook.Add("InitPostEntity", "voice_toggle/AutoEnableVoiceChat",
        function() if cv_auto_enable:GetBool() then voice_enable() end end)

I would probably call that mode "Toggle (on by default)" or something like that (and maybe call the regular toggle "Toggle (off by default)"?).
Could also just be a sub-option that's greyed out if you're not using toggle (if it's possible to conditionally grey out options).

@TimGoll
Copy link
Member

TimGoll commented Apr 6, 2024

or would it be "smart" and put you back into the global voice state you had previously?

Depends on the mode: If it was in toggle mode and previously enabled, it should return to being enabled. If it was in push to talk and the global talk key is no longer pressed, it should be disabled. And so on.

The rest looks good to me, but imho such details can be discussed later on

@TimGoll
Copy link
Member

TimGoll commented Apr 11, 2024

@ruby0b You seem to be more knowledgeable than me with this topic. Does your #1503 address the issue described in #1482? To me it seems like it is only possible to cut off the voice chat range, not to extend it

@ruby0b
Copy link
Contributor Author

ruby0b commented Apr 11, 2024

The way I understand it, 3D sound is very much baked into gmod itself and it sadly exposes no way to configure it besides turning it on and off in the PlayerCanHearPlayers hook.
This 3D sound does not seem to have any cutoff, instead just getting very quiet at long distances, so technically the range is infinite by default!
Cutting the voice range short in the way I've done in #1503 was fairly simple but is of course not that clean since now the volume is not a continuous function that approaches 0 as the speaker is nearing the range cutoff but rather we just have a hard drop to 0 once the speaker goes out of range.

Of course we do have ways to modify the audio output of each player and so we could downscale the volume accordingly with our cut-off point (which I think is what @EntranceJew is proposing in #1482).
I'm not sure if we can increase the volume of far away players this way since we can't upscale player volumes afaik, would have to check.

At the end of the day there's always the option of manually processing incoming voice data from clients and writing an entirely custom 3d voice implementation on the server which would solve all of these issues but that would obviously be non-trivial and can probably not be done in pure lua :)

@TimGoll
Copy link
Member

TimGoll commented Apr 11, 2024

Thanks for that insight, I'll relay that information to that issue

@TimGoll
Copy link
Member

TimGoll commented Apr 12, 2024

I forgot where we had this discussion, but the voice UI now supports team changes, the change was rather easy: 86881f4

@TimGoll TimGoll modified the milestones: v0.14.0b, Feature Backlog Aug 20, 2024
@TimGoll
Copy link
Member

TimGoll commented Aug 20, 2024

Updated the milestone to give you more time to finish the last todo on your list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/rework Big changes or overhaul of an existing feature
Projects
None yet
Development

No branches or pull requests

3 participants