Multiple gamemodes in MP at the same time

Let’s have a look at games like HOMM or AOW. When some players start the battle only it and its opponent have a level with “GameMode_Battle”, other players still have “GameMode_GlobalMap”.

I see a few ways how to solve it:

  1. Run battle on the other server (e.g. one of the players in battle will host the game, easy but not cheat-safe). Then transfer player data to the new server and then transfer battle results back.

  2. Combine multiple gamemodes in one (so ugly uh…) and then load the battle level far from the global map and play with replication, so no other player except of two of them will get it replicated.

  3. Not sure about APlayerController::ClientTravel - is it the way when one server can manage different maps with their gamemodes?

I am wondering what is the best practice to approach this in UE4?
Is there some other ways?

A Player/Server(-Process) can only have loaded one level at a time. A level can have sublevels/streaming levels. It can only be loaded a GameMode at a time and it exists only on the server. When starting the game or loading a new level you can overwrite the gamemode to use. So I guess you should have a look at a lobby system which is kind of the same. The players waiting for a match are in the lobby level with the lobby gamemode and when the match begins they move to the new battle-level with the new gamemode. Properties (eg Scores) should be saved to playerState/gameState, so they move with the player from one level to the other and replicate around. The gamemode (remember - exists only on the server) should include all the cheat-safe logic like when to score or die etc…
ClientTravel vs Servertravel: Servertravel loads the new map on the server and takes it’s connected players with him - ClientTravel only tells the connected players to go to a new server (with a new map/gamemode).

have a look at the shooter example in the UE Launcher or various lobby examples in the forum to get a starting base.

Long things short, I would create 2 Levels + 2 Gamemodes and start 2 dedicated server processes managing each of the levels.

Great, thanks. I will definitely take a look at lobby examples.