After Seamless Server Travel

My game is using blueprints, so I implemented a BlueprintCallable function in my PlayerController superclass in C++ that will query this function that returns if the current PC is loaded in the same world (aka same level).

The function already exists in PlayerController, I just had to make it callable by blueprint so I wrapped it in a blueprint function.

If you're using C++, then you just have to dig into the PlayerController and find it, it's easy.

I also override PostSeamlessTravel in my GameMode superclass in C++ and make it call a BlueprintImplementableEvent so that it calls it when the server is done loading after SeamlessTravel.

I do all this cuz my workflow is in blueprints, so you dont need to make a callback event in C++ for it obviously if you're using C++ only.

So when it calls that event.. I know the server is done loading past SeamlessTravel into the game map.

With that callback, I make a looping timer/delay that checks each playercontroller with that other blueprint function that queries if the PC is loaded into the current level of the server.

So basically the workflow is :

  • Authorative GameMode has a callback when it's done SeamlessTravel.

  • GameMode loops through all PlayerControllers and checks if they're loaded in current world... every XX seconds, I check every 0.2 seconds.

  • I can then update each client if they're loaded in (in my game, I just give them a list of all the players and update their READY status).

  • Once all clients are loaded past SeamlessTravel, I can start game.

  • I also added a 2nd timer that starts when the server loads in, 15 seconds, where if all PCs have not loaded, then the server closes the session and informs clients that someone timed out or was taking too long to load.

I basically did all this, because your method of delaying for 10 secs is unreliable and not correct or pretty, and also because I wanted to show players all the player status like which players are loaded and ready and which aren't.

/r/unrealengine Thread