COD4
Page 1 of 9 123 ... LastLast
Results 1 to 10 of 86

Thread: The Ultimate Noob’s Guide to Setting Up a CoD4 Server

  1. #1
    Join Date
    Jan 2009
    Posts
    278

    Default The Ultimate Noob’s Guide to Setting Up a CoD4 Server

    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.

  2. #2

    Default

    good job, very nice starters guide.

    the sv_maxrate cvar sets the server's upload per player. if you are hosting from home, you got to see what upload bandwidth you got, then you can decide what maxrate and number of maxclients to set.

    for example, if you got 300kbps upload (roughly 30kb/s), sv_maxrate 5000 should be fine (roughly 5kb per player). 6 players should still work because mostly not everyone gets the maximum bandwidth at the same time and the game's antilag also helps to keep things playable as long as you dont exceed your connection's upload bandwidth.

  3. #3
    Join Date
    Mar 2009
    Posts
    13

    Default

    I did everything you told me but my server is only showing up under local?

  4. #4

    Default

    did every thing ,port is open etc.but i find it in local not on internet.so pls help,it looks like a common problem.
    Last edited by Vodk4; 07-26-2009 at 10:49 AM. Reason: problem resolved

  5. #5
    Join Date
    Jan 2009
    Posts
    278

    Default

    I have recently found that changing the port from 28960 to 28930 will make your server appear on the main server page when searching. Give that a shot.
    "Work gets in the way of life"

  6. #6

    Default

    Hey, first off great article!
    Its helping me alot with understanding the .cfg file for a server im presently administering.
    Its my first and its very exciting

    I have a couple questions though, but my main has to do with spectating.
    Where is the best place for this command?
    I saw where u had it and im yet to try it. But im seeing the following on my config.
    //************************************************** ****************************
    // Misc
    //************************************************** ****************************
    set sv_allowAnonymous "0"
    set g_antilag "0"
    set g_compassShowEnemies "0"
    set scr_teambalance "1"
    set scr_game_allowkillcam "1"
    set scr_game_spectatetype “1" <---

    Should that be there? as it is right now, im stuck in 1 position and cannot spectate. If i select a team i can jump from one player to the next, but thats about it. I cant view the other team or free roam.

    Any assistance would be greatly appreciated! Keep up the good work!
    Last edited by Fr0st; 07-29-2009 at 12:01 PM.

  7. #7
    Join Date
    Jan 2009
    Posts
    278

    Default

    Thanks for the compliment.

    First, I do not believe the location of the command is important. The server will run all of the commands at once when the server loads. Most who create a config file like to separate commands into sections for convenience sake.

    Your command: set scr_game_spectatetype “1" will only allow you to spectate members on your team. If you set this value to "2", you should be able to spectate anyone in the game whether they are on your team or not. Most servers won't set this since it's kind of unfair. Imagine if you & your friend are on the same team and in vent or teamspeak. You die in the game and your friend is still alive. You could tell him where the enemy is.

    So when you connect to the server, you will need to pick a side before being able to spectate. Hope that helps.
    "Work gets in the way of life"

  8. #8

    Default

    Wow.. you cleared up probably the most major of concern i had ! LOL
    I was really worried if the location of the commands are important since i have an overseas party hosting it and reaaaaallly dont wanna cause problems to my server and bother them with repairing a n00bish mistake

    I agree with you on the 'not fair' motive behind such a thing, true it'll cause much grief to all players. Would that settings (2) allow free flying type spectating?

    Another question i have is console messages. Where could i find and edit console messages? I'd like to customize this but i just dont know where its located.
    Last edited by Fr0st; 07-29-2009 at 12:55 PM.

  9. #9
    Join Date
    Jan 2009
    Posts
    278

    Default

    Glad to help out.

    I don't know if the 2 setting for spectate would allow free flying. I have never used it. That would be a good test. Can you test it out & let me know?

    For your other question, I am assuming you're talking about automated console messages like "Welcome to our server. Blah Blah blah" repeating every so often? If so, I'll be working on another guide for that since that is a PIA to get set up.
    "Work gets in the way of life"

  10. #10
    Join Date
    Aug 2009
    Posts
    2

    Default

    I got a question you might be able to help with.

    I have been setting up servers for years (Quake/CS1.6/COD4) I took down the COD4 server last year and want to put it back up. Clean install of Server 2003 on a 4 core Xeon 3.6Ghz 4GB RAM in a legit service providers rack space. Still have all of the Service Groups in my Cisco Router set up so everything is good on that end.

    I am having an odd problem though, When I specify the IP/Port in the command line, the server starts up, but It doesn't show up in favorites on my laptop so I can't connect.

    If I don't specify the port/ip it works fine at the default 28960

    But if I try to specify the port/IP in the server.cfg file, it STILL just uses the default port no matter what.

    This sucks because Ultimately I am trying to get COD4 and CODWAW servers up simultaneously, but I am just trying to get the COD4 one running smooth before I throw something else in the mix.

    Any Ideas? I lurked the webs for hours and found one user on another thread with the same issue but no resolution came of the thread.

    (Here is the thread, similar problem)
    http://cod4boards.com/cod4-server-su...-settings.html

Page 1 of 9 123 ... LastLast

Similar Threads

  1. Ultimate BIOS Guide: Every Setting Decrypted and Explained!
    By News Reporter in forum In The News
    Replies: 0
    Last Post: 06-15-2009, 02:50 PM
  2. Trouble setting up COD4 Server
    By dave247 in forum COD4 Server Support
    Replies: 9
    Last Post: 06-10-2009, 01:52 PM
  3. Help with setting my server..
    By h2th3pizzo in forum Modding/Mapping
    Replies: 1
    Last Post: 10-02-2008, 03:46 PM
  4. Make Me The Ultimate Noob Class
    By rshin30 in forum Call of Duty: COD4 Forums
    Replies: 19
    Last Post: 09-12-2008, 11:33 AM
  5. A Complete Guide to Setting Up Your Own Home Server
    By News Reporter in forum In The News
    Replies: 0
    Last Post: 08-17-2008, 10:20 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •