Question about seamless travel.

Hey there,

I Changed my gamemodes to use seamless travel to enable steam multiplayer in my project.

Some of my code is not running now, because of seamless travel, the players (1vs1 game) start at the same position when joining and their names are not displaying on the Game HUD. I’m pretty sure its due to the fact they are traveling so quickly into the level.
Is there some function i can override like “postseamlesstravel” or something else so i can execute the desired code, or delay the second player joining to fix the issue?

Any Insight would be appreciated

  • SamuelB

Anyone have experience with this kinda of issue?

You need to describe step by step of you process what you do from moment you start game to when player join, coz lot of unclear info like when you call travel ? or what is name you mean here, and where you set/get that name, like preset or steam name ? For example,in my game after my client join, client Player Controller will be created, and at BeginPlay of PlayerController, server will get that client steam name and set it to 1 replicated variable in client PlayerState, this work regardless of whatever travel you do.

Ok i’ll try to be more clear, my main question was just generally why it skips the initialization in seamless travel.

  1. The player starts the game and creates a profile for him/herself with a name.
  2. The player either hosts or joins a hosted lobby (with lobby gamemode and lobby player controlller)
  3. Thr players select their character, and the player structure is updated for each player.
  4. The host chooses a map and time, and after both players are ready he can laumch the game using server travel.
  5. When the map changes, the gamemode and playercontroller changes, the names should be initialized on eventbegin play in the playerpc.
  6. It works without seamless travel, but steam wont without it. My characters are also spawned in the same player start after server travel.

There is a short list of what im doing, if you need more info i’llbe glad tp provide more. Thanks for taking the time!

  • Samuelb

Ok i’ll give that a try and report back my results. Yeah i was trying to find some postseamless travel functions, pretty surprised their not exposed to blueprint. Another reason for me to just switch to c++. thanks for the answer!

Ok, so here how seamless travel work, when you success travel, old player controller (which is lobby controller) still exist → new player controller (which is gameplay controller) will be created begin play will be called around here → these two will swap with each other → new player controller will spawn character.

So my suggestion is you need to either put some delay in BeginPlay of player controller or can put name initialization in BeginPlay of Character.

There are lot of function to check for post seamless travel but i cannot find any event for blueprint.

Ok I found the place where my Names code is executing, I have an Update function on the “On swap player controller” event. I added a print string at the end of it, it seems to be firing for each player correctly, so i’m assuming the issue is something else. Maybe I can’t pull from my struct for some reason? I tried adding a delay before it in several different places, i doesn’t seem to do anything. I Can always try to just take the steam name instead, but it would be good to know why it doesn’t work regardless.

I tried changing the name variable to use the steam names, the names are showing up with print string, but are not showing up on the hud. The issue must be with how the Hud is initialized.

The delay after the Player Controller’s “Begin Play” did the trick for me; I was having HUD initialization issues on the Server side of things.

how much delay did you use?

5 years later… I love the internet :smile:

I changed my method to something less noob; instead of an arbitrary delay, I use a TimerManager loop to keep checking until my widget objects are valid. After they are valid, I spawn the controller. Hope that helps.