| Networking |
Doomsday 1.8.6 | Last updated on Jan 18 2005
|
Multiplayer Games With Doomsday
===============================
by Jaakko Keränen <skyjake@doomsdayhq.com>
04/02/2002
For version 1.6.0 of the engine;
see end of file for more info.
CONTENTS:
1. Using The GUI
2. Using The Console
3. "Net" Console Command
4. Troubleshooting
5. Tips
Using DirectPlay, the Doomsday engine is capable of multiplayer games
over the Internet, a local area network (LAN), a modem or a serial
link. This document describes how to use the Server and Client setup
screens and the "net" console command, which can also be used to setup
and configure network games.
Please make sure your DirectX drivers are recent enough (at least
version 6.0).
======================================================================
1. USING THE GUI
The graphical user interface provided by Doomsday offers a simple way
to host and join multiplayer games. It can usually be accessed via the
"Multiplayer" menu.
Use of the setup screens should be self-explanatory.
With TCP/IP, use port number zero. If you're behind a firewall, open a
port of your choice and set its number in the TCP/IP protocol setup
screen. Don't use the same port number that's used by the server you
will be connecting to, or the master server's port number (10123).
======================================================================
2. USING THE CONSOLE
OPERATING A NON-DEDICATED SERVER:
1. Configure the server by setting proper values for the console
variables "server-name", "server-info", "server-game-map",
"server-game-episode", "server-game-skill" etc.
2. Initialize the service provider, i.e. the network protocol.
First set the service provider's configuration variables, for
example TCP/IP's "net-ip-port". Then give the network
initialization command, for instance "net init tcpip".
3. Start the server with the command "net server start".
4. Use the command "setmap" to change the level at any time.
"setcolor" will change your player color. I'll let you guess
what "setname" does.
5. The command "net server close" will shut down the server and
disconnect all clients.
DEDICATED SERVERS:
You start a dedicated server by using the "-dedicated" command-line
option (more information about command line options in CmdLine.txt).
The game begins but all you'll see is a text mode representation of
the console. You can now start the server exactly like a non-
dedicated one, but you don't have to worry about your name and player
color because the server naturally hasn't got a player when running in
dedicated mode. You can place the init commands in autoexec.cfg for
convenience.
Note: Player limit is 15 on dedicated servers.
CLIENT MODE:
Connecting to a server as a client is quite straightforward. Before
doing anything it's a good idea to make sure your player name and
color are what you want them to be. You can use the commands "setname"
and "setcolor" even when off-line.
Notice that you can use your player number as a color if you do
"setcolor 4" (both Doom and Heretic have four player colors: 0-3).
Hexen has eight colors, so you'll need to use "setcolor 8". This means
your color will be chosen automatically following the same logic as in
the original Doom, Heretic and Hexen.
1. Set the protocol's configuration variables, for example
"net-ip-address" and "net-ip-port" with the TCP/IP protocol.
TCP/IP notes: The port should be zero if you're not behind a
firewall, or some specific port of your choice (you'll need to
open it) if you are behind a firewall. You can't use the same
port number as the server, nor can you use the master server's
port number 10123.
2. Initialize the protocol with the "net init (service)" command.
3. Issue the command "net search" as many times as it takes to see
the server you're looking for (usually two times).
4. "net connect (server number)" will connect you to the server.
5. "net disconnect" will disconnect you.
======================================================================
3. "NET" CONSOLE COMMAND
net init (service)
------------------
(service) is one of: tcpip (or tcp/ip), ipx, modem or serial.
Initializes the network driver for use with the specified service
provider. This command must be given before any of the other
network commands. To make things easier, you could for example
place a "net init ipx" in your autoexec.cfg so the IPX network
driver is automatically initialized when the Doomsday engine is
started.
If you want to change the service provider at runtime, you must
first use "net shutdown" and then initialize the provider you
want.
net shutdown
------------
Shuts down the network driver. You don't have to use this command
unless you mean to change the service provider at runtime.
net info
--------
Displays the current network settings along with some debug
information.
net modems
----------
If the Modem service provider is in use, this command displays a
list of available modems. Use "net modem (num)" to select one from
the list.
net tcpip address (addr)
------------------------
Before you can connect to a server using TCP/IP, you need to
specify the server's IP address. For example: "net tcp/ip address
127.0.0.1". The program winipcfg can be used to find out your own
IP address, if your computer is going to be a server (winipcfg
supposedly comes with Windows). If the IP address of the server
you frequently connect to doesn't change, it's good to place this
command into autoexec.cfg.
net tcpip port (num)
--------------------
If necessary, this command can be used to set the port to use when
connecting. Leave to zero if you know nothing about TCP/IP ports.
net modem (num)
---------------
Selects the active modem from the list displayed by "net modems".
You only need to issue this command if you're using the Modem
service provider.
net modem phone (num)
---------------------
Sets the phone number to dial to if connecting to a server using
the Modem service provider. You must set the phone number before
using the command "net servers".
net serial com (num)
--------------------
Sets the COM port to use with the Serial Link service provider.
Notice that usually this is the only config command you need to
give with the Serial Link service. The other settings are given
reasonable defaults when the service is initialized.
net serial baud (setting)
-------------------------
(setting) is one of: 110, 300, 600, 1200, 2400, 4800, 9600, 14400,
19200, 38400, 56000, 57600, 115200, 128000, 256000.
net serial stop (setting)
-------------------------
(setting) is 0-2:
0 = one stop bit
1 = 1.5 stop bits
2 = 2 stop bits
net serial parity (setting)
---------------------------
(setting) is 0-3:
0 = no
1 = odd
2 = even
3 = mark
net serial flow (setting)
-------------------------
(setting) is 0-4:
0 = no flow control
1 = software flow control (xon/xoff)
2 = hardware flow control with RTS
3 = hardware flow control with DTR
4 = hardware flow control with RTS and DTR
net search
----------
If you want to connect to a server and you have configured your
service provider with the necessary commands listed above, this
command lists all the servers that can be found. Unless you're
using the IPX service provider, there will be a slight delay
before this command gives you the server list because DirectPlay
has to first make the actual connection between the computers.
It's best to keep repeating this command until you see the server
you want.
net connect (server number)
---------------------------
Connects to the specified server. Only works after "net search"
shows the number of the server (usually zero).
net servers
-----------
Connects to the master server and retrieves a list of running
servers. You must set the console variable "net-master-address"
before you can use this command. "net-master-port" should be zero,
or a port of your choice (not 10123) if you're behind a firewall.
SailorSat's master server IP: 137.226.156.135
net mconnect (server number received from master)
-------------------------------------------------
Connects to the specified server. Only works after "net servers"
has successfully ended and the list of servers has been printed in
the console.
net players
-----------
When issued on the server, this command displays a list of all the
connected players. For clients this command just displays the name
of the server player and the client's own name.
net disconnect
--------------
Disconnects from the server you're currently connected to.
Automatically done when you return to the operating system. You
will naturally have to disconnect from a server if you want to
connect to another one.
net server start
----------------
If you want your computer to be a server, use this command after
initializing the network driver. It will start the game so other
players will be able to join.
The server is responsible for choosing the game specific
multiplayer settings, such as the map to play in. The server is
able to change the current map with the console command "setmap".
net server close
----------------
Stops the current game and disconnects all connected players.
======================================================================
4. TROUBLESHOOTING
** Clients can't find the server (TCP/IP).
Make sure the TCP/IP ports have been set correctly on both the
server and the client. They must NOT be using the same port
number! The exception is port zero, both the clients and the
server can use it. Note that if you're behind a firewall, it might
be blocking access to the ports DirectPlay uses by default, so
specifying a specific port on both the server and the client might
help. Again make sure different port numbers are used.
** Clients experience warping.
If the server is warping clients back and forth when the clients
move around, it might help to increase the maximum allowed
coordinate difference on the server. It is controlled with the
console variable "server-dif-max". Very large values (more than
128) should not be used.
** Gameplay is very lagged.
It might help to increase the value of the console variable
"server-frame-interval" on the server. Values from 1 to 3 should
still result in a playable game.
======================================================================
5. TIPS
MAP ROTATION:
Servers can set up a sequence of maps to cycle through
automatically. This is done by defining the cycling rules with the
console variable "server-game-mapcycle" and then, after starting
the server, issuing the command "startcycle". The command
"endcycle" ends map rotation.
Note: You must enclose a string in quotes if it contains spaces.
For example:
> server-game-mapcycle "F:10 22 23"
The cycling rules have a very simple format:
(rule)[,(rule)] (map) [(map) [...] ] [(rule) ... ]
(Brackets [ and ] enclose optional parts here.) (rule) can be
either "Frags:X" or "Time:X", where X is either the maximum number
of frags or maximum amount of time in minutes. The words "Frags"
and "Time" can be abbreviated down to one letter. The comma
between rules can be replaced with a semicolon, a plus character,
a forward slash or a backslash. Map numbers always consist of two
digits. Either or both digits of a map number can be replaced with
an asterisk (*), which makes the server replace it with a random
number.
It's not that difficult, really. Take a look at the examples:
"F:10 11 12 13 14 2* T:15,F:5 37"
The cycle consists of maps E1M1, E1M2, E1M3, E1M4, a random map
from the second episode and E3M7 (assuming this is not Hexen or
Doom II). For the first five maps the rule for changing the map is
a maximum of 10 frags. The last map (E3M7) will end when either 15
minutes has passed or someone gets 5 frags.
"Frag:5 ** 25 24 23 Tim:1 11"
The cycle consists of a completely random map, E2M5, E2M4, E2M3
and E1M1. The first four maps will end when someone gets 5 frags.
The last map (E1M1) ends after one minute of gameplay. The extra
spaces between the map numbers are ignored.
REMOTE ACCESS TO SERVER:
Clients are able to create a remote connection to the server's
console. The server can set a password with the console variable
"server-password".
When a client issues the "login" console command, a remote
connection is started. If the server has a password, it must be
given to "login" as an argument, for instance "login foobar".
After logging in any consequent commands are executed on the
server's console. The remote connection can be terminated with the
"logout" command.
KICKING CLIENTS OUT:
Servers can use the console command "kick" to get rid of unwanted
players. The number of the player to kick out is given as an
argument, for instance "kick 2". Player numbers can be found out
with the "net info" command.
USING DMASTER:
DMaster is a simple master server program that can be used to keep
track of all the running Doomsday servers on the Internet. Clients
can ask the master for a list of servers. Use the console
variables "net-master-address" and "net-master-port" to define the
master server's IP address and TCP/UDP port. Port number zero is
DirectPlay's autodetection port, it should work under most
conditions. Before starting a server, set the cvar "server-public"
to one to allow the server to inform the master of its existance.
After "net init (something)", clients can use the console command
"net servers" to send a server list request to the master. The
returned list of servers has indices, use "net mconnect (index)"
to connect to one of the listed servers.
======================================================================
The Doomsday engine is written by Jaakko Keränen, based on the source
code of Raven Software's Hexen 1.1. Many thanks to the fine folks at
Raven Software and id Software for releasing the source code.
http://www.doomsdayhq.com/
|