Soldier of Fortune Dedicated
Server Guide v1.3 (22/AUG/01)
The simplest way to start a dedicated server is to put “+set dedicated 1” on the command line of the sof.exe application. This will automatically run the dedicated.cfg file in the base folder.
If you do not wish to run dedicated.cfg, supply your own command line parameters or put “-nostart” on the command line.
There are sample files referred to in this document at http://www2.ravensoft.com/users/jscott/sof/base.zip - it is 20k long and all the paths are correct within the zipfile.
Key –
“cvar 0-2” – this means the cvar has a valid range between 0 and 2. 0, 0.5, 1, 1.5 and 2.0 are all valid values
“cvar 0/1” – this menas the cvar can have a value of 0 or 1 and no others.
“cvar 0-9999”means the cvar can have any value upto the practical limits of a float (1 x 10^38).
“command <required> [optional]” – this means the command must have the paramater(s) listed in <> and optionally may have the parameter(s) listed in [].
“cvar ?” means this doesn’t fit into the above categories.
“set public 0/1” – this means your server will not register with the GameSpy master server. Other people will not be able to see your server through the ingame browser or external server browsers. Use “set public 1” to make this happen.
“set deathmatch 1/2/3/4/5/6/7” – this sets the game to the regular every man for himself fragfest. Other settings are 2 for Assassin, 3 for Arsenal, 4 for CTF, 5 for Realistic, 6 for Control and 7 for Conquer (aka CTB).
“set hostname <name>” – this is the name of your server as appears in the server browsers.
“set welcome_mess <welcome message>” – this is the message every new player joining a game will see (it can be a maximum of 255 characters)
“set cheats 0/1” – disables cheats. Set to 1 if you wish to let players use cheat commands.
“set dmflags ?” – this configures certain aspects of the game; see later for details
“set maxclients 2-32” – only allow upto this many players at once on this server.
“set fraglimit 0-9999” – exit the current level should any one person reach this many kills. Set to 0 to disable this check.
“set timelimit 0-9999” – exit the current level should it have been running for this many minutes. Set to 0 to disable this check i.e. never timeout the level.
“set maxspectators 0-maxclients” – only allow upto this many spectators at any one time.
“set sv_reconnect_limit 3” – this is the minimum number of seconds between connection attempts. Used to prevent flooding with multiple connection attempts.
“set sv_suicidepenalty 0-9999” – penalty for blowing up oneself. This is to encourage players to be more careful with grenades, C4 and the rocket launcher.
“set g_movescale 0-1” – we like a really fast game. However, some other people do not. Use this setting to slow down the movement of players. A setting of 0.5 will make everyone move at exactly half speed.
“set sv_maplistfile <list file name>” – this is the file that contains the list of maps to run through. See later for details.
“map <mapname>” – this command starts the server with the above settings on the dm/nycdm1 map. When either the fraglimit or timelimit are hit for this map, it will go to the next map in the maplist file.
Additional Settings
“set ctf_loops 1-9999” – this is the number of flag captures before the map cycles.
“set ctf_control_delay_time 0-9999” – this is the number of seconds warmup for CTF, Control and Conquer.
“set control_limit 1-9999” – this is the number of points required to finish a control level.
“sv_gravity 0-9999” – this is the gravity used for the game (default 800). A number less than the default will let you jump higher, 0 being a weightless environment
“sv_enforcetime 0/1” – this disallows out of order client packets if set (I think). Out of order packets are a normal part of internet play, but could potentially be used for cheating.
Advanced Settings
“sv_max_ghoul_mp 100-9999” – this is the maximum size of a Ghoul network packet (default 200). This clamps the amount of networking data.
“sv_maxvelocity 1-9999” – this clamps the velocity of any player to this value no matter what (default 2000). This is so the networking works on consistent data. Increasing this could cause physics issues over the network.
“zombietime 0-9999” – when a client gets dropped (lagged out etc), the game continues to send messages to the client for this many seconds. This is to give the client one last chance to exit gracefully.
Team Selection
Teams are skin based. Players either belong to one of the predefined teams by skin (“The Order”, “Meatwagon”, “Ministry of Sin” etc), or they have no team affiliation and work as a team of their own (John Mullins and Hawk fall into this category). This means you can have many teams in a game at once; each which a completely different number of players. For CTF and Control this is capped to just two otherwise the game does not work.
Additionally, for Conquer you can set it to just red and blue teams (with a dmflag) where your skin does not decide which team you are on.
Bots
Commands -
“bot_add” adds a random bot.
“bot_remove” removes a random bot.
“bot_add <name>” adds the “name” bot
“bot_remove <name>” removes the “name” bot.
Cvars -
“bot_hunt 0/1” – if set, the bots keep chasing specific players
“bot_fillserv 0/1” – if set the game tries to keep server filled with number of bots equal to maxclients - numPlayers - 1
“bot_chat 0/1” – if set, the bots issue console messages
“bot_runtact 0/1” – if set, the bots can use grenades and C4
Bot personalities are defined in the bpf file in the “base/bot/bots” folder.
Here is bonesnapper.bpf
#hidebot personality file
userinfo=name\Bone Snapper\skin\bonesnapper
#Accuracy should range from 1 to 180
accuracy=70
#FOV uses the same range as the player's
fov=95
#Degrees to turn toward destination per frame
turning_speed=18
#Limit for distance vision
view_distance=4096
#General intelligence level for making decisions and other things
general_intelligence=3
#Tells if bot will be able to chat or not
canchat=0
….as you can see, they are well commented. If you wish to make your own, just create a new bpf file, add its name to the “base/bot/botlist.txt” file and everything should be automatic from there. You can browse through the various features of the bots on the start server menu.
Bots work somewhat in all gametypes, however, they only work well in standard deathmatch and arsenal.
Map Lists
There are several maplists that define which maps are cycled through in a multiplayer game.
Here is the first part of RavDM.lst
dm/nycdm1 "Warehouse: 8 to 16 players"
dm/nycdm2 "Underground: 4 to 6 players"
dm/nycdm3 "Pawn Shop : 2 to 4 players"
dm/nycdm4 "Back Alley: 2 to 4 players"
dm/nycdm5 "Bunker: 2 to 5 players"
Basically, use this format …..
<bsp filename in base\maps> <name that appears in menu>
…and define one map per line. It will cycle through all the maps and loop forever. The game scans the “base\maplists” folder for all files the “lst” extension and parses then into the menus. Have a play with the map list file option in the start multiplayer game menu to see what I mean. If you want to add your own maplist file, put one in the “user/maplists” folder; the game (and the menus) should automatically find it.
Game Logging
“log_file_name <name>” – if this is set to a none null string (ie. There is a name), the game stats will be logged to a file.
“log_file_counter 0/1” – this keeps track of the number of levels played. If it is 0 (zero) then it will not be used. If it is 1 or more, it will append itself to the logfile name each complete level and increment itself by one. Eg. Set log_file_counter to 1 and log_file_name to “log.txt. The first level will output as log1.txt, the second level as log2.txt etc.
“log_file_mode o/a” – if this of “o” (the letter) then the logfile will overwrite itself each level. If it is anything else, then the information will be appended to the log file.
“log_file_header <string>” – this is a string output once per level at the beginning of the file.
“log_file_footer <string>” – this is a string that ends a file.
“log_file_line_header <string>” – this is a string that goes before each line that is output.
If you set “log_file_header” to “<html>” and “log_file_footer” to “</html>” you’ll get what we are aiming for here. The game only logs the final result of the game, it does not log every obituary message. It writes to the log file when the final scoreboard message is sent.
Firewall Issues/Advanced Networking
A SoF server uses port 28910 to talk to the internet. This can be overridden with a “+set hostport x” on the command line.
GameSpy uses a single port from 28911 to 28915. If the first one is free, then it will use that. The range of ports can be overridden with “+set gamespyport x” on the command line. It will search upto 5 ports for a free one from x.
Unblock these UDP ports in your Firewall for both incoming and outgoing traffic. If you have a NAT table, forward packets on these ports to your server machine.
If you run more than one server on a machine, then you will have to set the “hostport” for the 2nd or more server. You can run upto 5 before GameSpy runs out of ports to work with. If anyone wishes to run more than 5 servers on one machine, please let us know and we’ll increase these numbers.
“noudp 0/1” – this disables internet play. UDP is a quick unreliable protocol on which the slower (but reliable) TCP is built upon.
“noipx 0/1” – this disables LAN play. IPX is a simple protocol used for small local networks.
“ipxfix 0/1” – Not sure. Apparently NT machines have a problem with IPX broadcasts which this works around.
“ip_list” – a computer can have more than one IP (Internet Protocol Address). This command lists all the available ones. It also works out which are external (global; can be seen from elsewhere) and local (such as from a DHCP server; normally beginning with 192.168.0.? or 172.16.?.?)
“net_mainip” – No clue.
“net_socksEnabled 0/1” – to enable use of a SOCKS5 server to talk to the outside world.
“net_socksServer <ip>” – this is the IP of the server that is physically connected to the internet.
“net_socksPort <port>” – the port used by the SOCKS5 server (normally 1080)
“net_socksUsername <name>” – Username and password for the SOCKS5 server.
“net_socksPassword <password>”
“net_sendrate 0-1” and “net_receiverate 0-1” are settings used to simulate internet packetloss on a LAN. Setting “net_sendrate” to 0.33 will not send a random two thirds of packets; setting “net_receiverate” to 0.66 will fail to receive one third of packets.
Deathmatch Flags
Use the set_dmflags, unset_dmflags and list_dmflags commands to change these settings in game. Some flags are only relevant to certain gametypes; this is catered for in the commands.
Key
1 – always set to 1 for this gametype
0 – always set to 0 for this gametype
? – modifiable for this gametype
X – irrelevant to this gametype
Flag |
Name |
Description |
DM |
Assassin |
Arsenal |
CTF |
Real |
Control |
CTB |
Bit |
1. |
No Health |
No health pickups are spawned if this flag is set |
? |
? |
? |
? |
0 |
? |
? |
1 |
2. |
No Items |
No inventory items appear if this flag is set (goggles, medkit, grenade, flashpak etc.) |
? |
? |
? |
? |
0 |
? |
? |
2 |
3. |
Weapons Stay |
Weapons do not disappear after they are pickup up |
? |
? |
X |
? |
0 |
? |
? |
4 |
4. |
No Falling Damage |
No player takes any damage from falling; no matter how far they fall |
? |
? |
? |
? |
0 |
? |
? |
8 |
5. |
Realistic Damage |
Many minor gameplay tweaks to make the game more real. |
? |
? |
? |
? |
1 |
? |
? |
16 |
6. |
Same Level |
Play the same level over and over again |
? |
? |
? |
? |
? |
? |
? |
32 |
7. |
No weapon reload |
All weapons reload instantly |
? |
? |
1 |
? |
0 |
? |
? |
64 |
8. |
Teamplay |
The players in the game must be on teams. Teams are skin based |
? |
0 |
0 |
1 |
? |
1 |
? |
128 |
9. |
No Friendly Fire |
Players from your team cannot damage you |
? |
X |
X |
? |
0 |
? |
? |
256 |
10. |
Force Respawn |
Forces an instant respawn on death; players cannot lay dead for any length of time |
? |
? |
? |
? |
? |
? |
? |
512 |
11. |
No Armor |
Armor is not spawned in the level |
? |
? |
? |
? |
? |
? |
? |
1024 |
12. |
Infinite Ammo |
All weapons have infinite ammo and never need reloading. This also suppresses the spawning of ammo pickups. |
? |
? |
1 |
? |
0 |
? |
? |
2048 |
13. |
Spinning Weapons |
All weapon pickups spin in an upright position. This makes them easier to see |
? |
? |
X |
? |
? |
? |
? |
4096 |
14. |
Bullet Only |
Only have bullet based weapons; no rocket launcher, slug thrower, flame thrower or MPG |
? |
? |
X |
? |
? |
? |
? |
8192 |
15. |
Force Join |
Players who join have no choice in their team selection |
0 |
X |
X |
? |
X |
? |
? |
16384 |
16. |
Team red/blue |
Set this to have regular red/blue team selection as opposed to skin based |
0 |
X |
X |
0 |
0 |
0 |
? |
32768 |
You can also set the bit fields directly in the dmflags cvar – pick the flags you want and add them together. So “No Falling Damage” + “No Armor” + “Bullet Only” would be “8 + 1024 + 8192”. So “set dmflags 9224” would set the 3 flags.