I am fairly new to Unreal Engine. My goal is to make a multiplayer game where the host (listen server) clicks a button in the lobby map to send itself and all connected players into the game map. I am not using online subsystems and I am using Unreal Engine 4.27.2
At first I was testing my sessions by setting the PIE multiplayer options “Number of Players” to 2 and NetMode to “Play Standalone”. I enabled Seamless Travel and set a Transition Map. Trying to Open Level by Object Reference from my lobby game mode would kick my Client to my main menu without showing any error messages, why is this happening?
Looking for answers I read that for multiplayer testing I would need to use PIE with “New Editor Window”. I ASSUME this means open UnrealEngineEditor twice by going to EpicGamesLauncher and opening my project again. So I tried doing this, but doing that I can’t even join the lobby, the client crashes and get the following error:
TravelFailure: LoadMapFailure, Reason for Failure: 'Failed to load package '
Trying to get to the bottom of the issue, I tried packaging my game. Launching two versions of my game after packaging them resulted in the same error I had when using one editor (Client gets thrown into Main Menu but doesn’t crash) Since the Find Sessions result shows 2 players connected after this error, I think this means my client isn’t actually getting completely kicked from the session.
After more digging, I saw some people were opening the level on the client side and putting the local IP of the listen server as the map name. But trying to copy that achieved nothing.
At this point many hours in my brain just blew a fuse, because I felt like I made no progress and had no leads on where to troubleshoot. There’s something important that I’m not understanding about the level / multiplayer structure and I need help.
Hey there @Qeraga! So in singleplayer games it’s totally fine to just use Open level, however in multiplayer, the dynamic changes a bit in that you now have a session, IP, etc. Even if the server opens a map, that just makes the level load on the server but it doesn’t transfer the clients. You actually need to use ServerTravel! It sounds like it’s used for actually changing servers (which it is) but also changing levels on a server.
I’ve brought both documentation and the network compendium writting by amazing community member Cedric Neukirchen. I used this as my multiplayer cheatsheet for so long I can’t ever not recommend it.
Funny, I figured out the solution on my own the very minute you made this post, but I appreciate the attempted help anyways.
I had already read both those documentation pages before making my original post, the compendium has already helped me with other problems I’ve ran into and is really useful. Both pieces of documentation you shared explain the concept and name the C++ commands of server travel well, but…
Neither documentation make it clear that Open Level is incompatible with server travel, and there’s no server travel blueprint node, so it’s not an unreasonable assumption from a beginner’s perspective learning in blueprint to think running Open Level on the server is how you initiate server travel.
In a moment I will post with my solution so beginners working in blueprint have an easier time than me trying to accomplish server travel.
edit: I think I realized an important thing too, setting the net mode to standalone isn’t actually running the game as standalone in a new window, and I should actually be using the standalone game setting in Play for testing multiplayer.
How to get seamless level traveling for beginners (In Blueprint)
This is assuming you have already successfully followed other tutorials on how to create / join sessions.
Open Level is the node you use in single player to transition to a new level, but if you have a multiplayer game, Open Level will not transfer everyone connected to the session when you run it on the server. You can use Server Travel instead. Server Travel does not have it’s own node in Blueprint, so you can run servertravel as a console command. I’m running this command using a custom event in my game mode.
Here I am appending the level name to the command “servertravel”. IMPORTANT: there is no space after “server”, but there must be a space AFTER “servertravel”. Through testing I’ve found out that the map names are not case sensitive.
Server travel by default will disconnect all players from the server, and reconnect the clients after traveling. This is recreating the player controllers and is error prone if you aren’t careful. To avoid this there’s an option for seamless travel. Seamless travel makes your player controllers persistent while server traveling. You should use this option for Steam games I’ve been told.
Enabling Seamless Travel
Open your game mode’s blueprint, in the blueprint’s class defaults, there is a check box to enable seamless travel.
You will want to set a Transition map. A Transition map is an empty map to briefly put all players in because loading a new map while still processing all the data from your current map is not optimized. Create an empty map for this purpose.
Set your Transition map in your Project Settings. It can be found in the “Maps and Nodes” tab of your Project Settings. However, it’s tucked away in a little drop down, click the arrow under the Game Default Map to expand the advanced options. Set the Transition Map to your newly created empty map.
I tested this and it works for me. DISCLAIMER: I am a beginner, so take my word with a grain of salt. If I made any errors in this tutorial, hopefully an experienced user will correct me.
I did not know this, thanks a lot. I saw a lot of people saying to use a “New Editor Window” which is really confusing because I was interpreting it literally like I needed to open a new window of the editor. But I did have a suspicion that it was the name of some specific setting, and you have confirmed that suspicion and helped me out.
edit: my error log says “LogGameMode: Warning: CanServerTravel: Seamless travel currently NOT supported in single process PIE.”
edit2: reading about the error I saw someone suggest to use Standalone game (What I was doing before) not New Editor Window (PIE) for testing seamless travel (What I’m doing now). Seems like I’m getting some mixed messages, I’m gonna package my game and see if it works.
edit3: testing the game after packaging it, seems like everything is working here when I try opening it twice on the same computer.