Translations update
[openttd/fttd.git] / docs / multiplayer.txt
blob7f4227cd8a5a227549f65349a39f8cf5961cd6a2
1 Multiplayer manual for OpenTTD
2 Last updated:    2011-02-16
3 ------------------------------------------------------------------------
6 Table of contents
7 -----------------
8 1.0) Starting a server
9 2.0) Connecting to a server
10  * 2.1) Connecting to a server over the console
11 3.0) Playing internet games
12 4.0) Tips for servers
13  * 4.1) Imposing landscaping limits
14 5.0) Some useful things
15 6.0) Troubleshooting
18 1.0) Starting a server
19 ---- -----------------
20  - Make sure that you have your firewall of the computer as well as possible
21    routers or modems of the server configured such that:
22    * port 3979 is free for both UDP and TCP connections in- and outgoing
23    * port 3978 is free outbound for UDP in order to advertise with the master
24      server (if desired). Otherwise you'll have to tell players your IP.
25    * port 3977 if use of the admin interface is desired (see admin_network.txt)
26  - Click "multiplayer" on the startup screen
27  - Click "start server"
28  - Type in a game name
29  - Select the type of game ('LAN/Internet' or 'Internet (advertise)'. With the
30    last one other people are able to see you online. Else they need your IP and
31    port to join)
32  - Click "start game", "load game" or "load scenario"
33  - Start playing
36 2.0) Connecting to a server
37 ---- ----------------------
38  - Click "multiplayer" on the startup screen
40  - If you want to connect to any network game in your LAN click on 'LAN', then
41    on 'Find Server'
42  - If you want to see which servers all online on the Internet, click on
43    'Internet' and 'Find Server'
45  - If there were more than one server
46    - select one in the list below the buttons
47    - click on 'join game'
49  - If you want to play and you have the ip or hostname of the game server you
50    want connect to.
51    - click add server
52    - type in the ip address or hostname
53    - if you want to add a port use :<port>
55  - Now you can select a company and press: "Join company", to help that company
56  - Or you can press "Spectate game", to spectate the game
57  - Or you can press "New company", and start your own company (if there are
58    slots free)
60  - You see a progressbar how far you are with joining the server.
62  - Happy playing
64 2.1) Connecting to a server over the console
65 ---- ---------------------------------------
66  - Open the console and type in the following command:
67     connect <ip/host>:<port>#<company-no>
70 3.0) Playing internet games
71 ---- ----------------------
72  - Servers with a red dot behind it have a different version then you have. You
73    will not be able to join those servers.
75  - Servers with a yellow dot behind it have NewGRFs that you do not have. You
76    will not be able to join those servers. However, via "NewGRF Settings" and
77    "Find missing content online" you might be able to download the needed
78    NewGRFs after which you can join the server.
80  - It can happen that a connection is that slow, or you have that many clients
81    connected to your server, that your clients start to loose their connection.
82    Some things you can do about it:
83    - [network] frame_freq:
84      change it in console with: 'set network.frame_freq <number>'
85      the number should be between the 0 and 10, not much higher. It indicates
86      the delay between clicking and showing up. The higher, the more you notice
87      it, but the less bandwidth you use.
88      A good value for Internet-games is 2 or 3.
90    - [network] sync_freq:
91      change it in console with: 'set network.sync_freq <number>'
92      the number should be between the 50 and 1000, not much lower, not much
93      higer. It indicates the time between sync-frames. A sync-frame is a frame
94      which checks if all clients are still in sync. When the value it too high,
95      clients can desync in 1960, but the server detects it in 1970. Not really
96      handy. The lower the value, the more bandwidth it uses.
98    NB: changing frame_freq has more effect on the bandwidth then sync_freq.
101 4.0) Tips for servers
102 ---- ----------------
103  - You can launch a dedicated server by adding -D as parameter.
104  - In UNIX like systems, you can fork your dedicated server by adding -f as
105    parameter.
107  - You can automaticly clean companies that do not have a client connected to
108    them, for, let's say, 3 years. You can do this via: 'set autoclean_companies'
109    and 'set autoclean_protected' and 'set autoclean_unprotected'. Unprotected
110    removes a password from a company when it is not used for more then the
111    defined amount of months. 'set autoclean_novehicles' can be used to remove
112    companies without any vehicles quickly.
114  - You can also do this manually via the console: 'reset_company'.
116  - You can let your server automaticly restart a map when, let's say, year 2030
117    is reached. See 'set restart_game_date' for detail.
119  - If you want to be on the server-list, enable Advertising. To do this, select
120    'Internet (advertise)' in the Start Server menu, or type in console:
121    'set server_advertise 1'.
123  - You can protect your server with a password via the console: 'set server_pw',
124    or via the Start Server menu.
126  - When you have many clients connected to your server via Internet, watch your
127    bandwidth (if you have any limit on it, set by your ISP). One client uses
128    about 1.5 kilobytes per second up and down. To decrease this amount, setting
129    'frame_freq' to 1 will reduce it to roughly 1 kilobyte per second per client.
131  - OpenTTD's default settings for maximum number of clients, and amount of data
132    from clients to process are chosen to not influence the normal playing of
133    people, but to prevent or at least make it less likely that someone can
134    perform a (distributed) denial-of-service attack on your server by causing
135    an out-of-memory event by flooding the server with data to send to all
136    clients. The major factor in this is the maximum number of clients; with
137    32 clients "only" sending one chat message causes 1024 messages to be
138    distributed in total, with 64 clients that already quadruples to 4096. Given
139    that upstream bandwidth is usually the limiting factor, a queue of packets
140    that need to be sent will be created.
141    To prevent clients from exploiting this "explosion" of packets to send we
142    limit the number of incoming data, resulting in effectively limiting the
143    amount of data that OpenTTD will send to the clients. Even with the default
144    limits it is possible to generate about 70.000 packets per second, or about
145    7 megabit per second of traffic.
146    Given that OpenTTD kicks clients after they have not reacted within about 9
147    seconds from sending a frame update packet it would be possible that OpenTTD
148    keeps about 600.000 packets in memory, using about 50 megabytes of memory.
149    Given that OpenTTD allows short bursts of packets, you can have slightly
150    more packets in memory in case of a distributed denial of service attack.
151    When increasing the amount of incoming data, or the maximum number of
152    clients the amount of memory OpenTTD needs in case of a distributed denial
153    of service attack is linearly related to the amount of incoming data and
154    quadratic to the amount of clients. In short, a rule of thumb for, the
155    maximum memory usage for packets is:
156        #max_clients * #max_clients * bytes_per_frame * 10 KiB.
158 4.1) Imposing landscaping limits
159 ---- ---------------------------
160  - You can impose limits on companies by the following 4 settings:
161    - terraform_per_64k_frames
162    - terraform_frame_burst
163    - clear_per_64k_frames
164    - clear_frame_burst
166  - Explaining 'per_64K_frames' and 'burst'
167     - 'burst' defines 3 things, the maximum limit, the limit of a single action,
168       and the initial value for the limit assigned to a new company.
169       This setting is fairly simple and requires no math.
171       A value of 1 means a single tile can be affected by a single action.
172       This results in having to click 400 times when wanting to cover an area
173       of 20 x 20 tiles.
175       The default value 4096 covers an area of 64 x 64 tiles.
177     - 'per_64k_frames' defines the number of tiles added to each companies limit
178       per frame (however not past the possible maximum value,the 'burst').
179       64k rather resembles the exact number of 65536 frames. So setting this
180       variable to 65536 means: 65536 / 65536 = 1 tile per frame.
181       As a day consists of 74 frames, a company's limit is increased by 74
182       tiles during the course of a single day (2.22 seconds).
184       To achieve a 1 tile per day increase the following calculation is needed:
185       1 / 74 (frames per day) * 65536 (per_64k_frames) = 885.62...
186       after rounding: a value of 886 means adding a bit over 1 tile per day.
188       There is still enough space to scale this value downwards:
189       decreasing this value to 127 results in a bit over 1 tile added to the
190       allowance per week (7 days).
192       To create a setup in which a company gets an initial allowance only,
193       set the value to 0 - no increase of the allowance per frame.
195  - Even though construction actions include a clear tile action, they are not
196    affected by the above settings.
199 5.0) Some useful things
200 ---- ------------------
201  - You can protect your company so nobody else can join uninvited. To do this,
202    set a password in your Company Screen
204  - You can give other players some money via the ClientList (under the 'head'
205    in the mainbar).
207  - You can chat with other players via ENTER or via SHIFT+T or via the ClientList
209  - Servers can now kick players, so don't make them use it!
212 6.0) Troubleshooting
213 ---- ---------------
214  - My advertising server does not show up in list at servers.openttd.org
215      Run openttd with the '-d net=2' parameter. That will show which incoming
216      communication is received, whether the replies from the master server or
217      communication from an admin tool reach the programme. See section 1
218      'Starting a server' further up for the ports and protocols used by OpenTTD.
219      The ports can be configured in the config file.