Which way should i use for opening server?

Hi, i am currently trying to learn how to handle server in unreal engine for simulating multiple levels at same time.
and while i am doing that, i found that there are several ways to opening a server.
so i have got confused and want to know the differences of them and which one should i use for my project.

So far, i found these ways to open a server

Here is the example of what i want to make (assume it as some kind of RTS game like ‘StarCraft’ but Single-player game)

  • when you start a game, there is your building on a map and you can spawn some units from that building.

  • units can explorer or build new buildings, extract some resource from source, fight, etc…

  • But there is border on your map. so player’s base can’t get larger than certain size.

  • but when player spawn an air plane, player can send some units at different map. so that player can make second base or attack NPC’s base.

  • and for send units, player should choose a spot on world-map. and also player can check world-map if NPC sent an air plane to player’s base.

What i am planned to do.

When player start a game, launch a server that works as some kind of master-server (World-Map).
And if there is at least one base that player created, open a new server with the map that can read data and load game data from it. then master-server find which data should new server read and give server the data.
After all the necessary servers are ready (World-Map and Local-Map), player join to Local-Map so that player can play with units and buildings.
Than when player send a group of units on different spot, World-Map (master-server) open a new map(server) and check is there existing save data for that spot. And depending on result, tell new server to whether load or create new data.
Finally, if there is no units on Local-Map, save map’s data and terminate server.

So far i only tried first option (Dedicate server) and i barely made it to work. Then i was looked for how to open multiple servers and noticed there is several ways to open a server.
but i couldn’t figure out which one is better or fit for may situation.

So far, i didn’t completely understood about server. But for the information sharing purpose, i am leaving some information that i found. Excuse my quite poor Eng though :stuck_out_tongue:

Before get into it quick catch up about what was my issue, What i tried to do is ‘Simulating multiple world’ thing via using server system.
if your goal is likely same as mine and you are about beginner level, you might find some useful informs i hope. :smiley:

"Dedicated" or “Listen” ?
Dedicated server is ‘standalone server’ so all player should join to it anyway.
Listen server is somewhat ‘hybrid’ thing. At least one player is bounded with server. That mean, if bounded player(host client) quit the game, server got shut down.

Since listen server is bounded with client or player, you can not launch several servers while only open one client. So for my issue, choice was clear. “Dedicated server”

How should i launch my Dedicated server?
I found 4 ways to launch a server. Launch .exe file’, ‘Command line with Open or ServerTravel command’, ‘Blueprint nodes related with Session thing’ and ‘Check “launch dedicated server” option on your editor’.

I am quite not sure but, Command line and Blueprint way is for Listen server. or at least it may become bit more complicated for launching dedicated server.
And ‘checking option on your editor’ is only launching one server.

So, yes, you should build server to create exe and launching server by that.

And for last, here is some useful links about creating and launching dedicated server.

"How i build dedicated server?"

About network. Even your server will have only one player, the network rule applies.

"So i has server and i know some basics about networking. But i want to launch server without clicking exe file manually"
There is c++ function that execute some file. You can use it to execute exe file to launch a server. And you can even pass some information to opening server.
(Launch a dedicated server during game? - Content Creation - Unreal Engine Forums)
And this is a doc about URL arguments.
(Command-Line Arguments | Unreal Engine Documentation)

Assume that you want to launch server with map named as “ExampleMap” and store some custom values on server like ‘map size’, ‘player name’ or something else, The URL will be as like " /ExampleMap?MapSize=Medium?PlayerName=MyName -log"

After that, When you want to read ‘MapSize’ value, use ‘Parse Option’ blueprint node. passed options will be stored on server’s GameMode class. So get options variable from GameMode and extract value from it :slight_smile:

So, that is about all i found so far.
Hope it helps someone.
Again, sorry for my bad English. Have a nice day.

1 Like