One of the biggest problems I see with other server guides is that they are not complete. Most of them assume you already have some knowledge of setting up a server. This is a bad assumption. I have read plenty of threads asking for help in configuring a server so it can be seen and joined by others via the Internet. That’s what this guide is about.
I have broken up this guide into 3 main categories:
1. Installation details
2. Configuration
3. Troubleshooting
I will attempt to make these steps as easy to understand as possible. Please note that I certainly do not know everything about setting up & configuring a server. In this guide, I will share everything I know about a server through my own experiences setting one up on my own.
1. Installation details
Installing the server software really could not be easier. Since the game inherently comes with the ability to start a server, there’s really no special setup required. Just install the game on a computer you would like to use as a dedicated server. I have read about others copying the entire content of the install DVD to the server and running it that way. I personally do not have any experience in doing it this way, so I cannot provide details on how this is done.
Once this is done, you should have a couple of icons on your desktop. There will be one for single player and one for multiplayer. We will only concern ourselves with the multiplayer icon. You will need to change the arguments for running the multiplayer executable on the server. This is done by right clicking on the multiplayer icon and selecting the “Properties” option from the pop-up menu. The “Properties” window will appear. Click on the “Shortcut” tab so you see the shortcut properties. The field we will be concerning ourselves with is the “Target” field in this window. Currently it will look something like the following:
D:\CoD4\iw3mp.exe
We need to add some arguments that will tell the server that you wish to run a dedicated internet server. I’ll show you what it will look like first and then explain each piece of this command line:
D:\CoD4\iw3mp.exe +set dedicated 2 +set sv_punkbuster 0 +exec nub.cfg +map_rotate
Ok so the first piece you already know:
D:\CoD4\iw3mp.exe – this is the path of the executable.
+set dedicated 2 – This specifies what type of server you are setting up. The #2 means you want a dedicated server. If you were to place a #1 there instead, you would be running a LAN server.
+set sv_punkbuster 0 – This is pretty self explanatory. This section specifies whether or not you wish to use punkbuster with your server. If a #1 was added here instead of a 0, you would be using punkbuster. Please note that you must run punkbuster before you start your server if you would like to use it. It is also worth noting that punkbuster might possibly cause additional lag on your server. With my experiences both using it and disabling it, I had found that there is significantly less lag on my server without it. It’s just something that I’ve noticed and may or may not be true.
+exec nub.cfg – This tells your server which configuration file to run. Mine is named nub.cfg so this section will execute that file. Make sure all of your cfg files you wish to run are stored in the folder titled “Main”. Your configuration files will not work if they are placed anywhere else.
+map_rotate – This tells your server that you wish to rotate the maps based on how they are specified in your configuration file. Speaking of the configuration file, let’s take a look at how it is laid out in the next section.
2. Configuration
We will break this section up into 2 main sub-categories: Server configuration and game configuration.
-Server configuration
The basic goal of the server configuration is to make your server visible to the rest of the CoD4 community. This is relatively simple to do. For the following information, I am assuming that you are setting up a server within a local network where all computers share the same internet connection.
The first thing to do is to make sure you know the internal IP address of your server. You can do this by bringing up a command prompt (Start, Run, type in cmd). In this command prompt window, type in ipconfig. You will see your IP address similar to the following: 192.168.x.x.
Once you have this IP address, you will need to open the ports needed by CoD4 to communicate with others. This port number is 28960. At this point, I suggest visiting
PortForward.com - Free Help Setting up Your Router or Firewall to find out how to do port forwarding for this game for your specific router. While you are there, download and install the
port checker utility. It is an extremely helpful tool to check and see if your port is open and working properly.
The bottom line for the server configuration is this. If the port checker tool states that port 28960 is open on your server, you’re good to go!
-Game configuration
The configuration file (or .cfg file) is the heart of any server setup. It tells your server specifically what you want to include and what you want to exclude. A config file can become quite lengthy and complex. However, for this guide, I’m going to try and keep it as simple and concise as possible. Here’s what my configuration file looks like; it’s called nub.cfg on my server:
Code:
set sv_punkbuster 0
//wait
//pb_sv_enable
// Server name
set sv_hostname "Yourservernamehere" //Change this to whatever you want your server to be named in the server browser
set scr_motd "Welcome to Nub's Server! Grab a beer & a gun and have some fun!"
scr_game_spectatetype 1
scr_game_allowkillcam 0
scr_player_forcerespawn 0
// Server password
set g_password "" // blank means NO password
set g_allowvote "0"
// Rconpassword
set rcon_password "yourpasswordhere" // Change this to your rcon password!
// Maximum Clients
set sv_maxclients "10"
set sv_privateclients "10"
set scr_teambalance "1"
// Max Ping
set sv_maxping "350"
// Rate
set sv_maxRate "25000"
// Map_rotation
set sv_mapRotation "gametype war map mp_shipment gametype war map mp_killhouse"
set sv_maprotationcurrent ""
scr_war_scorelimit 600
scr_war_timelimit 7
The first thing to notice is every line with the // preceding. These lines are comments and do not execute. So you can make notes as long as you put the // before them. I started the cfg file by disabling punkbuster, so I set it to 0. Then I set my host name. For this guide, I set it to a value of “Yourservernamehere” but you can set it to whatever you want. This is the name that will show up when players are searching in game for your server. Then the message of the day is set via scr_motd. Honestly, I have not seen this line actually used anywhere, so I believe it would be safe to remove it.
Next, I specify whether or not spectating is allowed through the
scr_game_spectatetype 1. A value of 0 disables spectating, a value of 1 allows team spectating only & a value of 2 allows spectating for all players. Next I disable the killcam via
scr_game_allowkillcam 0. This can be set to either 0 or 1.
The next command I like;
scr_player_forcerespawn 0. This specifies whether or not you will automatically respawn after you are killed. A value of 1 will make you respawn after you are killed. 0 means you have to press the F key to respawn. This comes in handy if you go afk for a while but don’t want to switch to spectate mode.
The next command allows you to set a password for players to access your server;
set g_password. If this is blank, players do not need a password to join your server. The command after that specifies whether you enable voting on your server;
set g_allowvote. I have mine turned off, so this value is set to “0”. If you set it to “1” or leave this command out of your cfg file, voting is enabled by default.
The next command deals with the remote console or rcon as it is called. This allows someone with proper access to log into your server remotely and run commands. In order to do this, you need to supply the rcon password. This command specifies that password;
set rcon_password. Set it to whatever you would like and make sure you have the quotes around it.
The next section of my cfg file deals with maximum number of clients to connect. The
set sv_maxclients specifies how many players the server will accept. I believe the line below it (
set sv_privateclients) specifies how many clients supplying a password can log in. If your server does not have a password, this command is not used. The next command specifies whether or not you would like to use the auto balance feature;
set scr_teambalance. If this is set to 1, auto balance will be used. If this is set to 0 or if this command is not included in your cfg file, auto balance is not used.
The next command specifies the maximum ping time in milliseconds your server is willing to accept from a client. I have mine set to 350 which is fairly high. If a client’s average ping is over this number, they will not be able to connect.
Honestly, I currently do not know what the set sv_maxRate command does. I left it there from a previous config file I modified. It doesn’t hurt anything, so I left it in there.
The next section is where you can set your map rotation. This is first done with the
set sv_mapRotation command. Anything following this command in quotes is how you have your server rotate maps. The syntax of these commands look like this:
Gametype <set gametype here> map <set map name here>
There are 6 different gametypes you can set:
• dm is free for all deathmatch
• dom is domination
• koth is headquarters
• sab is sabotage
• sd is search & destroy
• war is team deathmatch
I currently have my server set up to rotate between 2 maps; shipment & killhouse. My game type is team deathmatch. So my map rotation format looks like this:
set sv_mapRotation "gametype war map mp_shipment gametype war map mp_killhouse"
You can mix & match different gametypes in this command and it can become quite lengthy. Just remember for each gametype you specify in this section, you should also specify the limits of each type.
Again, I do not know what the
set sv_maprotationcurrent "" command does. I could probably remove it and my server would run fine. But I left it in there because it’s not preventing anything from working properly.
As you see below this, I have set a score limit of 600 and a time limit of 7. That’s what the following commands specify:
scr_war_scorelimit 600
scr_war_timelimit 7
So on my server, the winning score is 600 (10 points per kill, 2 points per assist). The maximum time per round is 7 minutes.
That’s a very basic definition of some of the commands I use on my server. There are quite a few other posts out there with many other command definitions. I will try to post some additional commands in this thread when I can. Feel free to add your own posts with commands.
3. Troubleshooting
So what are you having a problem with? Feel free to post your problems here. I’ll do my best to answer your questions to the best of my knowledge.
Also feel free to post any questions, comments, or suggestions about this guide here. I will do my best to tweak this to make it the best basic guide possible.