Summary: Want to set up a Battlefield 2 server for your friends? Are you in that left-wing liberal hippie "experimental" stage at college and have a Linux server? Well, we won't hold it against you. Jason's got a quick guide to setting up a Linux BF2 server here.
Ok, so Battlefield 2 is out and people are going to want to play it. This requires either one of two things: single player mode or an internet server. Well, there are two options for hosting a server at current and those are Linux or Windows. The Windows server is pretty simple so this article is going to focus on setting up a Linux server and getting it ready for play. First things first: you need a Linux server, or at least access to one. Now, the required specs for a 16 player server is 2.5 Mbit throughput, 1 ghz processor and 256 MB of RAM. Not too steep, really, but you'll want more than that to run even a 16 player server smoothly. Well, once you're sure you have the requirements and you have access to the server, then it's time to install. If you own this Linux server, or have root to it, then you do NOT want to run the server as root. You will want to make a new user for it. You can do this by running the command “useradd whatevernameyouwant” and then change the password for that user by using the command “passwd whatevernameyouwant”. You can then log in as this user and download/install the server. Once logged in, you'll want to download the file. This is accomplished by using the command “wget ftp://largedownloads.ea.com/pub/misc/bf2-linuxded-1.0.2442.0-installer.zip”. This will bring up a WGET that looks like this (for the most part): [image]
Now, it's not necessary to download it from EA, in fact there are plenty of mirrors out there for download. This part will likely take the longest, depending on your connection. My server sits on a DS3 and it's still slow, odds are that EA is getting pounded right now for downloads. So anyway, once that's downloaded the next step is to unzip the file. This is a fairly straight forward command, “unzip bf2-linuxded-1.0.2442.0-installer.zip”. That will unzip the file and place it in your current directory. Once that is done, you'll end up with a file named bf2-linuxded-1.0.2442.0-installer.sh. This file is your install file. Now, let's begin the install.
We're getting close now, we just need to do some configuration. The first thing we need to look at is the “serversettings.con” file located in the mods/bf2/settings directory. You'll need to open this file up with your favorite text editor, I use NANO but there are plenty out there to choose from. This file is the basic configuration file for your server. We're going to go through the important lines here (Note: this is not a full list, I have dropped certain commands that don't need to be altered and are fine like they are or don't have much impact on the actual gameplay. Overall, very few lines have been removed.): sv.serverName "Default Server Name" This setting is used to set the name that the rest of the world sees your server as. sv.password "" If you want to set a password that people will have to use to access your server, you set it here. sv.internet 0 This setting is used to broadcast your servers information to the list servers so that everyone can see it. If you want it to be a public server, set this to 1 otherwise leave it at 0. sv.bandwidthChoke 0 If you want to put a cap on how much bandwidth that your server uses, you would put that here. sv.serverIP "" This is one of the most important settings. This is where you put the IP address of your server. sv.serverPort 16567 This is the port that your server listens on for Battlefield 2 connections. You can change this if you want, but make sure you check a port list to see whats reserved for other things. It defaults at 16567.
The message that shows up in the bottom pane of the loading screen when people connect to your server. sv.punkBuster 0 Set this to 1 to activate the Punkbuster software. sv.allowFreeCam 0 Setting this to 1 allows players to freely roam around the battlefield while waiting to spawn. sv.allowExternalViews 1 This setting allows the use of 3rd person view while piloting vehicles. sv.allowNoseCam 1 Allows the use of a nose camera in the aircraft. sv.hitIndicator 1 This setting shows a little indicator every time you hit someone while firing at them. sv.maxPlayers 64 This is the maximum amount of players you allow on your server. My server is currently set to 24 because I like smaller games, but if you have a pretty stout server and pipe, then you can run a 64 player server. sv.numPlayersNeededToStart 2 Pretty self explanatory, but this is the amount of people required for scoring to begin. sv.notEnoughPlayersRestartDelay 15 The time delay set for when there aren't enough players on a server to start scoring. sv.startDelay 15 This is how long players wait, in seconds, to join a game once it has begun. This gives time for players to choose sides and the such. sv.endDelay 15 This is the amount of time, in seconds, that the game waits between rounds. This is so people can look at scores and the such. sv.spawnTime 15 This is the spawn timer. It's just like Battlefield 1942 in the fact that once you die, you have to wait a certain amount of time to respawn. sv.manDownTime 15 This is the amount of time that you can be resusitated by a medic after being incapacitated. Set this to the same amount of time on the spawnTime. sv.ticketRatio 100 Ok, this is the setting that says how many tickets each side gets during a round. I usually set mine higher than this, but keeping it at 100 means a shorter game. sv.roundsPerMap 3 This is the amount of times you will play a map before it switches to the next map. sv.timeLimit 0 Set this if you want your server to have a time limit on each round. I leave this at 0 and make people KILL EACH OTHER to get to the next map. It's the American way!
This is the percentage of damage that team mates take from friendly fire. sv.vehicleFriendlyFire 100 Same as above except in regards to vehicles. sv.soldierSplashFriendlyFire 100 The percentage amount of splash damage (aka radius of effect from rockets/grenades) that team mates take from friendlies. sv.vehicleSplashFriendlyFire 100 Sames as above except in regards to vehicles. sv.tkPunishEnabled 1 Ok, when someone kills a team mate, that team mate is allowed the option of punishing them. Other than some obvious bad effect to being punished, there is also the next setting. sv.tkNumPunishToKick 3 This is the amount of times you get punished before you are kicked. I usually crank this up on my server because I play mostly with friends and colleagues, but on a pub you may want to leave it at 3. sv.tkPunishByDefault 0 If this is set to 1 it automatically punishes team killers without prompting the victim. sv.votingEnabled 1 This allows players to vote on maps and such on the server. Set to 0 if you don't want any voting. sv.voteTime 90 This is the amount of time players are allowed to vote on a map once a vote has been started. sv.minPlayersForVoting 2 This is the minimum amount of players that are playing before a vote can be started. sv.autoBalanceTeam 0 Set this to 1 if you want the server to move players between teams to make the sides fair. sv.teamRatioPercent 100 This is a percentage point representation of the amount of players on the first team as compared to the second team is allowable by the servers auto balance function. Leave this alone for the most part. sv.voipEnabled 1 This setting enables or disables VOIP communication for teams. sv.voipQuality 3 This is a setting between 1 and 5 that sets the quality of VOIP sound. 5 is the highest and uses the most bandwidth, 3 is the default for Internet. sv.voipServerRemote 0 If you use a remote VOIP server instead of the one you run the game server on, set this to 1 and set the following command to the IP address of your external server. sv.voipServerRemoteIP "" See above. sv.voipServerPort 55125 This is the VOIP port on the server. sv.voipBFClientPort 55123 This is the port that the game server uses to communicate with the VOIP server. sv.voipBFServerPort 55124 This is the port that the VOIP server uses to communicate with the game server. sv.voipSharedPassword "" If using an external VOIP server, this should be set to the VOIP servers password. sv.useGlobalRank 1 Allows players to show the ranks they've earned on official servers. sv.useGlobalUnlocks 1 Allows players to use the unlocked weapons they've earned on official servers.
The final file we need to alter is also under mods/bf2/settings. That file is the maplist.con, and it controls what maps are run in the rotation. There's a simple format to this file: mapList.append dalian_plant gpm_cq 16 What this basically says is mapList.appaend (add this map to the list) dalian_plant(the map name) gpm_cq(conquest) 16(the map size, which is 16, 32 or 64). The following is an example of my maplist.con on my personal server: mapList.append dalian_plant gpm_cq 16 mapList.append daqing_oilfields gpm_cq 16 mapList.append dragon_valley gpm_cq 16 mapList.append fushe_pass gpm_cq 16 mapList.append gulf_of_oman gpm_cq 16 mapList.append kubra_dam gpm_cq 16 mapList.append mashtuur_city gpm_cq 16 mapList.append operation_clean_sweep gpm_cq 16 mapList.append sharqi_peninsula gpm_cq 16 mapList.append songhua_stalemate gpm_cq 16 mapList.append strike_at_karkand gpm_cq 16 mapList.append zatar_wetlands gpm_cq 16 As you can see, I've included all of the maps available because we want to try them out and see which ones we like and don't like. The default maplist.con comes with only one map listed, so you'll want to edit yours, or feel free to copy my list and paste it into your file. Of course, if you want large maps, you'll have to change the number at the end. Now, we can finally run our server. Now, if you want to run it unattended, there are a few ways to do this. You can cron a job for it that will check to see if it's still running every little while or you can screen it. We're only going to cover screen for right now. Screen is a Linux command that allows you to open up another shell inside your current one and then detach from it and leave it running. You can re-attach yourself to a screen any time, and it's incredibly useful. There are a few different ways to start a screen. First you can just run the command as so “screen ./start.sh”. This will start up a new screen instance running the server, you can detach from it by hitting CTRL-A and then CTRL-D in quick succession. Then if you wanted to go back into the screen you would type “screen -r”. That's one way, but the one I prefer is naming my screens. I run the command “screen -S bf2” to start a new screen with a name. You can use the -S (note: case sensitive) to name a screen. This is useful if you run multiple screens on your server, as I do. You can then go to the server directory and run the server using “./start.sh” and then detach. You re-attach to a named screen by using the -x(note: also case sensitive) switch. So, if I wanted to re-attach to my server screen it would be “screen -x bf2”. Either way works, but I prefer the way I do it for cleanliness sakes and because I use multiple screens. So, once we have the server started, you should see something like this: [image]
Once the loading hits 100%, the server should be good to go. There's a list of commands that you can use with the server included in the readmes directory. There's really only one more thing I'd like to cover before we come to a close on this article: RCon access.
port= For instance: port=4711 When a player connects and has the password, he can bring down the console and type “rcon login server” where server is the server's RCon password. This will give him or her access to the rcon command set. You can find the RCon command set in the readmes directory in the file “readmeserver.txt”. Well, that's about it for setting up a basic server. I hope it was helpful. Now, get out there and kill those infidels! | ||||||||||||||||||||||||||||||
| © Copyright 2003 FS Media, Inc. |