I have setup an empty project with a minimal Steam integration: one button to host a game which creates a session, one to find existing sessions. I am using the IOnlineSubsystem session interface in C++ but I have tried also using the default Blueprint Create/Find Sessions nodes.
Generally speaking the Steam integration seems to work fine (the overlay pops up in game and I can see the OnlineSubsystemSteam being initialized properly from the logs). Create Session seems to work as I get a valid LobbyId. Finding the session, on the other hand, fails miserably (over the Internet). I can see a lot of Lobbies being found but not the ones created using my game instance. I have been testing using 2 different Steam accounts on 2 different computers running the same build, connected to different networks in the same country.
The issue seems not related to my network setup. The reasons I state this are the following:
- I managed to create and find lobbies using the Steamworks Example, even cross-country
- I tested connection from outside to a custom server running on port 7777 inside my home network and managed to reach it both using UDP and TCP.
These are the session settings I use:
FOnlineSessionSettings SessionSettings;
SessionSettings.bAllowJoinInProgress = true;
SessionSettings.bIsDedicated = false;
SessionSettings.bIsLANMatch = false;
SessionSettings.bShouldAdvertise = true;
SessionSettings.bUsesPresence = true;
SessionSettings.NumPublicConnections = 5;
SessionSettings.bUseLobbiesIfAvailable = true;
SessionSettings.bAllowJoinViaPresence = true;
these are the search parameters
SessionSearch = MakeShareable(new FOnlineSessionSearch());
SessionSearch->bIsLanQuery = false;
SessionSearch->MaxSearchResults = 10000;
SessionSearch->QuerySettings.Set(SEARCH_PRESENCE, true, EOnlineComparisonOp::Equals);
I have added the necessary configuration to my DefaultEngine.ini as documented here and in fact the steam integration works. Also, when the lobby is created, I can see this in the logs:
SteamNetDriver_2147482483 bound to port 7777
[...]
GameNetDriver SteamNetDriver_2147482483 IpNetDriver listening on port 7777
After looking at the OSS-Steam source code I thought the problem might be due to the BuildUniqueId so I tried to set it to a fixed number of my choice but that did not work. I am still unsure if the issue is related to the creation or the finding part. Or both. And I am running out of ideas.
What else can I be missing?
Random stuff I am seeing in the logs that might be relevant:
LogOnline: STEAM: Missing P2PCleanupTimeout key in OnlineSubsystemSteam of DefaultEngine.ini, using defaultSessionInfo: HostIP: INVALID SteamP2P