How do I servertravel with a pre-selected Gamemode

So, I am kind of new to the multiplayer game. so please bare with me, if I may misunderstood parts of the basic concept here.

Following a tutorial series on Youtube, I managed to set up the fundamentals of my multiplayer loop. Stuff like creating/finding/joining a lobby works more or less stable.
Once I create a multiplayer session (Lobby), I can use servertravel to send all connected clients to a selected Level/Map. Now here is where the confusion starts for me. I know I can set up GameMode Classes in a Level’s World Settings. However, what if I want to choose in the Lobby, which GameMode I actually want to play. For instance, in the Lobby I select Level “A” and in addition to that, I would like to choose from two different GameModes (“FreeForAll”, “TeamDeathmatch”).

How do I transmit that information when I use servertravel. Or do I actually have to duplicate my Level “A” twice (“A_FreeForAll”, “A_TeamDeathmatch”) to make that work?

Any advice or idea is welcome and highly appreciated!)

bump

Create a Generalized Game mode that supports Actor Components. The AC’s will handle the logic.

Then use a Command line argument to tell the level or GM how to proceed.

So it is not feasible to just load a map with a different Game Mode Override?
What is the purpose of having multiple Game Mode assets then anyways? I thought the idea of this class was to create rules for certain types of a game. Why would I want to handle that kind of logic else where?

The level loads the GM that’s set in the level settings.

If you create a master GM class that uses AC’s for rules etc you can run your entire game on a single GM.

Smarter, not harder.

You can specify gamemode in ServerTravel URL, like :

LevelA?Game=/Game/Blueprints/BP_FreeForAll.BP_FreeForAll_C?Listen

Here’s some more in-depth info about URL options

2 Likes

Thank you for the answer! Looks promising. So setting up a proper Travel URL like in your example will already override the gamemode, or is it just a parameter that is transmitted to the new level which I can then use to change the gamemode on the fly?

Sorry if I am missing obvious things here, but since I am still a little new to multiplayers this stuff is really a blackbox for me. Reading the compendium section on it helped only partially, as I didn’t understand half of it

All the built-in options in the table are handled by the Engine.

You can add as many custom options as you want, which you can parse and implement in eg. event InitGame.

Okay, thanks a bunch! I will test it later today, and see if it works. But according to what you said and what the compendium explains, it looks exactly like what I need.

Sorry for the delay. Only today I was able to finally test it. And yes, I can confirm it worked:) Thus, thank you very much!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.