Download

How to travel map in netgame

I met problems on traveling from levels. I’m making a network game and I want to travel levels, but I can’t bring server and clients together when traveling. At first time I tried open level, yet the server and clients open their own levels with only themselves. And then I find someone using command “server travel” and seamless in “gamemode” blueprint. However, I don’t know why, it doesn’t work when I check seamless, while if I uncheck seamless, server and clients would open their own levels…

I’m learning how to build a network game now, and following the tutorial, I travel levels in “gameinstance” blueprint. But, it says that gameinstance is never replicated and someone travel their maps in “gamemode”. I don’t know what is the best way to sovle this problem.

And I’m using 4.13.2.

http://cedric.bnslv.de/Downloads/UE4_Network_Compendium_by_Cedric_eXi_Neukirchen.pdf

To do seamless travel you need to exec ServerTravel as console command.

Note: In order to change gamemode or pass other parameters on ServerTravel, you need a smidgeon of c++
https://answers.unrealengine.com/questions/371008/how-to-use-different-gamemodes-for-one-level-in-a.html

It says that seamless travel could not be used when the level is loaded first time. So how could I figure out whether it is the first time or not. And another question is I have a lobby level to allow players to login, and when the game starts(travel to game level), I don’t when any other players to login, how could I do that?

You don’t need C++ in order to load different gamemodes, you can set it in your travel URL the same way you set your level name. Besides, loading different gamemodes doesn’t work with seamless travel as it default persists gamemode and playercontrollers when doing it.

hmmmm… just tested again and didnt work: if you exec the ServerTravel console command and try to change the game mode by passing options it seems to ignore the options.

As far as changing gamemodes not working with seamless travel, well, it seems to work for me and will change the game mode (if you call ProcessServerTravel directly with c++).

I am confused why you say you can’t change game mode with seamless travel - I was under the impression that Unreal Tournament uses seamless travel when launching the various game modes e.g. “Capture The Flag” from the lobby?

Or do the clients disconnect and reconnect after the game launches?

Seems like using a lobby and launching various gamemodes without requiring clients to disconnect would make more sense?

Mootjuh - If you have time - can you elaborate? (I am currently working on implementing this and any accurate feedback would help)

Just to clarify - if you don’t change the GameMode, then it does persist through the travel. But that fact does not disable the ability to change the game mode if desired.

So far I’ve only called server travel through blueprints. And when I check seamless travel, it loads my map but it’s still in the mainmenu gamemode(even though I tell it to load a different gamemode in the travelURL). But I didn’t know it had different functionality in C++ so I’ll look into that. Thanks!