“Play as Client” for PIE has broken for me recently and I can’t figure out why.
When I select “Play as Client” and 2 players, both viewports load the map that is set as “Game Default Map”, not “Editor Startup Map” in the Project Settings.
If I change the “Game Default Map” to the map I would like to test, both viewports load the correct map, but they appear to be on different servers because I can’t see the other player.
“Server Map Name Override” under Editor Preferences → Play has no effect.
I’ve also tried every possible option combination under “Multiplayer Options” in the Editor Preferences.
The problem started in 4.25 (after working correctly for months), updating to 4.26 didn’t change anything. I’m running source builds of the engine.
Any ideas what could it possibly be?
I think the option you’re looking for is “Play as Listen Server”. That will make the first player also the server, and connect the other player as a client.
“Play as client” is for when you’re running a dedicated server.
No, the option I’m looking for is “Play as Client”. I’m aware of “Play as Listen Server”, but I need to test in the dedicated server scenario, and have successfully used “Play as Client” for many months until it broke.
Just tested it quickly, “Play as Listen Server” is broken too. One viewport shows the current map, and the other one loads the “Game Default” map, so a very similar problem to the one I described.
That’s weird. Do you have “connect automatically” enabled? What about “use single process”? In multiplayer options.
There is no “connect automatically” option, and I’ve tried various combinations of “use single process” and other options.
What’s weird is that it worked perfectly for months, and then simply broke. The fact that updating the engine from 4.25-4.26 didn’t help at all makes me think that it’s probably some obscure setting.
I tried changing the gamemode, gameinstance, etc to default ones, but that didn’t change anything.
How strange. Can you verify that a server is running, with some print statements? These are the settings I would think should work. Sounds like something weird is going on.
Set the settings according to your screenshot and put a print statement in the game instance, the server did indeed start-up (the message is behind a “isDedicatedServer” check as well).
But clients still not connecting? So weird. Any logs indicating the clients tried to login to the server? What happens if you do
open 127.0.0.1 in the console on the clients?
Clients not connecting. Doing
open 127.0.0.1 also results in the client just loading the “Game Default Map”.
Did find this in the log, however:
[2021.04.01-18.40.11:733]LogNet: UIpConnection::HandleSocketSendResult: Socket->SendTo failed with error 21 (SE_EADDRNOTAVAIL). [UNetConnection] RemoteAddr: 127.0.0.1:17777, Name: IpConnection_0, Driver: PendingNetDriver IpNetDriver_1, IsServer: NO, PC: NULL, Owner: NULL, UniqueId: INVALID Connection beginning close timeout (Timeout = 0).
I did switch back to Malwarebytes during the period of time when this stopped working, but adding exceptions and closing Malwarebytes completely did not help at all.
SOLVED: I had a VPN client running in the background, in selective “split tunnel” mode, providing a VPN connection to several applications. I didn’t think of it initially because it’s “out of sight and out of mind”, but it did disrupt the local connections to the dedicated server somehow.
That was a weird one, hope it helps someone else.