Flying Squirrel Entertainment

Mount & Blade Warband: Napoleonic Wars => Servers => Topic started by: Olafson on November 09, 2012, 09:53:25 pm

Title: Dedicated Server Hosting Guide
Post by: Olafson on November 09, 2012, 09:53:25 pm
Dedicated server guide

Contents
1. Requirements
2. Installation
 - Windows
 - Linux
3. Configuring the server
4. Opening ports
5. Running the server
 - Windows
 - Linux
6. Checking if server works
7. Good to know stuff


1. Requirements
Stable internet connection (Only if you host the server from your home)
You need a proper connection to host a game, go to: http://www.speedtest.net/ and test your Upload bandwidth.
It is displayed in Mb/s (Mega bit per second) for example 0.59 Mb/s
We need to convert this value to KB/s (KiloBytes per second) use this calculator: Megabit to Kilobyte (http://www.unitconversion.org/data-storage/megabits-to-kilobytes-conversion.html)
We need this value to calculate how many players your computer can support. In our example 0.59 Mb/s is 75.52 KB/s
One player takes about 5 KB/s so you take your value and divide it by 5 in my example that is 15.1 players which means our internet supports not more than 15 players.
If your calculated player count reaches around 20 players the amount of bandwidth needed per player will go up and probably take about 7 or 10 KB/s! so you need to turn the player count down a bit.
Remember that if you want to run Commander battles or any other bot game, that two bots count as 1 player in your bandwidth calculation.

Good CPU
A server will take a lot of CPU load, especially once it hits above 60 players.
CPU usage of a server raises exponentially with the player count, which means if 60 players are taking 60% of your cpu that 80 players might take 100%!
The warband server is Single Threaded which means if you have a multicore computer or server it will only use one core and won't use other cores if this one core is full.
To test how much your server can handle for CPU usage, just start your server later in this guide with bots, A bot takes about 50% of player CPU usage,
so if your server for examples is using 100% CPU with 200 bots your server can handle about 100 players. (Note that horses are seen to the server as bots so they take CPU usage as well!)


2. Installation

Windows
The server files are made for Windows and this is the most easiest setup, although the dedicated server seems to run fine on Linux through Wine.

Prerequirements:
- Mount & Blade Warband Dedicated server files: Dedicated Files (http://www.taleworlds.com/download.aspx?type=5) Scroll down to Other Downloads.

Installing the dedicated server files.
- After downloading the server files we need to extract them.
- Open the downloaded file for example: "mb_warband_napoleonic_wars_dedicated_xxxx_nw_xxxx.zip"
- Click on the folder "Mount&Blade Warband Napoleonic Wars Dedicated" and extract it to "C:\Program Files\" or any directory you want really.
- Go to the folder you extracted to. which in this example is C:\Program Files\Mount&Blade Warband Napoleonic Wars Dedicated\

You installed it. Skip the Linux Installation part and read on.


Linux
Linux installation is a bit complex but if you are using linux you are smart enough :).
The dedicated server seems to run fine for me on linux, but your running it on Wine through a emulator, I don’t think it will run as good as on Windows. Tell me your results!
For this guide I am using Ubuntu Server 9.10 for linux so i will be using some specific Debian/Ubuntu commands, but you can just google yours.

Prerequirements:
- Mount & Blade Warband Dedicated server files: Dedicated Files (http://www.taleworlds.com/download.aspx?type=5) Scroll down to Other Downloads.
- Wine 1.4 follow installation guide here: Wine Installation steps (http://www.winehq.org/download/)
- Screen program (sudo apt-get install screen)
- Unzip program (sudo apt-get install unzip)

Installing the dedicated server files on linux.
- After downloading the server files we need to extract them.
- Move the downloaded file to your desired location; For example: "/home/"
- execute: "unzip mb_warband_napoleonic_wars_dedicated_xxxx_nw_xxxx.zip" (replace xxxx with the downloaded version)
- execute: "cd Mount&Blade Warband Napoleonic Wars Dedicated"

You installed it. Read on.


3. Configuring the server
Decide Gametype
To configure the server we will start with a specific game mode example file. Decide upon which gamemode you like.
You can choose from: Battle, Capture the Flag, Conquest, Seige, Deathmatch, Team Deathmatch, Duel and Commander Battle.

Making the config.
Open up the config file for the gamemode of your choosing, they are named: "NW_Sample_<Gamemode>.txt"

Set the Admin password, Server name and Welcome message first:
set_pass_admin ADMINPASS
set_server_name SERVERNAME
set_welcome_message WELCOME MESSAGE

Notice that servername can only contain simple characters: ( A-Z, 0-9, _ ) NOTHING FANCY!
TO ENABLE THESE COMMANDS REMOVE THE SQUARE BRACKET (#) BEFORE THE COMMAND!

Now set the max players you found with the internet speed calculation:
set_max_players 15 15

Maximum is 200 players!

Scroll down and find the set_upload_limit command This one is really important! It will basically limit the server to use more bandwidth then your internet can handle
and scale its usage accordingly. it's really important that you set this to your Mb/s times 1000000 (one million)
In our example:
0.59 Mb/s * 1000000 = 590000 So we end up with:

set_upload_limit 590000

If you are running the server from a 100 mbit or more uplink leave the value as it is!;
set_upload_limit 30000000


You will also find a setting for port here:
set_port 7240

You can change it to whatever you like, but in this tutorial I'm assuming you kept it at its default value.

You're done setting up the basic commands, if you want to configure more commands check out the file "Readme.txt"
In the dedicated server folder, it will give you all possible set_ commands and what they do.
Scroll completely down in the file to see DLC specific commands.


4. Opening ports
(Also know as Forwarding ports)

Router Firewall
To make people able to see the server in the server list and join it you need to open the port on your computer and router.
Before you can open your port you need to find out what router you are using. just find your internet cable and see what box is connected to it,
flip it over and write down the details that are written on the sticker on its back.

Find your router in this list and select it:
Router port forward guides (http://portforward.com/english/routers/port_forwarding/routerindex.htm)

Once you found your router and selected it, skip the ad by clicking in the top right corner.
The page you're getting now has lists of games to open ports for, Warband is not in the list so click on "Default Guide"
Now work through the port opening guide for the port you configured with the set_port command. In our example that is: 7240
You are only opening a single port, NOT a port range. Open the port for two protocol types; Both UDP and TCP!


Windows Firewall
Now we must create a exception in your windows firewall as well for the same port you set in your settings.
Follow one of these guides:

For Windows 7:
http://windows.microsoft.com/en-US/windows7/Open-a-port-in-Windows-Firewall

For Windows Vista:
http://windows.microsoft.com/en-us/windows-vista/open-a-port-in-windows-firewall

For Windows XP:
http://support.microsoft.com/kb/308127


5. Running the server

Windows
This is really easy!.

Go to the folder you installed the dedicated server to and just run the file:
"NW_Sample_<gamemode>_start.bat"

Your server should be running. Skip the Linux part.


Linux
For Linux it isn't that easy.

We will be running the server in a app called Wineconsole which will emulate a windows console and send its output back to the Linux console.
Also we will be running the wineconsole inside the screen system so you can close your SSH session to the server without shutting down the server.

Use these commands to start the server:
"screen"
"wineconsole --backend=curses mb_warband_dedicated.exe -r NW_Sample_<gamemode>.txt -m Napoleonic Wars"

The server should be running, detach out of screen with: Control + A + D
to attach to the screen session again type in console:
"screen -r"

If you have multiple screen sessions open you need to specify which. First get a list of all the screens:
"screen -ls"

Find the one you want to attach to then simply type:
"screen -r <name of screen>"


6. Checking if server is working
- Start your Mount & Blade Warband game with the module “Napoleonic Wars” selected and go to the server list, make sure Internet is selected in the top dropdown list.
- Fill in the admin password and try to join the server
- See if everything is working fine and ping is fine.


7. Good to know stuff

Removing bans
You accidentally banned a mate of you? don't worry!

Votebans cannot be removed, they are automatically removed after 1 hour.
If you banned someone with the admin menu they are permanently banned. removing them is really easy!
- Open up the file ban_list.txt inside your Logs folder.
- Remove the desired line in this file which contains the person his ID and name.
- Save the file and you're done.



If your internet connection or computer can't handle the players you want then you can look for game hosters. I know a few, I might keep a list here later on.


If you guys have any questions or additions to the guide, please post here :)

Cheers and good luck!
Title: Re: Dedicated Server Hosting Guide
Post by: Nettelbeck on August 27, 2013, 05:26:44 pm
I am hosting some NW servers for regiments, they keep crashing after ~7-30 days of on time.
It seems to depend of how full the server gets.

So I got a decent linux Debian dedicated server with more than enough resources, being used by ~70% when a peak appears.

But SOMEHOW they keep shutting down with wine crashes here and there.

Its not helpful probably, but the errors are:
"
ELF     f7730000-f7731000       Deferred        [vdso].so
Threads:
process  tid      prio (all id:s are in hex)
00000008 (D) Z:\opt\gameserver\11\mb_warband_dedicated.exe
        00000023    0
        00000022    0
        00000009    0 <==
0000000e services.exe
        0000001e    0
        0000001d    0
        00000015    0
        00000010    0
        0000000f    0
00000012 winedevice.exe
        00000019    0
        00000014    0
        00000013    0
0000001a plugplay.exe
        0000001f    0
        0000001c    0
        0000001b    0
00000020 explorer.exe
        00000021    0
"

# wine --version
wine-1.4.1

Starting servers with:
WINEPREFIX='/opt/wineservers/06' WINEARCH='win32' wine mb_warband_dedicated.exe -r 06.txt -m Napoleonic Wars

Some believe weekly reboots are necessary to clear ram or fix something, but since I got 64gb and its not even near 20% usage overall I don't see any sense there.

It would be nice to have some advice about that.
Title: Re: Dedicated Server Hosting Guide
Post by: Skipper on November 17, 2013, 07:03:08 pm
Stable internet connection (Only if you host the server from your home)

Does that mean this method is required for people who have purchased servers?

https://www.fsegames.eu/forum/index.php?topic=10698.msg381290#new
Title: Re: Dedicated Server Hosting Guide
Post by: Von Alten on November 22, 2013, 06:32:22 pm
I have done all the instructions , set the server etc.
but wheni click start , I go in NW and its not there?
Title: Re: Dedicated Server Hosting Guide
Post by: Death by EMP on January 15, 2014, 01:13:44 am
Thanks for the guide Olaf, finally got my stuff working. You might want to add a section on how to make a static IP address, that was the part that gave me the most shit. One question, when my friends joined my server, their pings were in the 80s when the only live like 5 states away, and they would occasionally spike to about 100. Anyway to fix this?

This is my speed result while hosting the server with people on it:
(https://www.fsegames.eu/forum/proxy.php?request=http%3A%2F%2Fwww.speedtest.net%2Fresult%2F3232253711.png&hash=c29b54bfbc15a531cdbfcfb7c57cca74a6763aa8)
Title: Re: Dedicated Server Hosting Guide
Post by: Physic58 on February 09, 2015, 07:11:42 am
thanks for the guide
Title: Re: Dedicated Server Hosting Guide
Post by: Rubber_Walrus on February 28, 2015, 05:37:23 pm
I have an issue in that while the server is running, it appears in LAN, not Internet. I have set up the firewall exception for port 7240, and also made the virtual server rule with the same port. I have done tests on the different protocol types, but none of them work.

Can anyone help? I've been trying to work on this for about a week now.

(https://i.imgur.com/d7r4Tua.png)
Title: Re: Dedicated Server Hosting Guide
Post by: Dodo on March 01, 2015, 09:16:20 am
Just a shot in the dark, but are you sure WAN is the right interface ?
Title: Re: Dedicated Server Hosting Guide
Post by: Rubber_Walrus on March 01, 2015, 02:37:53 pm
Just a shot in the dark, but are you sure WAN is the right interface ?

Thanks for replying. I've just tried changing the interface, but the server still appears in the LAN server list. The only other interface is PVC1, and I have had no experience using this or any knowledge of what it does :/
Title: Re: Dedicated Server Hosting Guide
Post by: Dodo on March 01, 2015, 02:44:18 pm
Appearing in the LAN is perfectly normal since you're hosting it on your PC.
You should see it both in LAN & Internet.
Title: Re: Dedicated Server Hosting Guide
Post by: Rubber_Walrus on March 01, 2015, 02:51:31 pm
It's only appearing in the LAN list. There are also two instances of the server, despite only opening the bat file once...
Title: Re: Dedicated Server Hosting Guide
Post by: Grozni on July 01, 2015, 10:54:47 pm
Hello. I raised WB and NW servers on windows many times, but now I tried doing it on linux over ssh (using putty for ssh) and of course it is entirely different game, and I ran into some headbanging problems, maybe someone knowledgable and nice can enlighten me on how to solve them?

All I can gather is that problem is maybe in the distribution I chose ( CentOS 7, 64bit) and/or some problems with version of Wine available from yum. When I get time I'll try changing to Ubuntu, but in the meantime maybe someone can help out.

This is what I'm getting:

Code
fixme:service:scmdatabase_autostart_services Auto-start service L"MountMgr" failed to start: 2
wine: Bad EXE format for Z:\home\(username...)\Warband_Server\Mount&Blade Warband Napoleonic Wars Dedicated\mb_warband_dedicated.exe.

Why would it report bad exe format? And that MountMgr thing failed thing. I googled a lot, didn't help me, maybe someone had experience with this error or knows how to solve it?

I'm trying to run it as a shell script:
Code
 #!/bin/sh
wine mb_warband_dedicated.exe -r NW_Sample_Battle.txt -m Napoleonic Wars

Of course, I'm using Napoleonic Wars dedicated server files.

Update:
Cause of this problem is most likely described here: https://forum.winehq.org/viewtopic.php?f=8&t=23434 (https://forum.winehq.org/viewtopic.php?f=8&t=23434)
Through google you can find instructions on how to try to compile 32bit wine on centos 7, but it is best to use some other linux distro which is not pure 64bit.
Title: Re: Dedicated Server Hosting Guide
Post by: adamsimon on September 11, 2016, 08:35:00 am
Thanks for your help.  ;)
Title: Re: Dedicated Server Hosting Guide
Post by: Arkansan on November 16, 2016, 12:24:46 am
Hey folks, as I can't find the proper place for this question, I ask it here. We are currently using Oasis Servers and I realize this is for custom dedicated servers.

I'm having a problem setting up the default gamemode in our servers FTP to Conquest.

#setting battle (multiplayer_bt) mode
set_mission multiplayer_bt


I have tried everything under the sun to make the server start as conquest and I'm sure I'm just missing something.
I know bt, dm, tdm, sg, ctf ect ect.. But I do not know what the abbreviation for conquest is..

I've tried:
set_mission multiplayer_cq, ct, cnqt, cnqst, cnq, cn, conquest
set_mission conquest

Idk what I'm missing.. we are trying to get our North and South 1.1 server to default conquest on startup. You can currently change it manually in the ingame admin panel to Conquest, but after one map it reverts to whatever the default in the FTP is. Thanks again.




Ok, I found the answer to my own question. hq. Here's a quick cheat sheet.

#Set the mode. Modes are:
# multiplayer_bt   - Battle
# multiplayer_sg   - Siege
# multiplayer_tdm  - Team Deathmatch
# multiplayer_dm   - Deathmatch
# multiplayer_duel - Duel
# multiplayer_fd   - Fight and Destroy
# multiplayer_ctf  - Capture the Flag
# multiplayer_hq   - Conquest
#set_mission multiplayer_
set_mission multiplayer_hq
Title: Re: Dedicated Server Hosting Guide
Post by: moontoor on November 30, 2016, 04:39:39 am
how to turn on unit limits for line infantry? i want to make cavalry only server but i dont know how to do this :/
Title: Re: Dedicated Server Hosting Guide
Post by: Thunderstormer on November 30, 2016, 05:10:47 am
you have to have a map that restricts it.  It is not a server side setting that can be changed.(not by default anyways)

use this to learn how to make a map, or modify a map(you can modify any map) and make it cav only.

http://forums.taleworlds.com/index.php/topic,228008.0.html
Title: Re: Dedicated Server Hosting Guide
Post by: Syrcrim on February 03, 2018, 01:41:39 pm
Hello ! Can i host a server with 200+ slots ? (like 220)
Title: Re: Dedicated Server Hosting Guide
Post by: NiKeL11 on October 22, 2020, 08:14:36 pm
It's only appearing in the LAN list. There are also two instances of the server, despite only opening the bat file once...
The same thing happens to me, the SV only appears to me in LAN, and when I want to enter it tells me "you are banned".
If you could solve it, would you tell me how did you do it please?
Title: Re: Dedicated Server Hosting Guide
Post by: Grozni on October 22, 2020, 09:29:08 pm
It's only appearing in the LAN list. There are also two instances of the server, despite only opening the bat file once...
The same thing happens to me, the SV only appears to me in LAN, and when I want to enter it tells me "you are banned".
If you could solve it, would you tell me how did you do it please?

As for being banned from your dedicated server on LAN, I have the same issue and found no answers. But then I accidently ran into mention of this on Taleworlds forum, it is an issue that they will fix eventually.

What was mentioned as a workaround is running the server from a different network.
Title: Re: Dedicated Server Hosting Guide
Post by: SwissGronkh on December 06, 2020, 04:54:40 pm
It's only appearing in the LAN list. There are also two instances of the server, despite only opening the bat file once...
The same thing happens to me, the SV only appears to me in LAN, and when I want to enter it tells me "you are banned".
If you could solve it, would you tell me how did you do it please?

As for being banned from your dedicated server on LAN, I have the same issue and found no answers. But then I accidently ran into mention of this on Taleworlds forum, it is an issue that they will fix eventually.

What was mentioned as a workaround is running the server from a different network.

If i'm informed correct, it should work again.
Title: Re: Dedicated Server Hosting Guide
Post by: jacobwallace on October 20, 2021, 12:14:15 pm
Dedicated Servers from DedicatedHosting.com (https://www.dedicatedhosting4u.com/) have high-capacity SSD storage, new generation processors, and management software. New-generation processors, high-memory servers, and high performance are only a few of the features available. Now is the time to register. Server that is secure. There is a no-cost EMI option available. Processors with many threads.
Title: Re: Dedicated Server Hosting Guide
Post by: DoubleBread on November 19, 2023, 12:40:28 pm
Hi, could somebody please help me out with renaming custom maps? What file(s) is it done in? I tried renaming them in "scenes" but it doesn't do anything. The most logical file that could change it seemed to be "strings" to me as that defines what certain commands look like to humans in game and not just the machine reading, but that somehow messed up everything and I had to reset it to its original state.

EDIT: Just to clarify, what I mean is making it possible for what is shown as "scn_mp_custom_map_1" in "scenes" to show up as, say, "My Custom Map" in the in-game admin control panel and while changing maps. I tried searching through all the forum but nobody seems to mention it anywhere. I've seen that it's possible, though.
Title: Re: Dedicated Server Hosting Guide
Post by: Wursti on November 19, 2023, 01:24:56 pm
Yes you just have to change it in strings.txt if im not wrong

(https://cdn.discordapp.com/attachments/1058360529829232651/1175774217007005767/image.png?ex=656c7412&is=6559ff12&hm=d778b1834354fc52a0fa2e98f43736ffb0f37707eb9b47f42f2c0b6bebeeba15&)

Or Your_Map_Name (im not sure actually)

If that didnt work for you I can take a look at the file and see if anything was wrong as it should be how it works normally
Title: Re: Dedicated Server Hosting Guide
Post by: DoubleBread on November 19, 2023, 02:23:53 pm
Yes you just have to change it in strings.txt if im not wrong

(https://cdn.discordapp.com/attachments/1058360529829232651/1175774217007005767/image.png?ex=656c7412&is=6559ff12&hm=d778b1834354fc52a0fa2e98f43736ffb0f37707eb9b47f42f2c0b6bebeeba15&)

Or Your_Map_Name (im not sure actually)

If that didnt work for you I can take a look at the file and see if anything was wrong as it should be how it works normally
I did that (Your_Map_Name, since all the other strings also have that symbol) but then when I tried it out on the server, random unrelated strings started showing up in the chat although I didn't change anything else. I could briefly see the new name in the control panel but it associated itself with a different custom map and suddenly all the custom maps started loading under different numbers (for example when I wanted to load custom map 3, it loaded custom map 2 but showed that it's 3, etc). Just utter chaos :D Not sure what I did wrong, I could send you the "strings" file but idk how that'll help as I really only changed that one string. I appreciate the help!
Title: Re: Dedicated Server Hosting Guide
Post by: Wursti on November 19, 2023, 02:44:50 pm
This worked for me

(https://cdn.discordapp.com/attachments/1058360529829232651/1175793753101975582/image.png?ex=656c8643&is=655a1143&hm=b189721407cf18529bfcdf1a144e8f06175d20f2f8ade850b2366cef5f4336c5&)

(https://cdn.discordapp.com/attachments/1058360529829232651/1175793677294108712/image.png?ex=656c8631&is=655a1131&hm=7e17d3edd2ab5168d397d42976c5e440a1acf21cfa8c5f208cb03d1cef654766&)

Did you also change the names back to the original in the scenes.txt?
Title: Re: Dedicated Server Hosting Guide
Post by: DoubleBread on November 19, 2023, 03:40:17 pm
Did you also change the names back to the original in the scenes.txt?
Yes.

Let me show you what's happening on my side.

These are my 10 custom maps I use on the server, located in "SceneObj":
Spoiler
(https://i.ibb.co/M5R81p4/Sn-mek-obrazovky-2023-11-19-150547.png)
[close]
Scenes:
Spoiler
(https://i.ibb.co/P17wyj7/Sn-mek-obrazovky-2023-11-19-150524.png)
[close]
My new attempt at changes in "strings":
Spoiler
(https://i.ibb.co/XSFbc57/Sn-mek-obrazovky-2023-11-19-150438.png)
[close]

This is the result (sorry for low quality if you're seeing this minutes after upload):
https://youtu.be/2-nLEgLLUWk?si=R5AUFNIvrdlHKipo *
*I just realized what I'm saying at 0:53 is actually not true, the map that loaded as "Random Forest" is custom map 2, so it seems to load not the second map in order (after the one it's supposed to load), but the 3rd.
Title: Re: Dedicated Server Hosting Guide
Post by: Matues on November 19, 2023, 04:18:37 pm
i never figured this out either, all my maps were just overwrites of original-game maps or overwrites of 'custom map 1,2,3..'

so even though i don't host trench battle anymore, I'm kinda intruigued to see the answer for how to custom name the maps
Title: Re: Dedicated Server Hosting Guide
Post by: Wursti on November 19, 2023, 08:03:52 pm
The first unrelated string you showed was a string of a custom flag name which shouldnt really be related to that, or doesnt it happen if you dont change it?

Could be that the scripts you use change how stuff works / is shown, as I did it on a vanilla server without any changes except the 2 custom maps that I renamed
Title: Re: Dedicated Server Hosting Guide
Post by: DoubleBread on November 19, 2023, 09:11:48 pm
The first unrelated string you showed was a string of a custom flag name which shouldnt really be related to that, or doesnt it happen if you dont change it?

Could be that the scripts you use change how stuff works / is shown, as I did it on a vanilla server without any changes except the 2 custom maps that I renamed
It could be, I'm not very familiar with scripting and I'm not sure what changes we have that are not vanilla, I'm not aware that there would be any. We use a configuration that defines what factions, map and rules are set on server reset + a whitelist but that's about it. I guess I'll leave it be for now but if anyone still has any ideas, I'd welcome them  ;D

Btw the custom flag string only shows when I'm trying this out, it's not a normal behaviour. The same goes with the horse string.
Title: Re: Dedicated Server Hosting Guide
Post by: DoubleBread on November 19, 2023, 11:44:33 pm
i never figured this out either, all my maps were just overwrites of original-game maps or overwrites of 'custom map 1,2,3..'

so even though i don't host trench battle anymore, I'm kinda intruigued to see the answer for how to custom name the maps
If you're still interested, Wursti and I looked into it and I figured the problem occured because I kept editing the "strings" file directly inside the server files instead of editing it outside the files and then placing it there manually. So, Wursti's first answer is legit - it works just fine now  ;D ;D So, problem fixed!