What is the difference between ServerTravel and OpenLevel?

I got to know the two functions
However, you do not know the difference between the two functions


ex) GetWorld()->ServerTravel(FString(“/Game/Maps/StrategyMenu”));

ex) UGameplayStatics::OpenLevel(GWorld, “battlemap”, false, “”);

OpenLevel calls SetClientTravel, which will disconnect any clients and act like a client. It throws away any state information and doesn’t work with seamless travel

If you call ServerTravel on a multiplayer server, any connected clients will attempt to connect along with the server. It also allows the use of SeamlessTravel, which allows things like player controllers to stay alive across maps.

So basically use ServerTravel if you’re a server and may have connected clients

Question regarding that; does the new level re-create PlayerControllers for all clients?

I’d like to know that too…

  1. What happens to the old PCs, for example “LobbyPlayerController”? Can we access their data?
  2. Are new PCs created, specific to the current game mode?
  3. Same questions for game mode etc.

When using ServerTravel, all PlayerController, PlayerState, GameMode, and GameState instances are preserved. With OpenLevel, apparently these are thrown away and things are started “from scratch.”

Also, ServerTravel will first load everybody into a “transition level” which is by default empty, and then it will load everybody into the target level. This is because there always needs to be an “active” world/level, so loading a new, big, level, while the old, big, level is still loaded, is bad for memory usage.