Voice Chat is a staple of modern multiplayer games.
Many games include more open world aspects and the majority of players set their focus on having positional Voice Chat. As a result, this audio data is attenuated (lowered in volume) over distance.
Is VOIPTalker Voice Chat Difficult?
No, not at all!
Implementing Positional Voice Chat into your UE4 multiplayer game only using blueprints is simple and requires very little knowledge of how the backend C++ code works.
Adding this system to my own project initially was very difficult due to the lack of resources available from both the community and Epic themselves on their wiki.
As I don’t want anyone to follow the painful nights of troubleshooting like it did, I have created this guide for the UE4 community to enhance their own projects.
Examples of proximity and positional voice chat
- Rust https://rust.facepunch.com/ developed by Facepunch Studios
- PUBG https://www.pubg.com/ developed by PUBG Corporation
- Fortnite https://www.epicgames.com/fortnite/en-US/home developed by Epic Games
- Unreal Engine version 4.19 and above.
- The new audio mixer and associated plugins be enabled. (If not using Unreal Engine 4.24)
Complete these requirements to move onto adding the VOIPTalker component.
The VOIPTalker Component
Adding the Component
The VOIPTalker component intercepts voice data and runs it through any effects or attenuation thus preventing player voices playing directly to the players.
Firstly, on your character blueprint, type create the blueprint node named Add VOIPTalker and attach it to your Begin Play event.
From the return value pin, promote the new VOIPTalker to a new variable. Call this variable something relevant as we will use this again soon. I named this VOIP.
Validating the Player State
Next, connected to your Add VOIPTalker node, we need check if the PlayerState is valid and as a result, preventing failure during VOIPTalker’s initialisation.
There are far more pretty ways of doing this check but reliability and simplicity is key for understanding how this system works.
At this step, the code should look like this.
Registering Voice Chat data to the Player State
VOIPTalker in its current setup, can’t receive any voice data.
We now need to assign the correct PlayerState.
Using the Register with Player State node, we can assign the target pin to the promoted variable we created earlier. In the earlier steps we named this VOIP.
In the owning state pin, the PlayerState variable needs to be connected.
When using this system I found that the microphone sensitivity was far to low to sustain voice chat without stuttering or cutting out entirely.
To fix this simply create a Set Mic Threshold node and set it to -1.
VOIPTalker Voice Settings
We are almost there!
VOIPTalker by default has no effects, location for the sound to originate from or attenuation preset.
From the VOIP variable, drag and type set settings to create this node shown below.
This node gives us the ability to define the settings we want for our voice chat.
Set Component to Attach to a reference to the player’s camera. This will appear to make the audio originate from the player’s mouth.
I created a specific attenuation class for VOIP which will more accurately reduce volume over distance in the context of speech. You can create and set your own Attenuation class in here and tweak till it sounds right.
In the content browser create a new source effect chain class and leave it empty. Assign the source effect chain setting option to this new class.
The entire system is fairly simple. The lack of documentation is the difficult part.
Here is the complete blueprint nodes all inside my player character blueprint.
Download the Project Files
Positional Voice Chat should be well documented and developed considering how many games use this feature.
If you found this tutorial useful please share to other developers, family and friends because I believe that this takes very little time to set up and adds a whole dimension of gameplay.
Developers should not have to rely on custom C++ solutions for basic multiplayer features.