SeamlessTravel Brings Server Copy of Client's PlayerController instead of Client's Copy

I thought I understood how networking worked, but clearly that was wrong. I had been testing my relatively simple game using PIE and 2 players (one as listen-server) for the longest time and having no problems. Recently I decided to create a “ready up” process that allows the user to set some client side properties and hit ready (sending the properties to the server in primitives). This process worked just fine, but I didn’t like how the “ready” location was the same location as the actual game, so I created a second level. After moving the ready functions to the new level and adding a ServerTravel call to the game world, I learned that ServerTravel doesn’t function in PIE. I tested the game in standalone and sure enough the ServerTravel works but it’s almost as if the client is disconnected from the server. It no longer prints out the AddOnScreenDebugMessage calls from the server (and vice versa for the server printing the clients messages) and after the ServerTravel the PostSeamlessTravel function is called for both playercontrollers on the server (but information set by the client is not sent to the server like it’s supposed to be) but not for the playercontroller on the client. The client does travel to the new map though, which is good.

As a result my game does not function as expected on the client (it functions fine on the server). I expect the majority of my problems stem from the playercontroller not properly carrying over in the server travel, since a lot of my variables are stored there, but they are set to default values in the client’s game instead of what they were set to in the ready part. Also, when I close the game on the server, the client resets back to the ready stage. Previously, if I closed the game on the server, it would close the game on the client as well. In fact, the client becomes a listen server and functions normally. Lastly, I tried to test the game in PIE like I used to (just to see if the debugs would print like I expect) but for some reason the server loads the game in PIE like expected while the client loads the game in standalone mode still. Debug messages are still not printing as I expect them to.

If anyone has any insight on how to debug this, I would appreciate it. It almost feels like it’s a problem in my project settings rather than the code itself, but I have no clue. I’m not sure what to look for in the log files as far as ensuring the client/server are properly connecting and figuring out why the client’s playercontroller is not travelling when the client travels from the ServerTravel call.

Did you check the “Use Seamless Travel” option in the GameMode?

Yes, Seamless travel is enabled in both the “from” gamemode and the “to” gamemode. Initially I had not enabled it in the “from” gamemode and that was causing not even the server to travel properly, now only the server travels properly.

After reading your updated topic title it seems like something that I would have expected. Do you expect the server to copy non-replicated data on the clients?

I came halfway to that conclusion (that the server can’t bring the client data) myself earlier, but when you put it that way it feels painfully obvious.

I think in my mind, I never thought the server was copying the data. I thought each client (one being a listen-server is not relevant) carried its own data to the new map. Something about the description in Seamless Travel (“will instruct the particular client to travel to the new map (but stay connected to the current server)”) lead me to believe that client data would be saved. Earlier I did some digging into the source code for the actual function calls I’m using (didn’t know I could do that!) and started putting the pieces together for what its actually doing.

I think another reason I thought that way was because in the PIE version the AddOnScreenDebugMessages print to both client and server, so I assumed from the get-go that the client must be travelling because I saw two PostSeamlessTravel messages on the client (and figured one was client one was server).

I know how to move forward now, but honestly I’m still not sure why it works this way. Thanks for the help!

Putting all data in the PlayerController can give you more headache in the future as the Controllers only exist on the server and your own client. You should consider moving data that could be needed on all clients to the PlayerState.
Good luck!

I can see how that might come up, currently the nature of my game is that the things stored in the PlayerController are only needed client side and everything else is actually stored in the game mode (still not ideal) where it can be replicated to everyone. I’ll keep that in mind if I find I have issues replicating things to other clients. Thanks again!