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

voice_local: fixes and improvements #575

Merged
merged 9 commits into from
Nov 21, 2024

Conversation

Fernando-A-Rocha
Copy link
Contributor

@Fernando-A-Rocha Fernando-A-Rocha commented Nov 15, 2024

This PR doesn't make any new major enhancements to the resource.

It fixes the scripts in terms of logic and security, and adds two important features:

  • new meta.xml settings to configure the following:
  • max voice distance - default 25 units
  • show talking icon above player head - default true
  • voice sound boost multiplier - default 6.0

Testing is recommended on a server with at least 1 other player.

@Dutchman101
Copy link
Member

Dutchman101 commented Nov 16, 2024

The talking icon should remain above any actively talking player's head. Even for the local player itself while they are speaking into mic using the voice_ptt bind. This is not currently the case with your PR..

Please keep feature parity, so that means the above, and removing "VOICE: " texts in the bottom of the screen.
Thanks for refactoring!
@Fernando-A-Rocha

@Fernando-A-Rocha

This comment was marked as outdated.

@Fernando-A-Rocha
Copy link
Contributor Author

@Dutchman101

Check now

@Dutchman101
Copy link
Member

Dutchman101 commented Nov 18, 2024

I've tested and it appears not to be working
Remote players don't hear me, and don't see the speaking icon above my head (while it shows locally). While it works for current version

Your refactored version is bugged still... @Fernando-A-Rocha

But thanks for at least completing the requirements, as it's important that features remain the same, the current version seeks to be like the global "voice" resource but then local, after all. Additional elements in bottom can interfere with custom scripts and modes, and it's not the desired style.

Btw, spams this now:

[2024-11-19 00:43:27] WARNING: [gameplay]\voice_local\server.lua:42: Bad argument @ 'getDistanceBetweenPoints3D' [Expected number at argument 5, got none]
[2024-11-19 00:43:27] ERROR: [gameplay]\voice_local\server.lua:42: attempt to compare boolean with string

Did you even test your code?

@Fernando-A-Rocha
Copy link
Contributor Author

I will perform multiplayer tests again and get back to you. I was using a VM and it's sketchy to get to hear myself... Don't worry, this will be resolved.

@Fernando-A-Rocha
Copy link
Contributor Author

@Dutchman101 Tested. Please give feedback.

Video: https://www.youtube.com/watch?v=ZsMdG7jf-tI

@Fernando-A-Rocha
Copy link
Contributor Author

Fernando-A-Rocha commented Nov 19, 2024

I added a necessary voice boost (multiplier) set to 6.0 (configurable as meta.xml resource setting).
Voice sound volumes at 1.0 cannot be heard, a boost is required.
See comments on multitheftauto/mtasa-blue#327 (comment)

Copy link
Contributor

@ds1-e ds1-e left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some smaller changes

[gameplay]/voice_local/client.lua Outdated Show resolved Hide resolved
[gameplay]/voice_local/client.lua Outdated Show resolved Hide resolved
[gameplay]/voice_local/client.lua Outdated Show resolved Hide resolved
[gameplay]/voice_local/client.lua Outdated Show resolved Hide resolved
[gameplay]/voice_local/server.lua Outdated Show resolved Hide resolved
[gameplay]/voice_local/server.lua Outdated Show resolved Hide resolved
[gameplay]/voice_local/server.lua Outdated Show resolved Hide resolved
[gameplay]/voice_local/client.lua Outdated Show resolved Hide resolved
[gameplay]/voice_local/client.lua Outdated Show resolved Hide resolved
[gameplay]/voice_local/client.lua Outdated Show resolved Hide resolved
@Fernando-A-Rocha
Copy link
Contributor Author

Fernando-A-Rocha commented Nov 21, 2024

I've applied your event handler source suggestions @ds1-e

Main PR post updated.

@Fernando-A-Rocha Fernando-A-Rocha changed the title voice_local: Fixes and improvements voice_local: fixes and improvements Nov 21, 2024
@Dutchman101
Copy link
Member

Thanks for addressing everything, it works fine after testing too.

@Dutchman101 Dutchman101 merged commit 53cf63d into multitheftauto:master Nov 21, 2024
1 check passed
@Fernando-A-Rocha
Copy link
Contributor Author

Thanks for addressing everything, it works fine after testing too.

I'm glad!

Guys, please suggest new features for this resource. I will happily make a new PR.

Reminder: it's a default local 3D voice system, intended to be used by any server, suitable for roleplay, freeroam etc.

Some ideas:

  • add conditions, functions and events to determine when a player can't talk (mute), e.g. when dead or knocked out (RP servers)
  • add customizable on-screen text/icons to display when the voice is being used, like many games do, aside from the icon above player head which can be unwanted (right now it can be disabled)
  • shout and whisper modes
  • voice effects
  • customizable radio channels or player-to-player voice to simulate phone calls

@Dutchman101
Copy link
Member

@Fernando-A-Rocha
The resource still suffers from a bug that was present in the initial version, that you can sometimes hear random player's voices (when no one is near you; those players being on the other side of the map). I got reports about it again, and then witnessed a case of it occuring.

@Fernando-A-Rocha
Copy link
Contributor Author

Can someone please review the code to get more opinions on why the situation described by @Dutchman101 happens?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants