Is there anyone who can run the Online Subsystem Steam properly in UE 5.6?

Hi I followed the advice given here and enable the steam sockets plugin and changed my .ini and this has allowed me to join the host but on create session it joins the level but then takes me right back to the main menu level. So it solves one issues but gives me another is there a solution to this I have seen other threads talking about this issue with steam sockets but haven’t seen a solution.
Have my own post on the matter: Join Session not working Steam Multiplayer

Works once but cant go to main level and after that its just stop working.

Is there a fix for this problem yet?

Because the solution above doesn’t seem to work (UE5.6).

I have tried it with Steam Sockets and Socket Subsystem Steam (IP) and also adjusted the ini file as described here, but I can neither create a session, let alone join a session (via Steam).

[/Script/Engine.GameEngine]
!NetDriverDefinitions=ClearArray
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="SocketSubsystemSteamIP.SteamNetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")

[OnlineSubsystem]
DefaultPlatformService=Steam

[OnlineSubsystemSteam]
bEnabled=true
SteamDevAppId=480
bInitServerOnClient=true

[/Script/OnlineSubsystemSteam.SteamNetDriver]
NetConnectionClassName="OnlineSubsystemSteam.SteamNetConnection"

Thank you!

1 Like

I am also still having issues on 5.6.1 using Steam Sockets. I am able to create a session and join it via invite, but am not able to get FindSessionsAdvanced to find any servers. Further details here:

Same here. With the new defaultEngine.ini entrys I can open and join a session but server travel seems to be broken as it loads the level for a second and then kicks the player back to the Main Menu. In a exported build I can not even see a crash. It just logs the level start and then instantly the request exit.

1 Like

It loads the default level. This is were I hooked into this bug and my dirty workaround is to change the default level before changing the map on the server. Possibly loads the map two times but better than no map change at all :melting_face:

Add this to your GameInstance and call it in the Blueprint before you change the map on the server:

.h

UFUNCTION(BlueprintCallable) 
void MySetGameDefaultMap(FString NewMap);

.cpp

void USCAdvancedFriendsGameInstance::MySetGameDefaultMap(FString NewMap)
{
    // Really ■■■■■■ workaround for 5.6 server travel loading always the default map instead of the actual map we want...
    // Expects REFERENCE to map ("/Game/Maps/Map_Development.Map_Development") not only map name...
    const UGameMapsSettings* GameMapsSettings = GetDefault<UGameMapsSettings>();
    GameMapsSettings->SetGameDefaultMap(NewMap);
}

Hi.

Thanks for sharing.

In my case I am using bp only so this can not help me.

Waiting for a fix now.

The settings section moved →
old =
[/Script/Engine.GameEngine]
!NetDriverDefinitions=ClearArray
+NetDriverDefinitions=DefName=“GameNetDriver”,DriverClassName=“SocketSubsystemSteamIP.SteamNetDriver”,DriverClassNameFallback=“OnlineSubsystemUtils.IpNetDriver”)

new for shipping=
[/Script/Engine.Engine]
!NetDriverDefinitions=ClearArray
+NetDriverDefinitions=DefName=“GameNetDriver”,DriverClassName=“SocketSubsystemSteamIP.SteamNetDriver”,DriverClassNameFallback=“OnlineSubsystemUtils.IpNetDriver”)

workarround for editor only =
[/Script/Engine.Engine]
+NetDriverDefinitions=DefName=“GameNetDriver”,DriverClassName=“SocketSubsystemSteamIP.SteamNetDriver”,DriverClassNameFallback=“OnlineSubsystemUtils.IpNetDriver”)

theres some issue with “!NetDriverDefinitions=ClearArray” causing the default IP net driver not working in editor

I don’t get it
UE5.6
SteamSockets, listen server
using the previously mentioned:

[/Script/Engine.Engine]
!NetDriverDefinitions=ClearArray
+NetDriverDefinitions=DefName=“GameNetDriver”,DriverClassName=“SocketSubsystemSteamIP.SteamNetDriver”,DriverClassNameFallback=“OnlineSubsystemUtils.IpNetDriver”)

In editor I can make it work (meaning, I can create and join sessions), in a packaged project, I create a session and it instantly terminates, boots me back to the menu

so.. could anyone summarize what’s going on with this post? Feel like I tried all the versions I could scrap together from the above comments.. I’m clearly missing something?

I found a solution using Unreal engine 5.6 and Advanced Sessions… i managed to get all the players on the map on a created session, but only using “open level” node with “listen” in options, it work only in one map, if i try to use a lobby it wont work… server travel still dont work

go to Plugins and search “Steam” and enable the 2 plugins with the name “Sockets”

Then modify your DefaultEngine.ini:

[/Script/Engine.Engine]
!NetDriverDefinitions=ClearArray
+NetDriverDefinitions=(DefName=“GameNetDriver”,DriverClassName=“/Script/SocketSubsystemEOS.NetDriverEOSBase”,DriverClassNameFallback=“OnlineSubsystemUtils.IpNetDriver”)
+NetDriverDefinitions=(DefName=“DemoNetDriver”,DriverClassName=“/Script/Engine.DemoNetDriver”,DriverClassNameFallback=“/Script/Engine.DemoNetDriver”)

[/Script/SocketSubsystemEOS.NetDriverEOSBase]
bIsUsingP2PSockets=true

[OnlineSubsystem]
DefaultPlatformService=Steam

[OnlineSubsystemSteam]
bEnabled=true
SteamDevAppId=480
SteamAppId=480
bInitServerOnClient=true
GameServerQueryPort=27015

[PacketHandlerComponents]
+Components=OnlineSubsystemSteam.SteamAuthComponentModuleInterface

[/Script/OnlineSubsystemSteam.SteamNetDriver]
NetConnectionClassName=“OnlineSubsystemSteam.SteamNetConnection”

working only in editor

for shipping (it works on packaged file, just change this lines)=
[/Script/Engine.Engine]
!NetDriverDefinitions=ClearArray
+NetDriverDefinitions=DefName=“GameNetDriver”,DriverClassName=“SocketSubsystemSteamIP.SteamNetDriver”,DriverClassNameFallback=“OnlineSubsystemUtils.IpNetDriver”)

1 Like

THIS MIGHT BE A NASTY ENGINE BUG that drive us all crazy

Small disclaimer: I am an absolute beginner and found this through trial and error, experimenting with what was posted here. So there might be some unnecessary/contradicting stuff happing.

Here is the .ini setup that allowed me to create,find and join steam sessions after packaging (user project settings, not shipping), using 5.6.1.

[/Script/Engine.GameEngine]
!NetDriverDefinitions=ClearArray
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="/Script/SteamSockets.SteamSocketsNetDriver",DriverClassNameFallback="/Script/SteamSockets.SteamNetSocketsNetDriver")

[OnlineSubsystem]
DefaultPlatformService=Steam
bInitServerOnClient=true

[OnlineSubsystemSteam]
bEnabled=true
SteamDevAppId=480
SteamAppId=480
bInitServerOnClient=true
bUseSteamNetworking=true
bAllowP2PPacketRelay=true
GameServerQueryPort=27015

[PacketHandlerComponents]
+Components=OnlineSubsystemSteam.SteamAuthComponentModuleInterface

[/Script/OnlineSubsystemSteam.SteamNetDriver]
NetConnectionClassName=“OnlineSubsystemSteam.SteamNetConnection”

The only other thing I did was manually adding the steam_appid.txt, containing 480 next to the .exe in the packaged project.

My project setup is based on this tutorial.

Sorry for not being able to provide explanations but maybe it works for someone else.

If you are willing to build the 5.6 engine yourself you can undo this one CL and p2p steam will work without having to resort to steamsockets.

https://eoshelp.epicgames.com/s/article/Why-is-a-P2P-connection-failing-after-a-non-seamless-hard-server-travel?language=en_US

I spent my whole day trying to figure it out why it’ wasn’t working because of the wrong fallback driver you typed in this config. the correct one should be:

[/Script/Engine.GameEngine]
!NetDriverDefinitions=ClearArray
+NetDriverDefinitions=(DefName=“GameNetDriver”,DriverClassName=“/Script/SteamSockets.SteamSocketsNetDriver”,DriverClassNameFallback=“OnlineSubsystemUtils.IpNetDriver”)

Still, thank you and thank everyone who contributed to the fix

1 Like

Even with does change im still having trouble with joining a session.
On listen server, when my other steam account on another PC tries to connect, i get LogSteamSocketsAPI: Warning: SteamSockets API: Warning Ignoring P2P signal from ‘steamid:XXXXXX’, unknown remote connection #YYYYY

I don’t know what to do anymore, tried different values in the config file.

Latest DefaultEngine.ini setup i tried is:

[/Script/Engine.GameEngine]

!NetDriverDefinitions=ClearArray+NetDriverDefinitions=(DefName=“GameNetDriver”,DriverClassName=“/Script/SteamSockets.SteamSocketsNetDriver”,DriverClassNameFallback=“OnlineSubsystemUtils.IpNetDriver”)

; also tried +NetDriverDefinitions=DefName=“GameNetDriver”,DriverClassName=“SocketSubsystemSteamIP.SteamNetDriver”,DriverClassNameFallback=“OnlineSubsystemUtils.IpNetDriver”)

[OnlineSubsystem]

DefaultPlatformService=Steam

[OnlineSubsystemSteam]

bEnabled=true

SteamDevAppId=480

bInitServerOnClient=true

; also without bInitServerOnClient

[SteamNetDriver]

NetConnectionClassName=“/Script/SteamSockets.SteamSocketsNetConnection”

; also tried with NetConnectionClassName=“OnlineSubsystemSteam.SteamNetConnection”

edit: was missing “listen” on the Open Level function, Steam Sockets join session error - #3 by hzFishy

here is my setup

[/Script/Engine.GameEngine]
!NetDriverDefinitions=ClearArray
+NetDriverDefinitions=(DefName="GameNetDriver", DriverClassName="/Script/SteamSockets.SteamSocketsNetDriver", DriverClassNameFallback="/Script/OnlineSubsystemUtils.IpNetDriver")

[OnlineSubsystem]
DefaultPlatformService=Steam

[OnlineSubsystemSteam]
bEnabled=true
SteamDevAppId=480
SteamAppId=480
bInitServerOnClient=true
GameServerQueryPort=27015

[PacketHandlerComponents]
+Components=OnlineSubsystemSteam.SteamAuthComponentModuleInterface

[/Script/OnlineSubsystemSteam.SteamNetDriver]
NetConnectionClassName=“OnlineSubsystemSteam.SteamNetConnection”

[PacketHandlerComponents]
+Components=OnlineSubsystemSteam.SteamAuthComponentModuleInterface

[/Script/OnlineSubsystemSteam.SteamNetDriver]
NetConnectionClassName="OnlineSubsystemSteam.SteamNetConnection"

here is my creation server code c++. Finding, Joining without problem

void UMultiplayerSessionsSubsystem::CreateSession(
	int32 NumPublicConnections,
	FString MapName,
	FString MatchType
)
{
	DesiredNumPublicConnections = NumPublicConnections;
	DesiredMatchType = MatchType;
	if (!SessionInterface.IsValid())
	{
		return;
	}
	auto ExistingSession = SessionInterface->GetNamedSession(NAME_GameSession);
	if (ExistingSession != nullptr)
	{
		bCreateSessionOnDestroy = true;
		LastNumPublicConnections = NumPublicConnections;
		LastMatchName = MapName;
		LastMatchType = MatchType;
		DestroySession();
	}

	// Store the delegate in a FDelegateHandle so we can later remove it from the delegate list
	
	CreateSessionCompleteDelegateHandle = SessionInterface->AddOnCreateSessionCompleteDelegate_Handle(
		CreateSessionCompleteDelegate);

	LastSessionSettings = MakeShareable(new FOnlineSessionSettings());
	LastSessionSettings->bIsLANMatch = Online::GetSubsystem(GetWorld())->GetSubsystemName() == "NULL" ? true : false;
	LastSessionSettings->NumPublicConnections = NumPublicConnections;
	LastSessionSettings->bAllowJoinInProgress = true;
	LastSessionSettings->bAllowJoinViaPresence = true;
	LastSessionSettings->bShouldAdvertise = true;
	LastSessionSettings->bUsesPresence = true;
	LastSessionSettings->bUseLobbiesIfAvailable = true;
	LastSessionSettings->Set(MatchTypeKey, MatchType, EOnlineDataAdvertisementType::ViaOnlineServiceAndPing);
	LastSessionSettings->Set(MapNameKey, MapName, EOnlineDataAdvertisementType::ViaOnlineServiceAndPing);
	
	const FString RoomUUID = FGuid::NewGuid().ToString(EGuidFormats::DigitsWithHyphens);
	LastSessionSettings->Set(RoomNameKey, RoomUUID, EOnlineDataAdvertisementType::ViaOnlineServiceAndPing);
	LastSessionSettings->BuildUniqueId = 1;
	const ULocalPlayer* LocalPlayer = GetWorld()->GetFirstLocalPlayerFromController();

	UE_LOG(LogTemp, Warning, TEXT("CREATE SERVER OSS = %s"),
	       *IOnlineSubsystem::Get()->GetSubsystemName().ToString());

	if (
		!SessionInterface->CreateSession(
			*LocalPlayer->GetPreferredUniqueNetId(),
			NAME_GameSession,
			*LastSessionSettings)
	)
	{
		SessionInterface->ClearOnCreateSessionCompleteDelegate_Handle(CreateSessionCompleteDelegateHandle);
		MultiplayerOnCreateSessionComplete.Broadcast(
			false,
			FString("Failed on Instantiate Session")
		);
	}
}

}