Mordhau

How to run a dedicated server (Windows)

Knight 399 868
  • 27
  • 13 Sep '17
 Alphonse

(EDIT8: 17-june-2019): I updated this guide but it may not be perfect. The original post (up to EDIT6) can be found here.


1) Add port forwarding rules for the required ports

You'll need access to your router/modem control panel to add some port forwarding entries.

Add ports 7777, 27015 (UDP) and 15000 and forward them to the LAN IP of the computer running the dedicated server files. UE3 also needed an open 7778 port, and one of the .inis in Mordhau server files also has this 7778 port (listed as PeerPort) so you may want to add that one as well just in case.

15000 is the beacon port (Patch 4). You can override it with a different open port on the server start-up command line: -BeaconPort=<port>.

If you have any weird firewalls you may need to add exceptions or tweak them accordingly.

(Short) Connection troubleshooting:

Most issues are caused by faulty port forwarding. There are multiple websites for checking if ports are open on your network so use them (https://www.yougetsignal.com/tools/open-ports/) or the netstat command.

If your server is not appearing on the server browser, make sure 27015 and the beacon port (default: 15000) are properly forwarded.

The server may be running on your LAN but not accessible to external players.

You can test this by opening up the console in-game and typing:

  • open <local_IP>:port

  • open <external_IP>:<port> (the external IP can be found inside your modem/router Control Panel or through https://www.whatsmyip.org/.


2) Install Mordhau Dedicated Server files

mordsv1.png

EDIT: According to Crushed, it's advisable to host this server on a PC different to the one where you'll be running the game itself. Some bugs may occur but basic server functionality can be achieved just fine.


3) Edit the server's Game.ini


If this is the first time you're setting up the server:

You'll need to run the server at least once for it to generate some config files. Run MordhauServer.exe in
<unit>:\SteamLibrary\SteamApps\common\Mordhau Dedicated Server\

Wait a minute or so, then kill the application in the Task Manager. It's usually listed as "Mordhau" (the process actually points to MordhauServer-Win64-Shipping.exe in \Mordhau Dedicated Server\Mordhau\Binaries\Win64\)


Next, let's edit Game.ini. You'll want to make a backup in case you change something incorrectly.

This file is located in

  • <unit>:\SteamLibrary\SteamApps\common\Mordhau Dedicated Server\Mordhau\Saved\Config\WindowsServer\

Basic Setup:

This is what your server lines should look like. Most of them are self explanatory.

[/Script/Mordhau.MordhauGameMode]
PlayerRespawnTime=5.000000
BallistaRespawnTime=30.000000
CatapultRespawnTime=30.000000
HorseRespawnTime=30.000000
DamageFactor=1.000000
TeamDamageFactor=0.500000
MapRotation=FFA_ThePit
MapRotation=TDM_Camp
MapRotation=SKM_Grad
MapRotation=FFA_Contraband
MapRotation=TDM_Tourney
MapRotation=SKM_MountainPeak
MapRotation=FFA_Taiga
MapRotation=TDM_ThePit
MapRotation=SKM_Camp
MapRotation=FFA_Grad
MapRotation=TDM_Contraband
MapRotation=SKM_Tourney
MapRotation=FFA_MountainPeak
MapRotation=TDM_Taiga
MapRotation=SKM_ThePit
MapRotation=FFA_Camp
MapRotation=TDM_Grad
MapRotation=SKM_Contraband
MapRotation=FFA_Tourney
MapRotation=TDM_MountainPeak
MapRotation=SKM_Taiga

[/Script/Mordhau.MordhauGameSession]
MaxSlots=<number of slots. Default: 16>
ServerName=<Your server name>
ServerPassword=<OPTIONAL. Only players with this password may join your server.>
AdminPassword=<Password required to log-in as admin.>
Admins=<STEAMID64 of your user> (add multiple Admins=xxxx lines for multiple admins).
BannedPlayers=()**Not sure how this works, but it may be a list of banned users, set up by listing their STEAMID64s.

Some other settings can be customized as well. Check Patch#3 notes for further info (new .ini lines)

Map and Game Mode Rotation:

You can change the default map rotation by modifying the MapRotation lines, adding new entries or whatever.

Game Mode prefix codes:

  • FL = Frontline
  • BR = Battle Royale
  • HRD = Horde
  • SKM = Skirmish
  • FFA = FFA/Deathmatch
  • TDM = Team Deathmatch

Current map names (29/04/2019)

Contraband; ThePit; Grad; Camp; Taiga; MountainPeak; Tourney. Note that Frontline maps have 48p and 64 players variants. (Some maps do not support certain game modes).

For example, if you want a Skirmish mode only server, your file should look like this:

MapRotation=SKM_Contraband
MapRotation=SKM_ThePit
MapRotation=SKM_Grad
MapRotation=SKM_Camp
MapRotation=SKM_Tourney
MapRotation=SKM_Taiga
MapRotation=SKM_MountainPeak

Changing the server's default map:

Inside the same folder where you changed the DefaultGame.ini file, there's also a DefaultEngine.ini file. Inside it you'll find a bunch of complicated looking lines, like ConfiguredNetworkSpeed, MaxInternetClientRate, NetServerMaxTickRate. These will affect the server performance, and you may want to check Vin¢'s thread for more info. Alternatively, you may want to check how other UE4 engine games are set-up.

The only thing we'll be changing now is the ServerDefaultMap line.

By default it's:

ServerDefaultMap=/Game/Mordhau/Maps/ThePit/FFA_ThePit.FFA_ThePit

If, for example, you want a map "SKM_Contraband" to be the default map, change it to this:

ServerDefaultMap=/Game/Mordhau/Maps/Contraband/SKM_Contraband.SKM_Contraband


4) Run the server executable through a shortcut

You may want to see the server console log window while the server is running. To do this:

  1. Make a shortcut to "MordhauServer.exe" (this file is in the root folder of the Mordhau Dedicated sv files)
  2. Go to properties on the newly created shortcut
  3. Under the target field you should have a path that starts and ends with a qoute symbol"
  4. After the last one add -log

    Example:
    "D:\Programs\Steam\steamapps\common\Mordhau Dedicated Server\MordhauServer.exe" -log

You may want to add more parameters to that line. Here's a full list of arguments supported by UE4.

These are all useful parameters to add, esp. if you're not sure if you've set up the proper ports or you want to override them without tweaking the .ini files.

-USEALLAVAILABLECORES -log -port=7778 -queryport=27015 -peerport=4778 -Beaconport=15000

ALTERNATIVELY: Just double-click the MordhauServer-Win64-Shipping.exe executable in <unit>:\SteamLibrary\SteamApps\common\Mordhau Dedicated Server\Mordhau\Binaries\Win64\.

Btw, if you need to report a bug or server crash, these server logs are stored in \Mordhau Dedicated Server\Mordhau\Saved\Logs\.


5) Join the server in Mordhau

To log-in as admin, you'll need to open up the console and type "adminlogin YOUR_PASSWORD" (w/o quotes). Now you can restart the current map, kick players, change the map to something else, etc.

NOTE: If you can't get the console to open in the client (default key is Tilde) it's probably due to having a different keyboard layout.

To fix this:

1. Go to Mordhau's client location: <unit>:\SteamLibrary\SteamApps\common\Mordhau\Engine\Config\ and open the BaseInput.ini file (notice it's the folder where Mordhau was installed, and not the server files).
2. Locate this line:

+ConsoleKeys=Tilde

3. Change "Tilde" to a different key, for example "J" (a key which does nothing in-game iirc), and save the file.
4. Restart Mordhau.


Admin Command list:

  • adminlogin <password> // required to perform any other admin command

  • adminlist // lists current admins

  • addadmin <STEAMID64> // adds a new admin to the adminlist (I believe this id is saved in %appdata%/Mordhau/.../Game.ini)

  • removeadmin <STEAMID64> // removes specified admin from the admin list

  • changelevel <map name> // Changes the map

  • restartlevel // restarts the current map

  • addbots <integer> // adds desired number of bots

  • removebots <integer> // kills desired number of bots

  • kick

  • ban

  • unban

  • banlist

  • slomo // slow motion (added as an admin command in Alpha build #2). slomo .5 will get you 50% speed. slomo 2 will get you 200% speed.

  • exit // exits Mordhau game program

Here are additional console commands that probably work on single player only. And here's how to change the game gravity on your server.

6) In the future...

I hope Triternion adds RCON Admin Tools to remote admin your server.

It would also be great if more command-line arguments were supported. For example, a basic one, -DEFGAMEINI=<customini> would make switching server name and rotations a lot more convenient (you'd just have to save and modify different ini files which would act as a preset)


Here's a somewhat outdated video to walk you through the process made by [InX] Atropos Orbis


EDIT: Added a little more info. Thx to Meph for finding out how to keybind the console properly.

EDIT2: Thanks to Vinc for helping me while I was figuring out how to get the rotation to work.

EDIT3: Fixed grammar and some corrections to the default map part.

EDIT4: Potential fix for when your rotation gets stuck: Add a "+" sign at the beginning of each MapRotation entry. If you have multiple admins or banned users, also add a + at the beginning of each line as well.

EDIT5: Fixes and additions.

EDIT6: Added some further info. Not entirely up to date.

EDIT7: Changed some things for the current version (from release date) of the dedicated server files. Some stuff may not be entirely correct.

EDIT8: Added some new info, parameters, etc.

Count 449 1186
  • 13 Sep '17
 Hadeus

You beat me to it! Very good info Alphonse. Thank you sir.

Count 53 97
  • 13 Sep '17
 Shifty

Glad to see the maplist isnt just bugged for me

Knight 934 941
  • 13 Sep '17
 afiNity

Would be nice if someone could make a guide how to set up a dedicated linux server

Mercenary 6 9
  • 13 Sep '17
 TINTIN

To visually see the dedicated server window:

  1. Make a shortcut to "MordhauServer.exe"
  2. Go to properties on the newly created shortcut
  3. Under the target field you should have a path that starts and ends with a "
  4. After the last one add -log

Example:
"D:\Programs\Steam\steamapps\common\Mordhau Dedicated Server\MordhauServer.exe" -log

Baron 1 0
  • 13 Sep '17
 sullen

Do those commands actually work for anyone? None of them seem to be working for me even tho server properly sees me as an admin in the console when I join.

Knight 4 1
  • 13 Sep '17
 Anchev

Do I need to open the ports through windows firewall too?
I can't see my server on the list, only on the lan tab, is this right?

214 412
  • 13 Sep '17
 Astonop

Very helpful, thank you!

May try and get a dueling only server going somehow, we'll see.

Knight 399 868
  • 2
  • 13 Sep '17
 Alphonse

nevermind

Knight 399 868
  • 1
  • 13 Sep '17
 Alphonse

@sullen said:
Do those commands actually work for anyone? None of them seem to be working for me even tho server properly sees me as an admin in the console when I join.

Do you get any errors? They're all working for me.

@Anchev said:
Do I need to open the ports through windows firewall too?
I can't see my server on the list, only on the lan tab, is this right?

I have Windows Firewall disabled, so I wouldn't know. A friend had the same issue, so it might be related to the firewall or wrong port forwarding settings.

Knight 8 7
  • 14 Sep '17
 rafaelinux

Thanks for the quick and easy guide.

Count 53 97
  • 14 Sep '17
 Shifty

Another easy way to specify starting map is to create a shortcut of the server executable or write a bash file and add [MAPNAME] in the target line eg.

"..\Mordhau Dedicated Server\MordhauServer.exe" SKM_Contraband

In a separate issue, has anyone figured out how to increase max slots on their server? Mine seems to be locked at 16 or less. Ive tried editing the ini file and adding arguments to the executable but nothing seems to be working.

Knight 148 97
  • 14 Sep '17
 Lilboots

You have to change the MaxPlayers in both
C:\Program Files (x86)\Steam\steamapps\common\Mordhau Dedicated Server\Mordhau\Config\DefaultGame
And
C:\Program Files (x86)\Steam\steamapps\common\Mordhau Dedicated Server\Engine\Config\BaseGame

Most cases your server will show still 16/16 slots in server Browser but will change as more people join, past the 16.
you will also notice when you press TAB in game it'll still show 16 players in the title details but is not the case.

Mercenary 31 13
  • 14 Sep '17
 Sumerian

Thank you for the information <3

I have some questions.

  1. Is there any way to add bots automatically?

  2. Can I make my server 1st perspective person view only?

Count 53 97
  • 2
  • 14 Sep '17
 Shifty

@Sumerian said:

  1. Is there any way to add bots automatically?

Adding ?numbots=# to the command line (where # is number of bots) is how it used to work for chiv.
Tested it before and it didnt work for me but that might just be my autism.

EDIT: https://docs.unrealengine.com/latest/INT/Programming/Basics/CommandLineArguments/
This says numbots is the way to go for UE4 but again, still no dice in testing

Knight 148 97
  • 14 Sep '17
 Lilboots
  1. Maybe - I haven't tried, usually this can be done adding to the command line, little research has found that UE4 does not support adding bots automatically for some reason??, I will have a play tomorrow, I enjoy working with servers.

  2. There isn't support in the cfg for this yet(that I have found). devs will potentially add this later on, though besides shields; without reverses and blocking from the rear, also a massive drop in mobility comparing to chivalry. 3rd isn't that much of a advantage, I don't see why you need to.

Mercenary 31 13
  • 15 Sep '17
 Sumerian

Thx for replying Shifty <3

I tried with -numplay=#

When I'm back home I'll try it :D

Knight 43 91
  • 1
  • 16 Sep '17
 Atro

@OP,
Update adminadd to instead be AddAdmin

Knight 5 5
  • 16 Sep '17
 scrimlin

Is there a way to automatically run admin commands when the server changes level? I'd like to setup a slo-mo server, but I can't find a way to avoid having to run the slo-mo command every time the level changes.

Knight 43 91
  • 16 Sep '17
 Atro

@stanky said:
Is there a way to automatically run admin commands when the server changes level? I'd like to setup a slo-mo server, but I can't find a way to avoid having to run the slo-mo command every time the level changes.

I've got something for you mate. Let's PM real quick so that we can test it.