How to Run a public server
Posted: Tue Feb 08, 2005 12:38 am
Ok, so you want to run a server.
First things to ask yourself:
Are you ready to run a public server?
Do you have the bandwidth and computer speed/time to run a server?
Do you have the required computer knowledge to set up a server?
Do you have the time and/or administrators to properly maintain the server?
Running a public server is not a trivial task. It will take a significant amount of bandwidth, and dedicated computer time to run a server. At the current time (2/7/05) there are over 120 servers and over 200 players. The current ratio is about 1 server per 2 players. How will your server be different then these? What will draw people to your server rather than the others? These are all questions you should ask yourself.
The most popular public servers are on high speed internet connections, strongly administered, and use fun and exciting maps. While a 100 shot 'uber death' server may sound like a blast right now, the joy will wear off fast.
Bandwidth wise bzflag uses about 5kb per second per player. The more players that you have the more bandwidth you need. Public servers should always be on dedicated high speed internet connections, with large amounts of "upstream" or "sending" bandwidth. The server's job is to send data out to all the clients. The amount of data the server receives from other clients is a smaller percentage then the data it sends. The general idea is that a server multiplies any data sent to it, by sending it to every other player...so on a 5 player game, every message a player sends in, is sent out by the server 4 more times.
In general internet connections can be broken into the following categories
Dialup
This is a connection over a regular phone line using a regular old modem.
Dialup connections are limited to 3-4k per second transfer, which is very, very slow.
In general you do NOT want to run a server on this type of connection. You will be able to barely support a single player.
DSL (Digital Subscriber Line)
Most DSL systems these days are fast enough to run small servers of 4 - 6 players. DSL connections always have 2 speeds, one is the "downstream" and one is the "upstream". The downstream is almost always higher. The bigger your upstream is, the more players you can run.
Cable (Cable Modem)
Cable modems can offer a large amount of bandwidth, with some caveats. Cable modems are shared bandwidth. This means that you are not the only one using it. This can make your bandwidth fluctuate greatly, and this is usually bad for servers. Most new cable modems are "locked" at 128k upstream bandwidth. This will limit you to 3-5 players. Also a number of cable providers do not allow servers for home use, and may have systems that would block a game server.
T1 or larger dedicated connection
This is almost always a corporate class internet connection. They almost always have the same speeds both upstream and downstream. These connections make the best servers that can host the most people. They also are the most expensive. BZFlag requires direct access to the computer that is hosting a server, so no, you can't run a server on your ISP's web host, even though they have a very very fast connection.
The last thing to think about in your networking set up is, do you have a firewall or router?
The server will need a direct port to the internet to listen for new players. Most systems these days have a firewall installed, or are behind a router, or internet sharing system. These systems will block all unknown incoming signals in an attempt to protect your computer. In the game's case you WANT the bzflag traffic to come in so you can host the game. For Firewalls this means opening up a hole in the firewall on the PORT you wish bzflag to use for your server. On a router, or internet sharing system, this means setting up a STATIC ROUTE (or PORT FORWARD), that tells the router not only what packets to let in, but what computer on your network to sent them to. The best way to find out how to do this is to read the manual and documentation on your router/firewall. You'll also need to know the administrative password to your router or firewall, so if you don't have access to it, you can forget about it. The default port for bzflag is 5154. This is the best port to start with.
The next thing to do is to decide how you want to run the server, and under what OS. The best public servers are online 24/7. This means they run on computers that are not restarted, and are generally not used for other intensive tasks. The most popular Operating System for servers is Linux. It offers great remote administration abilities, runs well on cheap hardware, and has a good uptime history. A few servers are running on Windows. Having less remote abilities, and a less stable uptime record means you may have to spend more time managing the server. Windows servers generally need to be restarted more frequently. The server will run on any OS that bzflag supports. Some OSs are more stable then others. A Linux server is generally going to be better than a Windows 95 server.
If you have got this far and are set to run a server, welcome to the world of hosting.
The program you need to run is called "BZFS" (or bzfs.exe on Windows), this stands for BZFlag Server. The program comes with every source release, and the Windows and Mac binary releases. Some Linux binary packages may not contain it, so you may need to download a separate "server" package (for debian-based distros in particular, bzflag-server is necessary). BZFS is a command line application, so it takes its parameters from a terminal (or "dos box" for you old school windows users).
Linux users should be very used to the command prompt. If you use Linux and are not, then you should probably learn a bit more about how your OS works.
On windows NT/2000/XP you can get to the command prompt by going to the START menu, choosing RUN, then type in CMD, then hit the OK button. This will bring up a black box with a command prompt in it. If you're running an older windows version, type COMMAND instead of CMD; you'll get a similar but less flexible command prompt.
On OSX you can bring up a terminal by going to the applications folder, then the Utilities folder, then choosing the "terminal" application. This will give you a UNIX type terminal shell.
Once you have a terminal up you need to "change directories" to the location where your bzfs is. This is done on all OSs with the "cd" command. But before you can do the cd command you need to know where the server is on your hard disk.
for Windows the default folder is
for Linux the default directory is
If one doesn't work, try the others.
for Mac OS X the default directory is usually
If you installed bzflag in a different directory or have a difrent version then you will need to modify the path to fit.
So to change to the bzflag directory you would execute the cd command followed by the directory you wish to change to.
On windows this would look like this;
*note* if you are on windows, and your command prompt started with a drive letter other then C, you will what to change to the C drive as well as doing the CD command. Just type "C:" then hit enter on the command prompt to do so (without the ").
Now you are ready to start your server. The BZFS server takes a large number of command line options that tell it what type of game to host. These options control things such as the number and types of flags that are in the game, if jumping is allowed, if the server is to be public or private, and almost all other aspects of the game. A full list of the bzfs command options is located here on the bzfs manual page.
There are two ways to give bzfs these options. One is directly on the command line, and the other is via a configuration file. The config file is the preferred method of running a server, since it saves the server options in a file so you don't have to retype them every time you start the server. The game does not come with a config, so you will need to create a config file. The config is simply a text file that you can name anything you want.
Open up your favorite text editor (for example, notepad on windows), and create a text file with the following sample config. This document will use this config for all of it's steps. At the end of the document there will be a section on adding and changing options, so don't worry if you don't like these settings, this is just to help you get started
Save this file under the name myconfig.txt in your bzflag install directory.
Now what this will do is start a public game, with 4 shots, jumping, teleporters, on a random map, with rico, and some super flags.
Start the server by executing the server from the command line:
If all has gone well you should see the startup text for a server. If there are any errors, recheck your config, and your directories to make sure you have them all correct.
Now don't close that terminal. The running server is tied to that terminal, we'll go over how to detach them later.
Start a copy of the bzflag client and join your new server. If everything has gone well then you should be able to join and play on your server. Ask some friends to join to make sure your server is public. Visit http://my.bzflag.org/db/?action=LIST and verify that your server is listed.
If your server is not listed as public, or if outside people can't get to your server, then you need to make sure you have opened up a hole in your FIREWALL (if you have one), or set a PORT FORWARD for port 5154. No players can come from outside until you do this.
That's it, you have a server. All other server options will follow the exact same process, you just change the options in the config and run it.
Additional reading on the subject can be found at the following URLs
BZFlag online help page: http://www.bzflag.org/wiki/GettingHelp
BZFlag online manual pages: http://my.bzflag.org/bzfman.cgi
www.sleepycows.org very nice VISUAL tutorial, for Windows XP
http://shellshock.bzflag.bz/ dutchrais BZFlag info and help site.
Common Questions and Problems:
How do I password protect my server?
add -password SOME_PASS_WORD to your config file, then in game you can use the /password command to register as an administrator.
On Linux, how can I make it so I can close the terminal?
The best way is to run bzfs in a screen session. If you have screen installed, just run screen, start bzfs, then hit CTRL + A + D to detach. You can then close the terminal and bzfs will still run. To get back to the running server, just run screen again with the -r parameter ( screen -r ) and you will reattach to the session.
How do I use a map file?
add -world "SOME_MAP_FILE" to your config with the full path to your map file (e.g. "C:\BZMaps\Map.bzw" If your map is a CTF map, then make sure you also have -c in your config to make it a CTF game, and also -fb if your map has bases that have thickness.
Authors
sid6.7
JeffM2501
DTRemenak
First things to ask yourself:
Are you ready to run a public server?
Do you have the bandwidth and computer speed/time to run a server?
Do you have the required computer knowledge to set up a server?
Do you have the time and/or administrators to properly maintain the server?
Running a public server is not a trivial task. It will take a significant amount of bandwidth, and dedicated computer time to run a server. At the current time (2/7/05) there are over 120 servers and over 200 players. The current ratio is about 1 server per 2 players. How will your server be different then these? What will draw people to your server rather than the others? These are all questions you should ask yourself.
The most popular public servers are on high speed internet connections, strongly administered, and use fun and exciting maps. While a 100 shot 'uber death' server may sound like a blast right now, the joy will wear off fast.
Bandwidth wise bzflag uses about 5kb per second per player. The more players that you have the more bandwidth you need. Public servers should always be on dedicated high speed internet connections, with large amounts of "upstream" or "sending" bandwidth. The server's job is to send data out to all the clients. The amount of data the server receives from other clients is a smaller percentage then the data it sends. The general idea is that a server multiplies any data sent to it, by sending it to every other player...so on a 5 player game, every message a player sends in, is sent out by the server 4 more times.
In general internet connections can be broken into the following categories
Dialup
This is a connection over a regular phone line using a regular old modem.
Dialup connections are limited to 3-4k per second transfer, which is very, very slow.
In general you do NOT want to run a server on this type of connection. You will be able to barely support a single player.
DSL (Digital Subscriber Line)
Most DSL systems these days are fast enough to run small servers of 4 - 6 players. DSL connections always have 2 speeds, one is the "downstream" and one is the "upstream". The downstream is almost always higher. The bigger your upstream is, the more players you can run.
Cable (Cable Modem)
Cable modems can offer a large amount of bandwidth, with some caveats. Cable modems are shared bandwidth. This means that you are not the only one using it. This can make your bandwidth fluctuate greatly, and this is usually bad for servers. Most new cable modems are "locked" at 128k upstream bandwidth. This will limit you to 3-5 players. Also a number of cable providers do not allow servers for home use, and may have systems that would block a game server.
T1 or larger dedicated connection
This is almost always a corporate class internet connection. They almost always have the same speeds both upstream and downstream. These connections make the best servers that can host the most people. They also are the most expensive. BZFlag requires direct access to the computer that is hosting a server, so no, you can't run a server on your ISP's web host, even though they have a very very fast connection.
The last thing to think about in your networking set up is, do you have a firewall or router?
The server will need a direct port to the internet to listen for new players. Most systems these days have a firewall installed, or are behind a router, or internet sharing system. These systems will block all unknown incoming signals in an attempt to protect your computer. In the game's case you WANT the bzflag traffic to come in so you can host the game. For Firewalls this means opening up a hole in the firewall on the PORT you wish bzflag to use for your server. On a router, or internet sharing system, this means setting up a STATIC ROUTE (or PORT FORWARD), that tells the router not only what packets to let in, but what computer on your network to sent them to. The best way to find out how to do this is to read the manual and documentation on your router/firewall. You'll also need to know the administrative password to your router or firewall, so if you don't have access to it, you can forget about it. The default port for bzflag is 5154. This is the best port to start with.
The next thing to do is to decide how you want to run the server, and under what OS. The best public servers are online 24/7. This means they run on computers that are not restarted, and are generally not used for other intensive tasks. The most popular Operating System for servers is Linux. It offers great remote administration abilities, runs well on cheap hardware, and has a good uptime history. A few servers are running on Windows. Having less remote abilities, and a less stable uptime record means you may have to spend more time managing the server. Windows servers generally need to be restarted more frequently. The server will run on any OS that bzflag supports. Some OSs are more stable then others. A Linux server is generally going to be better than a Windows 95 server.
If you have got this far and are set to run a server, welcome to the world of hosting.
The program you need to run is called "BZFS" (or bzfs.exe on Windows), this stands for BZFlag Server. The program comes with every source release, and the Windows and Mac binary releases. Some Linux binary packages may not contain it, so you may need to download a separate "server" package (for debian-based distros in particular, bzflag-server is necessary). BZFS is a command line application, so it takes its parameters from a terminal (or "dos box" for you old school windows users).
Linux users should be very used to the command prompt. If you use Linux and are not, then you should probably learn a bit more about how your OS works.
On windows NT/2000/XP you can get to the command prompt by going to the START menu, choosing RUN, then type in CMD, then hit the OK button. This will bring up a black box with a command prompt in it. If you're running an older windows version, type COMMAND instead of CMD; you'll get a similar but less flexible command prompt.
On OSX you can bring up a terminal by going to the applications folder, then the Utilities folder, then choosing the "terminal" application. This will give you a UNIX type terminal shell.
Once you have a terminal up you need to "change directories" to the location where your bzfs is. This is done on all OSs with the "cd" command. But before you can do the cd command you need to know where the server is on your hard disk.
for Windows the default folder is
Code: Select all
C:\Program Files\BZFlag2.0.0
for Linux the default directory is
Code: Select all
/usr/local/bin/ (if you installed from source)
or
/usr/bin/ (if you installed from an RPM)
or
/usr/games/ (most debian based distributions)
for Mac OS X the default directory is usually
Code: Select all
/Applications/BZFlag 2.0.10.app/Contents/osx/
So to change to the bzflag directory you would execute the cd command followed by the directory you wish to change to.
On windows this would look like this;
Code: Select all
cd C:\Program Files\BZFlag2.0.0\
Now you are ready to start your server. The BZFS server takes a large number of command line options that tell it what type of game to host. These options control things such as the number and types of flags that are in the game, if jumping is allowed, if the server is to be public or private, and almost all other aspects of the game. A full list of the bzfs command options is located here on the bzfs manual page.
There are two ways to give bzfs these options. One is directly on the command line, and the other is via a configuration file. The config file is the preferred method of running a server, since it saves the server options in a file so you don't have to retype them every time you start the server. The game does not come with a config, so you will need to create a config file. The config is simply a text file that you can name anything you want.
Open up your favorite text editor (for example, notepad on windows), and create a text file with the following sample config. This document will use this config for all of it's steps. At the end of the document there will be a section on adding and changing options, so don't worry if you don't like these settings, this is just to help you get started
Code: Select all
# tell the game to be public, and what text to use in the description field in the public list
-public "YOUR_NAME_HEREs simple tutorial server"
# allow for 4 shots at a time per tank
-ms 4
# allow jumping
-j
# allow teleporters
-t
# allow ricochet
+r
# add 1 shockwave flag
+f SW
# add 2 super bullet flags
+f SB{2}
# add a GM flag
+f GM
# add 3 stealth flags
+f ST{3}
# add in some debug logging flags to show status and any errors
-d
-d
-d
Now what this will do is start a public game, with 4 shots, jumping, teleporters, on a random map, with rico, and some super flags.
Start the server by executing the server from the command line:
Code: Select all
bzfs -conf myconfig.txt
Now don't close that terminal. The running server is tied to that terminal, we'll go over how to detach them later.
Start a copy of the bzflag client and join your new server. If everything has gone well then you should be able to join and play on your server. Ask some friends to join to make sure your server is public. Visit http://my.bzflag.org/db/?action=LIST and verify that your server is listed.
If your server is not listed as public, or if outside people can't get to your server, then you need to make sure you have opened up a hole in your FIREWALL (if you have one), or set a PORT FORWARD for port 5154. No players can come from outside until you do this.
That's it, you have a server. All other server options will follow the exact same process, you just change the options in the config and run it.
Additional reading on the subject can be found at the following URLs
BZFlag online help page: http://www.bzflag.org/wiki/GettingHelp
BZFlag online manual pages: http://my.bzflag.org/bzfman.cgi
www.sleepycows.org very nice VISUAL tutorial, for Windows XP
http://shellshock.bzflag.bz/ dutchrais BZFlag info and help site.
Common Questions and Problems:
How do I password protect my server?
add -password SOME_PASS_WORD to your config file, then in game you can use the /password command to register as an administrator.
On Linux, how can I make it so I can close the terminal?
The best way is to run bzfs in a screen session. If you have screen installed, just run screen, start bzfs, then hit CTRL + A + D to detach. You can then close the terminal and bzfs will still run. To get back to the running server, just run screen again with the -r parameter ( screen -r ) and you will reattach to the session.
How do I use a map file?
add -world "SOME_MAP_FILE" to your config with the full path to your map file (e.g. "C:\BZMaps\Map.bzw" If your map is a CTF map, then make sure you also have -c in your config to make it a CTF game, and also -fb if your map has bases that have thickness.
Authors
sid6.7
JeffM2501
DTRemenak