1.首先要安装Steam
2.开启UE4的Steam插件,然后重启项目
3.配置工程文件的“DefaultEngine.ini”文件,写上
[/Script/Engine.Engine]
!NetDriverDefinitions=ClearArray
; Uncomment the next line if you are using the Null Subsystem
;-NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="/Script/OnlineSubsystemUtils.IpNetDriver",DriverClassNameFallback="/Script/OnlineSubsystemUtils.IpNetDriver")
; Uncomment the next line if you are using the Steam Subsystem
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="OnlineSubsystemSteam.SteamNetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")
[OnlineSubsystem]
PollingIntervalInMs=20
; Uncomment the following line to use the Null Subsystem
;DefaultPlatformService=Null
; Uncomment the following lines to use the Steam Subsystem
DefaultPlatformService=Steam
VoiceNotificationDelta=0.2
[OnlineSubsystemSteam]
bEnabled=true
SteamDevAppId=480
SteamAppId=480
GameServerQueryPort=27015
bRelaunchInSteam=false
GameVersion=1.0.0.0
bVACEnabled=1
bAllowP2PPacketRelay=true
P2PConnectionTimeout=90
; This is to prevent subsystem from reading other achievements that may be defined in parent .ini
Achievement_0_Id=""
OR
[/Script/Engine.GameEngine]
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="OnlineSubsystemSteam.SteamNetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")
[OnlineSubsystem]
DefaultPlatformService=Steam
bHasVoiceEnabled=true
[OnlineSubsystemSteam]
bEnabled=true
SteamDevAppId=480
[Voice]
bEnabled=true
[Core.Log]
LogNet=verbose
LogOnline=verbose
LogVoice=verbose
[/Script/OnlineSubsystemSteam.SteamNetDriver]
NetConnectionClassName="OnlineSubsystemSteam.SteamNetConnection"
4.重启项目,独立运行游戏
DefaultGame.ini 声音
[/Script/Engine.GameSession]
bRequiresPushToTalk=true
按Shift+Tab出现下图
PS:新版参考http://www.v5xy.com/?p=951
https://imzlp.me/notes/#Wget%E4%B8%8B%E8%BD%BD%E7%BD%91%E7%AB%99