PlayerController not changing at servertravel

Hi,

I am having some issues when a new map is loaded : I didn’t understand why authority never got a player controller.
Now I found out that my playercontrollers are not updated. What I mean is that I have 2 different playercontrollers and there need to be a switch when new map is loaded but there is none.
I set gamemode, controller, etc in editor in “world settings”.

Is there a way to fix that ?

1 Like

Yes, is that a problem ?

I have a Project Settings setup and for each map a World Settings setup too.
Lobby map :

InGameMap :

So you have 2 different GameModes for two maps you are traveling from and to?

Nono, that is correct. I just wanted to make sure that you have that setup.

Are you also sure that second GameMode is overriding first one in new map settings? You need to set a global GameMode for your maps and then only override this one in other maps. options to override can be found under “Blueprints…” in top bar of Editor when you have map, that you want new GameMode for, opened. Also make sure to rightclick map file and hit “save”. I had problems with my gamemode getting reseted all time, because it didn’t save correctly.

Ok so far so good. I will toss in some more question to find source of problem.

You are using ServerTravel ConsoleCommand right? Do you have “Seamless Travel” enabled in GameMode Default Settings? If yes, would you mind turning that off and check if it is working then?

If not, can you print DisplayName inside of both PlayerControllers on BeginPlay and double check that, after ServerTravel, PlayerController did not update? best would be limiting this to Server versions of PlayerController by using a SwitchHasAuthority node (:

Yes I use seamless travel and I unchecked it on every map but then my clients never manages to load map (no OnPostLogin and no Event BeginPlay in map BP).
On other hand server does have a controller without seamless travel even if clients cannot connect.

As for name printing, I was already doing it “player x connected to server” when a client connects.

Hi back, after fixing an issue I had with editor I manage to test without seamless travel and it works. Both gets a controller and (with my code updated) they both load map correctly.

Now I could do without seamless but it is not optimal and not recommended by Epic so what could keep my authority to get a controller with seamless travel ???

Who said that you need seamless travel? You will only need seamless travel if you want to keep some classes alive over level change and have a transition level. If you don’t need this, you can simply not use this.

I haven’t worked with seamless travel yet, so i don’t know why and what is causing this.

I actually keep important gameplay data between maps.
I could keep them in each gameinstance but that’s just wanting someone to cheat xD
I could make a system where all playerstates are replicated in every clients’ gameinstance and server keep playerstates with most count. (a player can only cheat on his gameinstance but if 5 others players have a same different playerstate then they are right because they are more)

Ok, for this you would really want to keep data (as long as you have no workaround). I though about saving data on GameInstance of Server. That way, no one can cheat (despite listen host, but he can cheat anyway). This would need a lot of saving back and forth. sadly, i have no idea how exactly Seamless travel works. I only had problems with it and i know that there are tons of bugs last time i asked someone from epic about my own seamless travel bug.

It its not fixed but you gave as good an answer as there is. Thank yoi

Hi ,

Just to make sure I’m understanding you correctly:

  1. You’re using Seamless Server Travel to move between levels, and problem you’re facing is that controller is not switching to appropriate controller for new level after travel?
  2. Does this happen on Server or on Client, or both?
  3. Do you have an Transition level set up for Seamless travel?
  4. What GameMode do you use as Default GameMode? Is it MainMenu GameMode?

Thanks! I’d like to reproduce problem here but I need these details. If you’re able to reproduce this in a small test project (with no Starter Content), you can attach that here and I can look into that as well.

And just to make sure you’ve seen it, here’s Docs on Travelling in multiplayer:

Hi,

  1. Yes but only for authority.

  2. Server

  3. Since doc said that leaving it empty creates an empty map that’s what I did.

  4. Default gamemode is MainMenuGameMode that also contains logic for Lobby.

I will try to reproduce this issue on a small project with just connection to a session and travelling.

Hi,

Look at screenshot below : You can see that after new gamemode loading (said “loaded” because event beginplay is called) players connects and controller are given to them. And as you can see one of them as MainMenuController.

How may I upload project ? It is still 30mb after removing saved intermediate build etc. I could delete everything in map if you want.

Nah, that’s fine. If you could it up and upload it somewhere like Google Drive or Dropbox, and get me a download link, that’d be easiest. Thanks!

So there you are : Cahoots — Ann Arbor tech coworking

Hey ,

Thanks for project! I was able to reproduce this issue, and I’ve reported it as UE-18413. I’ll let you know when I see any update on it.

Unfortunately, as mentions, there are multiple problems with Seamless Travel at this time. I’ll look into a workaround, but it seems like working without Seamless Travel is best option for now.

Thank you :slight_smile: Now I can stop obsessing over that issue ^^

Hi! I’m facing a very similar problem right now. I got everything working well with seamless travel on previous versions, but in 4.11 and 4.12 player controller is not changing anymore, ¿is there any change in way we need to travel to new map?