Guribo / UdonVoiceUtils

Tools/Components for UDON (VRChat) based worlds. Includes private channels, reverb, auto player range adjustment, etc. for player voices.
https://guribo.github.io/TLP
MIT License
147 stars 4 forks source link

Player Oclussion Factor different in 2 scripts + Some questions #16

Closed ElMoha943 closed 5 months ago

ElMoha943 commented 11 months ago

I believe all player occlusion factors should work in the same direction to avoid errors.

Player Audio Override image

Player Audio Configuration Model image

Having said that, i have some questions, sorry if they are too basic:

Guribo commented 11 months ago

The first image shows the true behaviour, the value on the Player Audio Configuration Model should work the same way, it seems I forgot to update the hint. Edit: After double checking again I saw that you are correct. Thanks for pointing that out!

If im not using the UI to let players change their settings, which script should i use to change the values for all players by default? Im guessing its DefaultConfiguration, but can i get rid of LocalConfiguration and MasterConfiguration?

In that case you only really need to adjust the settings of the LocalConfiguration and you can disable the master and default one. You can not delete them as my main script won't work without them existing.

In the priority settings, a higher one its used first? i would appreciate a tooltip on that one!

That is correct. Higher values give it a higher priority. I will add a tooltip. Thanks!

I have a muting system in place in my map right now which stops working when i add the addon, how can i implement a mute for an specific player and prevent the script from changing his settings again?

There is two solutions maybe:

Solution A

  1. You can exclude the player from being affected by my system by calling the function IgnorePlayer(VRCPlayerApi playerToIgnore) on the PlayerAudioController first
  2. Afterward, you can use your system to mute that player

Note that ignoring players is local only, so you would have to do it on every player side before muting with your system.

Solution B

You can make my system handle the muting.

You can take one of the default prefabs:

  1. set the priority really high
  2. configure the ranges so that players affected by it are inaudible
  3. from some script call the function AddPlayer(VRCPlayerApi playerToAffect) on that prefabs PlayerAudioOverride.

Please note that if you use one of the trigger based examples the muting will only be local to yourself.

If you use one of the room based examples instead this will be synced to all players. However if that muted player rejoins the world they will be unmuted again.

Having that persist for the duration of the instance requires maybe a combination with e.g. my PlayerBlackList as this one remembers players.

Hope this answers your questions.

ElMoha943 commented 11 months ago

Thanx you so much for all your answers! i will use solution A since it seems easier to implement in my current system

ElMoha943 commented 11 months ago

Is there a way to make a microphone be heard in all channels? if not, could I request that feature?

Guribo commented 11 months ago

This feature is not supported currently. However what you can try right now is extending the current microphone script or make your own:

  1. For every private channel create a duplicate of the mics PlayerAudioOverride with all its dependencies
  2. Adjust the channel on each one of them to match one of the used private channels
  3. In the mic script add the player to each override and remove again when the players stops using the mic.

This is not a good solution tho as it will make the mic user lag during mic pickup and mic drop.

Thanks for the suggestion though, I will probably dedicate a few channels to this capability or maybe just add another boolean. I'll put it on my todo list :)

ElMoha943 commented 11 months ago

Thanx for taking the time, i will try to dive into your code and see if i manage to achieve something, if i do i will make sure to post a follow up.

Guribo commented 5 months ago

Can this be closed now?