Author Topic: Dedicated Server Hosting Guide  (Read 42874 times)

0 Members and 1 Guest are viewing this topic.

Vincenzo

  • External Developer
  • *
  • Coder of code
    • View Profile
    • Flying Squirrel Entertainment
  • Faction: Neutral
  • MP nick: FSE_Vincenzo
  • M&BWBWF&SNW
Dedicated Server Hosting Guide
« on: April 30, 2012, 10:17:16 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
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 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 Scroll down to Other Downloads.
- Wine 1.4 follow installation guide here: Wine Installation steps
- 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

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!
« Last Edit: May 13, 2012, 04:01:26 PM by Vincenzo »
 

SvenssonHD

  • Grandmaster Knight
  • *
    • View Profile
  • Faction: Neutral
  • MP nick: Svensson
Re: Dedicated Server Hosting Guide
« Reply #1 on: April 30, 2012, 10:18:26 PM »
Great guide. It's really useful with all the individuals with their own regimental serverboxes. Myself learned alot from this guide when I used to mess around with my own configuration.

a4especibot

  • Recruit
  • *
    • View Profile
  • Faction: Neutral
Re: Dedicated Server Hosting Guide
« Reply #2 on: May 01, 2012, 04:47:17 AM »
Hi there,

When I try to install the M&B:WB - NW Dedicated Server Files for my Steam version of the game it says "Title not installed" or something like that.

Can Taleworld add this Dedicated Server option to the 'Tools' menu of Steam, like many other titles do?

-A4

Vincenzo

  • External Developer
  • *
  • Coder of code
    • View Profile
    • Flying Squirrel Entertainment
  • Faction: Neutral
  • MP nick: FSE_Vincenzo
  • M&BWBWF&SNW
Re: Dedicated Server Hosting Guide
« Reply #3 on: May 01, 2012, 07:34:34 AM »
You cannot run the dedicated server through steam, and you should not have to!
 

James Stewart

  • Grandmaster Knight
  • *
    • View Profile
  • Faction: Neutral
  • WBNW
Re: Dedicated Server Hosting Guide
« Reply #4 on: May 01, 2012, 08:07:59 AM »
Brilliant guide, but is there any intention to bump up the max slots above 200 at any stage or is there a binary or whatever its called like that was available for MM?

Lord of the Flies

  • Regular
  • *
  • Trying is worth more than succeeding
    • View Profile
  • Faction: Neutral
  • MP nick: Unknown
  • M&BWBWF&SNW
Re: Dedicated Server Hosting Guide
« Reply #5 on: May 02, 2012, 01:37:41 PM »
It's not possible anymore to create a server?

Vincenzo

  • External Developer
  • *
  • Coder of code
    • View Profile
    • Flying Squirrel Entertainment
  • Faction: Neutral
  • MP nick: FSE_Vincenzo
  • M&BWBWF&SNW
Re: Dedicated Server Hosting Guide
« Reply #6 on: May 02, 2012, 01:39:18 PM »
Why woulden't it?
 

Lord of the Flies

  • Regular
  • *
  • Trying is worth more than succeeding
    • View Profile
  • Faction: Neutral
  • MP nick: Unknown
  • M&BWBWF&SNW
Re: Dedicated Server Hosting Guide
« Reply #7 on: May 02, 2012, 01:44:46 PM »
A lot of people tell me, that you have to rent servers and making it isn't possible

Vincenzo

  • External Developer
  • *
  • Coder of code
    • View Profile
    • Flying Squirrel Entertainment
  • Faction: Neutral
  • MP nick: FSE_Vincenzo
  • M&BWBWF&SNW
Re: Dedicated Server Hosting Guide
« Reply #8 on: May 02, 2012, 02:04:25 PM »
wuut?

Everyone can run the above guide on his computer if he has half decent internet connection and it should work...
 

Lord of the Flies

  • Regular
  • *
  • Trying is worth more than succeeding
    • View Profile
  • Faction: Neutral
  • MP nick: Unknown
  • M&BWBWF&SNW
Re: Dedicated Server Hosting Guide
« Reply #9 on: May 02, 2012, 02:10:37 PM »
I'm trying it, but I think I do something wrong, I haven't got a static ip address, but I don't get it how I should do that...

Vincenzo

  • External Developer
  • *
  • Coder of code
    • View Profile
    • Flying Squirrel Entertainment
  • Faction: Neutral
  • MP nick: FSE_Vincenzo
  • M&BWBWF&SNW
Re: Dedicated Server Hosting Guide
« Reply #10 on: May 02, 2012, 02:11:11 PM »
You don't need a static IP.

If you open the correct ports on your router it will register itself with the main warband server and work.
 

Lord of the Flies

  • Regular
  • *
  • Trying is worth more than succeeding
    • View Profile
  • Faction: Neutral
  • MP nick: Unknown
  • M&BWBWF&SNW
Re: Dedicated Server Hosting Guide
« Reply #11 on: May 03, 2012, 10:43:28 AM »
Thank you very much.

SweatyShadowbs

  • Recruit
  • *
    • View Profile
  • Faction: Neutral
  • MP nick: 1stCI_Arty_Kpt_SweatyShadow
Re: Dedicated Server Hosting Guide
« Reply #12 on: May 04, 2012, 07:49:21 AM »
Sorry but my server is only LAN. How do I make it an internet server so my friends can join?  Also I am somewhat familiar with forwarding ports, but I couldn't find my router on that website so I'm not 100% sure if I did it right.
My hair is a bird.  Your argument is invalid.

DanyEle

  • Master Knight
  • *
    • YouTube - DanyEle101
    • View Profile
    • Italian Brigade's forum
  • Faction: Swadian
  • MP nick: BI_DanyEle
  • WBNW
Re: Dedicated Server Hosting Guide
« Reply #13 on: May 04, 2012, 07:19:11 PM »
If you are hosting the server on your PC, then YOU should see it in LAN, that's normal.Whereas your friends should see it in the internet list.




Kegger

  • Sergeant Knight
  • *
    • View Profile
  • Faction: Neutral
  • MP nick: 1stWFI_Uffz_Sven
Re: Dedicated Server Hosting Guide
« Reply #14 on: May 05, 2012, 12:35:58 AM »
Something to note: I downloaded the server files from the Taleworlds main site. Just running the factions as they are in the default game mode text files, it pulled up errors in game with the factions not actually showing (Something like Invalid Faction).

I had to change them to like fac_britain to get them to work properly. Don't know if this was a freak occurrence or if this is common.