x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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

Product Version: UE 4.18
Tags:
more ▼

asked Jan 23 '18 at 02:43 PM in Using UE4

avatar image

Samuelb
273 9 17 22

avatar image Samuelb Jan 25 '18 at 12:42 PM

Anyone have experience with this kinda of issue?

avatar image Duncan Dam Jan 26 '18 at 03:47 AM

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.

avatar image Samuelb Jan 26 '18 at 08:53 AM

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

avatar image Duncan Dam Jan 26 '18 at 09:47 AM

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.

avatar image Samuelb Jan 26 '18 at 09:58 AM

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!

avatar image Samuelb Jan 26 '18 at 12:25 PM

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.

avatar image Samuelb Jan 26 '18 at 12:51 PM

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.

avatar image Drgy55 Oct 07 '18 at 10:36 PM

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.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question