Connection state changed: ProblemDetectedLocally UnityEngine.Debug:Log (object) Mirror.FizzySteam.Ne

I have a multiplayer game on steam (not released yet) that uses FizzySteamworks, Mirror, and Facepunch. Everything works fine with one client, but as soon as I try to join a friend’s lobby, it loads the main scene, does not instantiate the player, and gives this error.

Connection state changed: ProblemDetectedLocally
UnityEngine.Debug:Log (object)
Mirror.FizzySteam.NextClient:OnConnectionStatusChanged (Steamworks.Data.Connection,Steamworks.Data.ConnectionInfo) (at Assets/Mirror/Runtime/Transport/FizzyFacepunch/NextClient.cs:152)
Steamworks.SteamNetworkingSockets:ConnectionStatusChanged (Steamworks.Data.SteamNetConnectionStatusChangedCallback_t) (at C:/Users/barry/Documents/steam/Facepunch.Steamworks-master/Facepunch.Steamworks/SteamNetworkingSockets.cs:111)
Steamworks.Dispatch/<>c__DisplayClass29_0`1<Steamworks.Data.SteamNetConnectionStatusChangedCallback_t>:<Install>b__0 (intptr) (at C:/Users/barry/Documents/steam/Facepunch.Steamworks-master/Facepunch.Steamworks/Classes/Dispatch.cs:303)
Steamworks.Dispatch:ProcessCallback (Steamworks.Dispatch/CallbackMsg_t,bool) (at C:/Users/barry/Documents/steam/Facepunch.Steamworks-master/Facepunch.Steamworks/Classes/Dispatch.cs:156)

Everything works perfectly fine when loading a local lobby, but as soon as I’m connecting to another account’s lobby it breaks. I have verified that my code is doing what it should be, so I think this is on FizzySteamworks’s end.

Did some more looking, it’s being caused by a timeout. I think it’s on Steam’s side, but I’m not sure…

EDIT: Changing SteamNetworkingUtils.ConnectionTimeout changes the time before the timeout happens, so I believe it’s Steam giving up.

EDIT 2: Steam Debug gives this:

Steam Debug: [#599268808 P2P steamid:786310720 vport 0] problem detected locally (5003): Timed out attempting to connect 
Steam Debug: [#654182832 P2P steamid:786310720 vport 0] Relay candidates enabled by P2P_Transport_ICE_Enable, but P2P_TURN_ServerList is empty

EDIT 3: Telling it to start server on my end ends up with the game loading, albeit in an incredibly broken state. It doesn’t seem to work on the other end.

were you able to resolve this?

The solution was twofold:

a): I was casting the SteamMatchmaking lobby IDs to UInt32s which mangled them such that I was never joining the actual right lobby (basically the UInt32 casted version was totally different from the original ID). If you’re force casting them into any type (which I doubt because I was doing some weird stuff that is definitely not the normal way of going about things) what worked for me was instead storing them as UInt64s, or as Unity (C#) calls them, "ULong"s. The Steamworks documentation refers to UInts which is deceptive as they mean UInt64s which is different from the C# default UInt (which is UInt32). So, TLDR, use ULongs rather than UInts.

b): I was putting the network address in Mirror (with FizzyFacepunch) as the Lobby ID. This was entirely wrong, the way you have to do it is to have all clients connect to the SteamID of the lobby owner (note: specifically the OWNER’s own SteamID, if you’re using Facepunch.Steamworks that’s [Lobby].Owner.Id) after the lobby owner has called StartHost with that (the lobby owner’s SteamId) as the Network Address (in the NetworkManager component)

Sorry if this is a bit wordy, if something makes no sense about my explanation feel free to ask further stuff. In any case, good luck!

1 Like

There, edited the above post to have my solution.

1 Like