
Doomsday Networking
===================
(for version 0.99.1 of the engine)


USING THE "NET" CONSOLE COMMAND

    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 "net" console
    command that can be used to setup and configure network games. 
    
    Please make sure your DirectX drivers are recent enough (at least
    version 6.0).

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 to 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 servers
-----------
    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 (servername)
------------------------
    Connects to the specified server. Only works after "net servers"
    shows the name of the server.
    
    When you connect to a server, you'll first enter "limbo" mode.
    It's a sort of a waitroom where players first gather before a
    actual multiplayer game can be started. Being in limbo mode
    doesn't affect normal single player gameplay.

net players
-----------
    Once connected, this command displays a list of all the players on
    the server. The "chat" command can be used to converse while in
    limbo mode or during a multiplayer game, for example: "chat nice
    to see you guys!".

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 open
---------------
    If you want your computer to be a server, use this command after
    initializing the network driver. It opens the server in limbo mode
    so players can enter and chat. 
    
    The server is responsible for choosing the game specific
    multiplayer settings, such as the map to play in (the cvar "n_map"
    with JHexen).

net server go/start
-------------------
    Once all the players have connected, the actual game can be begun
    with this command. Only the server can start the game.

net server stop
---------------
    Stops the current game and returns all connected players to limbo
    mode, where another game can be set up and begun. This is
    necessary if you for example want to change the map to play in or
    the players want to change their colors.

net server close
----------------
    Closes the server and disconnects all players. Automatically done
    when you return to the operating system.


EXAMPLE

Using TCP/IP with JHexen
------------------------
    Setting up the server:
        
        n_plrname (myname)        
        n_servername (servername)
        n_serverinfo (server description)
        net init tcp/ip
        net server open
        
    A client:    
    
        n_plrname (myname)
        n_color (0-7)
        net init tcp/ip
        net tcpip address (server's IP address)
        net servers
         :
        net connect (servername)
        
    Game setup on the server:
    
        n_map (num)
        n_skill (level)
        deathmatch (0-1)
        net server go
        
  
NETWORKING MODELS

    The Doomsday engine supports two networking models: peer-to-peer
    and client/server. In the current implementation they don't differ
    much, but there may be situations where using one model is better
    than the other. The model to use is chosen with the "n_model"
    console variable. It's very important to notice that the server
    and all the clients must be using the same model to make things
    work properly.
    
    In essence, Doomsday's networking model only affects the way data
    is exchanged between the server and the clients. 
    
    The default model, client/server, is basically only a simulation
    of a true client/server model, where the game is totally
    controlled by the server and the clients are only the players'
    "windows" to the game world. Because the Doom engine was designed
    exclusively for peer-to-peer networking, it is also the basic
    underlying model that's used in Doomsday. In a peer-to-peer system
    all the connected computers maintain their own game world.
    Considerable effort is made to keep all the computers
    synchronized, so that game events are the same for everybody. Each
    player informs the others about his actions by sending out
    information packets called ticcmds (tick commands). The difference
    between Doomsday networking models is in the way these ticcmds are
    exchanged between the computers. In the peer-to-peer model each
    computer sends ticcmds to each of the other computers, while in
    the client/server model clients send ticcmds to the server, which
    then distributes them to the other clients.

    Because of the underlying Doom peer-to-peer networking, the game
    can only progress when all the connected computers have reached
    the same game state (or rather, time). This means that if the
    connection between any two of the computers is slow, the
    corresponding slowness is perceived by all connected players. This
    is where the client/server model has an advantage: it may well be
    that maintaining a client-server connection is faster than several
    client-client connections. But there is real advantage only when
    the server has a good connection with all the clients.
    
    When using the IPX, modem or serial link service provider, the
    networking model has no large impact on performance. IPX networks
    are fast enough for both models, and modem and serial games can
    only have two players, so in practice there is no difference in
    the way data is exchanged no matter the networking model. But when
    playing over the Internet, the client/server model is the
    recommended one for games with more than two players.
    

---------------
3/4/2000
Jaakko Kernen 
<doomsday@jaakkok.pp.fi>

The Doomsday engine is written by Jaakko Kernen, based on code
extracted from 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.raven-games.com/jhexen
