Steam Voice Chat

Added Steam Voice Chat
This commit is contained in:
Risensy
2025-01-31 20:11:37 +03:00
parent 3809863570
commit 9b48d08d57
92 changed files with 121 additions and 27 deletions

View File

@@ -12,7 +12,7 @@ GlobalDefaultGameMode=/Game/ThirdPerson/Blueprints/BP_ThirdPersonGameMode.BP_Thi
GlobalDefaultServerGameMode=None GlobalDefaultServerGameMode=None
[/Script/Engine.RendererSettings] [/Script/Engine.RendererSettings]
r.ReflectionMethod=2 r.ReflectionMethod=0
r.GenerateMeshDistanceFields=False r.GenerateMeshDistanceFields=False
r.DynamicGlobalIlluminationMethod=0 r.DynamicGlobalIlluminationMethod=0
r.Lumen.TraceMeshSDFs=1 r.Lumen.TraceMeshSDFs=1
@@ -22,6 +22,7 @@ r.DefaultFeature.AutoExposure.ExtendDefaultLuminanceRange=True
r.DefaultFeature.AutoExposure.ExtendDefaultLuminanceRange=true r.DefaultFeature.AutoExposure.ExtendDefaultLuminanceRange=true
net.AllowPIESeamlessTravel=true net.AllowPIESeamlessTravel=true
r.DefaultFeature.AutoExposure=False r.DefaultFeature.AutoExposure=False
r.Lumen.Reflections.HardwareRayTracing.Translucent.Refraction.EnableForProject=False
[/Script/WindowsTargetPlatform.WindowsTargetSettings] [/Script/WindowsTargetPlatform.WindowsTargetSettings]
DefaultGraphicsRHI=DefaultGraphicsRHI_DX12 DefaultGraphicsRHI=DefaultGraphicsRHI_DX12
@@ -82,6 +83,16 @@ ManualIPAddress=
[OnlineSubsystem] [OnlineSubsystem]
DefaultPlatformService=Steam DefaultPlatformService=Steam
bHasVoiceEnabled=true
VoiceNotificationDelta=0.2
MaxLocalTalkers=1
MaxRemoteTalkers=16
PollingIntervalInMs=20
bUseBuildIdOverride=false
BuildIdOverride=0
!AdditionalModulesToLoad=Clear
+AdditionalModulesToLoad=HTTP
+AdditionalModulesToLoad=XMPP
[OnlineSubsystemSteam] [OnlineSubsystemSteam]
bEnabled=true bEnabled=true
@@ -94,3 +105,11 @@ bAllowP2PPacketRelay=true
[/Script/OnlineSubsystemSteam.SteamNetDriver] [/Script/OnlineSubsystemSteam.SteamNetDriver]
NetConnectionClassName="OnlineSubsystemSteam.SteamNetConnection" NetConnectionClassName="OnlineSubsystemSteam.SteamNetConnection"
[Voice]
bEnabled=true
[/Script/Engine.AudioSettings]
VoiPSoundClass=/Engine/EngineSounds/Voice.Voice
VoiPSampleRate=Normal24000Hz

View File

@@ -107,3 +107,5 @@ PerPlatformBuildConfig=()
PerPlatformTargetFlavorName=(("Android", "Android_ASTC")) PerPlatformTargetFlavorName=(("Android", "Android_ASTC"))
PerPlatformBuildTarget=() PerPlatformBuildTarget=()
[/Script/Engine.GameSession]
bRequiresPushToTalk=true

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@@ -102,6 +102,14 @@ void UFindFriendSessionCallbackProxy::OnFindFriendSessionCompleted(int32 LocalPl
{ {
FBlueprintSessionResult BSesh; FBlueprintSessionResult BSesh;
BSesh.OnlineResult = Sesh; BSesh.OnlineResult = Sesh;
// Temp for 5.5, force the values if epic isn't setting them, lobbies should always have these true
if (!BSesh.OnlineResult.Session.SessionSettings.bIsDedicated)
{
BSesh.OnlineResult.Session.SessionSettings.bUseLobbiesIfAvailable = true;
BSesh.OnlineResult.Session.SessionSettings.bUsesPresence = true;
}
Result.Add(BSesh); Result.Add(BSesh);
} }
} }

View File

@@ -38,14 +38,27 @@ public:
void Initialize(USteamNotificationsSubsystem* MyParent) void Initialize(USteamNotificationsSubsystem* MyParent)
{ {
ParentSubsystem = MyParent; ParentSubsystem = MyParent;
#if (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED
OnExternalUITriggeredCallback.Register(this, &USteamNotificationsSubsystem::cSteamEventsStore::OnExternalUITriggered);
#endif
}
void UnInitialize(USteamNotificationsSubsystem* MyParent)
{
#if (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED
OnExternalUITriggeredCallback.Unregister();
#endif
} }
#if (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED #if (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED
cSteamEventsStore() : cSteamEventsStore()
OnExternalUITriggeredCallback(this, &cSteamEventsStore::OnExternalUITriggered) {}
//:
/*OnExternalUITriggeredCallback(this, &cSteamEventsStore::OnExternalUITriggered)
{ {
} }*/
#else #else
//cSteamEventsStore() //cSteamEventsStore()
//{ //{
@@ -57,7 +70,8 @@ public:
private: private:
#if (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED #if (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED
STEAM_CALLBACK(cSteamEventsStore, OnExternalUITriggered, GameOverlayActivated_t, OnExternalUITriggeredCallback); //STEAM_CALLBACK(cSteamEventsStore, OnExternalUITriggered, GameOverlayActivated_t, OnExternalUITriggeredCallback);
STEAM_CALLBACK_MANUAL(cSteamEventsStore, OnExternalUITriggered, GameOverlayActivated_t, OnExternalUITriggeredCallback);
#endif #endif
}; };
@@ -72,7 +86,7 @@ public:
/** Implement this for deinitialization of instances of the system */ /** Implement this for deinitialization of instances of the system */
virtual void Deinitialize() override virtual void Deinitialize() override
{ {
MyEvents.UnInitialize(this);
} }
}; };

View File

@@ -0,0 +1 @@
Readme and documentation will be worked on soon

View File

@@ -1,2 +0,0 @@
* text=auto
*.bat eol=crlf

View File

@@ -1,10 +0,0 @@
.hg/
binaries/
deriveddatacache/
.vs/
build/
intermediate/
PACKPLUGIN/
saved/
*.orig

View File

@@ -1,7 +0,0 @@
### How do I use it? ###
**KantanDocGen Automatic Documentation ([KantanDocGen](http://kantandev.com/free/kantan-doc-gen))**
**[AdvancedSessions](https://vreue4.com/generated-node-documentation?section=advanced-sessions-plugin)**
**[AdvancedSteamSessions](https://vreue4.com/generated-node-documentation?section=advanced-steam-sessions-plugin)**

View File

@@ -0,0 +1,23 @@
// Fill out your copyright notice in the Description page of Project Settings.
#include "VOIPLIB.h"
void UVOIPLIB::ClearVoicePackets(UObject* WorldContextObject)
{
UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull);
if (!IsValid(World))
{
return;
}
IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(World);
if (!VoiceInterface.IsValid())
{
UE_LOG(LogTemp, Warning, TEXT("Clear voice packets couldn't get the voice interface!"));
}
VoiceInterface->ClearVoicePackets();
}

View File

@@ -0,0 +1,26 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "BlueprintDataDefinitions.h"
#include "Online.h"
#include "OnlineSubsystem.h"
#include "Interfaces/VoiceInterface.h"
#include "Engine/GameInstance.h"
#include "UObject/UObjectIterator.h"
#include "VOIPLIB.generated.h"
/**
*
*/
UCLASS()
class STEAM_API UVOIPLIB : public UBlueprintFunctionLibrary
{
GENERATED_BODY()
public:
UFUNCTION(BlueprintCallable, Category = "VOIPLIB")
static void ClearVoicePackets(UObject* WorldContextObject);
};

View File

@@ -8,7 +8,7 @@ public class Steam : ModuleRules
{ {
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" }); PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "OnlineSubsystem", "AdvancedSessions" });
PrivateDependencyModuleNames.AddRange(new string[] { }); PrivateDependencyModuleNames.AddRange(new string[] { });

View File

@@ -7,7 +7,10 @@
{ {
"Name": "Steam", "Name": "Steam",
"Type": "Runtime", "Type": "Runtime",
"LoadingPhase": "Default" "LoadingPhase": "Default",
"AdditionalDependencies": [
"Engine"
]
} }
], ],
"Plugins": [ "Plugins": [
@@ -48,6 +51,10 @@
{ {
"Name": "OnlineSubsystemNull", "Name": "OnlineSubsystemNull",
"Enabled": true "Enabled": true
},
{
"Name": "SoundUtilities",
"Enabled": true
} }
], ],
"TargetPlatforms": [ "TargetPlatforms": [

13
Voice Chat Forums.txt Normal file
View File

@@ -0,0 +1,13 @@
Voice audio settings - https://forums.unrealengine.com/t/why-is-my-mic-volume-extemely-low/472329/8?u=risensyofficial
Voice very quiet with poor quality audio - https://forums.unrealengine.com/t/voiptalker-mic-pickup-very-quiet-with-poor-quality-audio-playback-4-26/211239/3?u=risensyofficial
The solution that I initially chose, but then adapted and optimized for the final result that I showed in the video - https://forums.unrealengine.com/t/voice-chat-is-not-attenuating/1279745?u=risensyofficial
VOIP instability in OSS Steam - https://forums.unrealengine.com/t/voip-unstable-on-steam-network-saturated/372459/15?u=risensyofficial
VOIP Game Crash When Player Kicks - https://forums.unrealengine.com/t/voip-crashes-game-if-player-is-kicked-by-server/485596?u=risensyofficial
Lag, distortion in VOIP in OSS Steam - https://forums.unrealengine.com/t/state-of-voice-chat-using-the-steam-subsystem/130385?u=risensyofficial
Message that functions such as Remote Talker and others where the word "Remote" is present require another computer - https://forums.unrealengine.com/t/advanced-sessions-plugin/30020/2022?u=risensyofficial