[UE 5.1] Testing steam online subsystem using SteamApp ID 480 not working

Good morning,

I’m building a multiplayer app on top of the Lyra Demo using UE5.1 (unfortunately I cannot upgrade the UE version right now).

I’m trying to use Steam Online Subsystem and Steam Socket to start a multiplayer session, but unfortunately I’m not able to let it work. I’m using the latest Steam SDK version as of today.

To test this, I use the Steam App ID 480 and I play the map with this configuration: Standalone Game, Number of clients: 2, I tried with the 3 available net modes to no avail.

I attach you the DefaultEngine.ini I wrote and two screenshot of the error log given by unreal when trying to connect to the lobby in different netmodes.

Just one more info: if I try to use bInitServerOnClient=true instead of false, one of the two clients crashes.

I tried to build the app using the real Steam App ID of the app, but it still does not work.

What can I do to solve this?

Thank you in advance!

Hi,

To get a better idea of the issue you’re seeing, I have a few questions.

First, could you provide some more info on how your setup? Are these instances running in single process PIE, or are they running in separate processes?

For the listen server, how are you setting up the session and beginning to listen, and for the client, how are you attempting to find and join the server?

Based on the error in the second screenshot, it looks like a listen socket already exists when the host attempts to start listening. Do your logs indicate where/when this first socket is being created?

Thanks,

Alex

Hi, I try to answer your question: inside the editor I’m trying to run them using all of the three net modes available, but it is not working with any of them.

For the configuration of the online part, I did not change anything to what Lyra already does, I just followed this guide to make it work using steam online subsystem: https://dev.epicgames.com/documentation/en-us/unreal-engine/online-subsystem-steam-interface-in-unreal-engine.

My logs does not help me quite more than these. The only things that I changed from the lyra project (other than some assets and gameplay related stuff) are the stuff written in the steam online subsystem article above, and the DefaultEngine.ini that I sent you.

Thank you in advance

Hi,

Thank you for the additional information. I do have a few more questions.

Just to clarify, are you running the instances all under the same process in PIE?

Do you run into the same errors and warnings when you run these as separate processes, such as by using the “Standalone Game” play mode (please note this is different to the “Play Standalone” net mode)?

Next, how are you creating the online session on the host, and how are you finding and joining the session? Is this handled in the same way as Lyra’s Common Session Subsystem?

Finally, to get more information in your logs, you may want to increase the verbosity of the LogNet, LogOnline, LogOnlineSessions, and LogSockets categories.

Thanks,

Alex

Hi,

thanks for the reply. I only run them as “Standalone Game”, otherwise the editor crashes when I add more than 1 client when using the Steam Online Subsystem plugin.

It is handled in the same way as Lyra’s Common Session Subsystem!

I can provide you the logs in the next days, meanwhile I wanted to give you this info!

EDIT: To add one more info, if we disable the Steam plugin and we activate the NULL plugin, the game works also in PIE and it finds the LAN matches correctly.

Hi,

Thank you for the additional information.

After talking with the devs, it seems you will need multiple machines in order to test the Steam OSS, as there is a limitation with Steam that prevents multiple instances on the same machine from hosting/joining sessions.

If you do run into issues when testing the Steam OSS across multiple machines, please don’t hesitate to reach out.

Thanks,

Alex

Hi,

perfect, this is a good thing to know! In the guide this was not written anywhere, we did not know it.

Just to understand it better: which is the best way to test this? Is it possible to open the project inside UE editor in two different PCs and test it this way? Which net-mode do you suggest us to use in this case? And when I do the real builds for the game, with the real steam app id of the game, which net mode do you suggest me to use to test everything to be as more similar to Lyra as possible? I would like to stick with the steam lobby system.

Thank you in advance!

Hi,

The editor’s “Play as Client” and “Play as Listen Server” net modes provide ways of launching multiple instances from the editor and having them automatically connect, either as clients and a listen server or as clients and a dedicated server. However, these do not use the online subsystem’s session or lobby interface, as they will instead just connect directly via IP.

If you want to use lobbies or sessions to connect the instances together, then you’ll want to use the “Play Standalone” net mode, as this will start the game as neither a server nor a client. From there, you can have one instance create a lobby for another to find and join.

As for testing across multiple machines, I believe you can do this with standalone editor instances (i.e. launching the project with the “-game” command line option or from the editor with the “Standalone Game” play mode) across the different machines.

Thanks,

Alex

Hi,

I confirm that trying it in two different instances of the editor in two different computers works properly!

Thank you very much for all the info!

Hi,

You’re very welcome! If you have any more questions, please don’t hesitate to reach out.

Thanks,

Alex

Hi again,

I just want to ask you one more thing: when I build the game with the same configuration as before (which via editor was working properly) and I test it using two different machines (using the steam app id 480), I cannot find the game lobby created by one of them. What am I doing wrong? I simply packaged the game for windows.

LOG machine who creates the lobby:

LogSteamShared: Display: Loading Steam SDK 1.53 LogOnline: Display: STEAM: OnlineSubsystemSteam::Shutdown() LogOnline: Warning: OSS: TryLoadSubsystemAndSetDefault: LoadSubsystemModule([NULL]) failed

Thank you in advance!

EDIT: this is the final DefaultEngine.ini file (the important parts) I used for the build:

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

[OnlineSubsystem]
DefaultPlatformService=Steam

[OnlineSubsystemSteam]
bEnabled=true
SteamDevAppId=480
bInitServerOnClient=false
bUsesPresence=true
bUseLobbiesIfAvailable=true
bUseSteamNetworking=true
bAllowP2PPacketRelay=true
P2PConnectionTimeout=180

[SystemSettings]
net.CurrentHandshakeVersion=2
net.MinHandshakeVersion=2
net.VerifyNetSessionID=0
net.VerifyNetClientID=0

[ConsoleVariables]
net.CurrentHandshakeVersion=2
net.MinHandshakeVersion=2

[Core.Log]
LogOnline=All
LogOnlineGame=All

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

Hi,

Based on those logs, it seems like there may be some issue with loading the Steam modules. If you increase the verbosity of the LogSteamShared category, do you get any more information in your logs?

Also, I don’t believe the bUsesPresence and bUseLobbiesIfAvailable settings are set in the config file, as these are flags on the FOnlineSessionSettings. In Lyra’s Common Session Subsystem, you can see where these are set when creating the FCommonSession_OnlineSessionSettings that gets passed to the CreateSession call in UCommonSessionSubsystem::CreateOnlineSessionInternalOSSv1. I don’t believe this is related to the issue you’re seeing here, but it’s worth noting.

Thanks,

Alex

I added this lines in DefaultEngine.ini:

[Core.Log]

LogSteamShared=VeryVerbose

I also deleted all the temp folders (binaries, saved, deriveddatacache, etc) and regenerated the solution.

Unfortunately, when I build the app in development mode or in DebugGame mode, I get this error when I start the app (I’m not able too see any log after this):

Assertion failed: !ActivePrecachingTasks.Contains(PrecachePSOHash) [File:D:\build++UE5\Sync\Engine\Source\Runtime\RHI\Private\PipelineStateCache.cpp] [Line: 942]

What can I do to solve this?

Thank you in advance

Hi,

Apologies for the delay in getting back to you.

After discussing this with someone more familiar with the Pipeline State Cache, we will need more information in order to identify the cause of this new assert you’re seeing. We recommend creating a new question for this assert, including as much relevant information as possible there.

Thanks,

Alex