[4.14] ServerTravel with more than the Server doesn't work in PIE

This is not PREVIEW anymore, it is release version of 4.14!

Hey there!

I updated my Marketplace Project from 4.13 to 4.14.

Following stuff happens in PIE! Remember, starting Multiplayer in PIE connects the Server and Clients already! Even in the MainMenu!


After starting the project with one Listen Server and one Client, I host a new “Server” with the Listen Server (kicks the Client of course due to PIE initial connection, but that’s totally ok here). Then I connect with the Client to the Server, which ends up in a Lobby. The Server then presses “Start Round”, which will result in a ServerTravel call.

This just loads for ever and prints this into the Output Log:

[2016.11.15-19.49.24:248][760]Cmd: ServerTravel GamePlayLevel2?game=“Team-based”
[2016.11.15-19.49.24:315][760]LogPackageName: SearchForPackageOnDisk took 0.067s to resolve GamePlayLevel2.

[2016.11.15-19.49.24:315][760]LogGameMode: Not traveling because of network error

The important part is the last line. I checked out the Source for 4.14 and this seems to be called when “CanServerTravel” is called and the MatchState is set to “Aborted”. But I have no idea why this would be the case…

I started the Game TWO times (so two instances) over “uproject file → Launch Game” and there it Server Travels correctly.

So this might be a PIE bug.

I don’t have tested it in an empty project, because that’s way too much work and I don’t have time for that atm.

If you want to reproduce this, try this:

  • Empty Project
  • Create a MainMenu Level
  • Create a Lobby Level
  • Create a GamePlay Level
  • All MainMenu doesn’t have a GameMode, Lobby and GamePlay level each have their own. Both are NOT set to Seamless Travel!
  • Start with 2 Players (no dedicated Server) in the MainMenu Level
  • Let the Server Window start a Session and open the Lobby Level (?listen AND Create Session node!)
  • Let the Client connect to that Session
  • When Client connected, let the Server ServerTravel to the GamePlay Level

This should result in the same error. If not, then it could still be my project, although, as already said, it works outside of PIE and it only started in 4.14!

If you want, you can also have my project via Private Message on the Forum (only Staff of course, as this is a Marketplace Project).

Cheers,

eXi

Ok, I have some new information:

This happens, because the MatchState is set to “Aborted”.
When trying to ServerTravel, it checks the MatchState and prints the error, mentioned in the original post above, while not performing the ServerTravel.

Now the question is: Why does it change the MatchState to “Aborted” and when does it do that, compared to when not.

If I start the Game in PIE (in the MainMenu) with only one Player, then host a Game (OpenLevel to the Lobby), it does NOT abort the Match.

If I start the Game in PIE (in the MainMenu) with more than one Player, then host a Game (OpenLevel to the Lobby) with the Server Window, it DOES abort the Match.

Why is that important? If you start a Game in UE4 PIE with 2+ Players, they will initially be connected. This means they are already connected in the MainMenu. If I now host with the Server Player (no dedicated server!), the Clients loose connection. That is totally fine and worked in 4.12. They will just get an error message about loosing connection and stay in the MainMenu.

They can also freely reconnect to the Server after opening the Lobby.

If I start the Game as Standalone with 1 or more Players (rightclick uproject file - > Launch Game) it also does NOT abort the Match.

So I have the feeling that the initial connection in the PIE, combined with opening a new Level as a Listen Server with the original Listen Server from the initial connection, causes the Server to abort the Match.

I don’t know why though. Could someone, who touched the GameMode + MatchState stuff from 4.13 to 4.14 please think about this problem and check what’s going wrong?

I can’t test the Game in PIE anymore!

Yo, so why is this a thing in 4.14:

void AGameMode::HandleDisconnect(UWorld* InWorld, UNetDriver* NetDriver)
{
	AbortMatch();
}

And why is this being called in a GameMode that should already be new and fresh and not handle disconnected from previous ListenServer GameModes?

Ok, while the original problem still exists, I found that I can actually deactivate the initial connection in the advanced settings:

http://puu.sh/snpOR/b6c6b49a86.png

This solves my problem for now, but someone should still look into this MatchState Abort thing.

Hey eXi,

I’m glad you were able to workaround it, but I’d still like to look into the MatchState issue as you mentioned. I’m going to spend some time on this, but if you could also provide your project as a reference that would be helpful as well. You can PM me a download link to Dropbox or Google Drive through the forums: https://forums.unrealengine.com/member.php?160394-Sean-Flint

Sure, gonna PM you my project. Instructions are in the PM then.

Hey eXi,

Quick question: Are you using any other 3rd party plugins while working on your project?

Nope, Marketplace projects are not allowed to have plugins.

Buyers of my project already reported the same issue.
Sadly the “Auto Connect to server” bool is saved in the saved folder of the project and we do not submit that to the Marketplace. So the buyers need to change it themselves.

A bit annoying. Hope this gets fixed soon.

Hey eXi,

After some investigation of your project, I wasn’t able to figure out exactly why you were experiencing the MatchState issue. Since you were able to determine the way to fix your issue, I’m going to mark this topic as resolved. I’ll discuss the Match State Abort issue with the developers, however, to see if there is something that needs to be changed.

Thanks for all your information

I was able to reproduce it. I’m going to be discussing the issue with our developers soon and I’ll get back to you with more info as soon as I have any

But you were able to reproduce it at least, or?

Alright, thanks for your time Sean!

Hello,

I’m facing the same issue on 4.14.1

Everything works fine when packaged and tested with two instances, but the PIE won’t let me test with two players. I don’t know if the MatchState aborted though, but i’m getting the same error as eXi in the log :

LogGameMode: Not traveling because of
network error

eXi : Where do you find that workaround option you mentioned ? “Auto Connect to Server” ?

Ps: maybe it’s worth mentioning that I migrated my project from 4.10.4 to 4.14.1

PIE was working perfectly fine on 4.10.

Next to the Play Button in the Editor, you have a drop down menu.
Click on “Advanced Settings” at the bottom. In the new Window, scroll down to the “Multiplayer Options” tab. There you should find that boolean.

Excellent that did the trick! Thank you eXi.

Now that explains a couple of things. I’ve checked the MatchState and it goes through WaitingToStart, InProgress, Aborted almost immediately.

Also, with the Auto-Connect Checked, the client1 always gets a Network Failure Connection Lost, whenever the Server OPEN a new map (says to create a lobby).

When Unchecked, the Network Error doesn’t occur (makes sense, it’s no longer connected by default on PIE startup) AND the MatchState doesn’t get Aborted.

Now, I don’t know why a network failure on a client would abort the match, but at least we are not blocked.

That’s the main issue: The MatchState of a new Match should not get affected by it. And it never got affected by it in previous Engine Versions.
The AutoConnect boolean exist since a few Engine Versions, but I never actually used it, as it resets if you remove the saved folder.
Seems like it’s not saved in the config folder.

I hope it will be fixed soon though, it’s quite annoying to have to check/uncheck whenever we need to test full connection flow or in a map directly.