Mordhau

How to run a dedicated server (Windows)

Knight 307 665
  • 18
  • 13 Sep '17
 Alphonse

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


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 and 27015 (UDP) 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.

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


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 DefaultGame.ini

This file is usually in <unit>:\SteamLibrary\SteamApps\common\Mordhau Dedicated Server\Mordhau\Config and you'll want to make a backup in case you change something incorrectly.

Basic Setup:

This is what your server lines should look like:

[/Script/Mordhau.MordhauGameSession]
bIsLANServer=False
MaxSlots=<No. of desired slots>
ServerName=<Your server name>
ServerPassword=<Optional. Only people with the passwords will be able to join>
AdminPassword=<Optional. Password required to log in as an Admin>
Admins=<STEAMID64 of your user>
BannedPlayers=

  • If you just want to add yourself as the single admin, you need your STEAMID64. It's the same number you see ingame on the bottom left corner but you can get your ID more easily here: https://steamidfinder.com/. Enter your Steam profile URL and copy the STEAMID64 line.

  • If you want to have multiple admins, add multiple Admins=<ID> lines, with the STEAM64 ID of each user.

  • Notice that if you're on the adminlist you don't actually need the admin password.

Map Rotation:

You can change the default map rotation to whatever you want in that same file (DefaultGame.ini) by modifying the lines below [/Script/Mordhau.MordhauGameMode].

[If your server is not rotating maps properly, please comment here or in the Alpha Bugs thread. I give up trying to fix it.]

EDIT: If your rotation gets stuck, adding a + sign at the beginning of each MapRotation line seems to work.

SKM is Skirmish, FFA is FFA/Deathmatch, TDM is Team Deathmatch.

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

[/Script/Mordhau.MordhauGameMode]
+MapRotation=SKM_Contraband
+MapRotation=SKM_ThePit
+MapRotation=SKM_Grad
+MapRotation=SKM_Camp

*NOTE: By default, the server always seems to load FFA_ThePit as the first map in the rotation. To change this, read below.

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

Notice how the first part of the above syntax corresponds to the map files inside the folder

<unit>:\SteamLibrary\SteamApps\common\Mordhau Dedicated Server\Mordhau\Content\Mordhau\Maps\

followed by the game mode (SKM, FFA, etc.) and the map names. You should be able to figure how to set your desired map as the default one, just be careful because not every map may have all modes available (for example, Grad doesn't have a TDM variation).


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:

@TINTIN said:

  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 "
  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.

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\.

I've read somewhere that you could/should add some start-up parameter in Steam (e.g., "-log", in order to display the server console), but for some reason servers launched through steam never show on the browser list. Tried to do this on 2 different computers but it just doesn't work.


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 (default key is Tilde) it's probably due to having a different keyboard layout.

To fix this:

1. Go to <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)


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.

Count 429 1067
  • 13 Sep '17
 Hadeus

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

Count 47 97
  • 13 Sep '17
 Shifty

Glad to see the maplist isnt just bugged for me

Knight 797 787
  • 13 Sep '17
 afiNity

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

Mercenary 4 8
  • 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 307 665
  • 2
  • 13 Sep '17
 Alphonse

nevermind

Knight 307 665
  • 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 47 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 117 71
  • 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 16 5
  • 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 47 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 117 71
  • 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 16 5
  • 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

@OP,
Update adminadd to instead be AddAdmin

Knight 5 3
  • 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

@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.