Questions regarding the multiplayer aspect of OpenTTD, e.g. joining the server, creating the server, playing the game.
How many players can join an OpenTTD game?
- Up to 255 players can participate in a multiplayer game. You can only open up 15 companies though. Each player can either play his own company, join another company (Cooperative gameplay) or watch a game (Spectator mode).
How do I start a multiplayer game?
- You can either do that through the Multiplayer or by using the following command line syntax:
openttd -n IP[:port][#CompanyID]
Example:
openttd -n 192.168.0.1:3979#1
would connect to 192.168.0.1 on port 3979 and join company 1.
Does it work cross-platform?
- Yes. You could, for example, start a server on MacOS and players using Windows, Linux or any other system can join.
What port does OpenTTD use?
- The default port is 3979, but you can change it to anything you like when you start a server. If you set up your own server behind a router, you need to forward both TCP and UDP on that port if you want people to be able to connect via Direct IP.
- If you are starting a server with 12.0 or newer, you don't need to forward any ports; the connection logic is automatically taken care of.
- Communication with the Game Coordinator works via port 3979 over UDP (inbound + outbound) and 3978 over UDP (outbound)
- If you are joining a server, you do not need to forward any ports, as connections are outbound only.
Can I use a Dedicated Server to host a Game?
-
It is possible to run a Dedicated Server using the '
-D
' switch. See "Dedicated Server" for more details.
-
It is possible to run a Dedicated Server using the '
How much bandwidth does the game use?
- The rate is approximately 1.5 kilobytes per second (KB/s) upload and 1.5 KB/s download per client. Multiplying that up, a 10-player server will use approximately 15 KB/s up and 15 KB/s down (the exact numbers will depend on the number of retransmissions etc.). Therefore, a 10-player, 24/7 server will consume 60 GB per month (30 GB down and 30 GB upload) of bandwidth if all 10 players are connected the whole month. For one client, connecting to a server, for an hour game, it will consume around 5-8 MB bandwidth, plus whatever you need to download.
-
Actual bandwidth usage may vary based on the number and activity of connected clients, as well as
frame_freq
andsync_freq
.
People get disconnected while joining, how to fix that?
When a new player connects, he needs to download the entire map. If you disabled pause_on_join, the game continues meanwhile. By the time he has finished, he thus needs to catch up with the changes made since the start of the download. Obviously, a new player needs to have a fast enough connection (and machine), otherwise he will take forever to catch up.
To give you control over how long this may take, the following variables can be set:
Variable | Values | Meaning |
---|---|---|
max_join_time | 0-32000 | Maximum amount of time, in game ticks, a client may take to sync up during joining. |
pause_on_join | true/false | Pause the game when people join. |
max_download_time | 0-32000 | Maximum amount of time, in game ticks, a client may take to download the map. |
max_password_time | 0-32000 | Maximum amount of time, in game ticks, a client may take to enter the password. |
max_lag_time | 0-32000 | Maximum amount of time, in game ticks, a client may be lagging behind the server. |
Note that all values are in game ticks, that is, 1/74th of a game day (1/33.33 of a second).
Increase the values until your users can connect normally. If you set them too long however, there is an increased danger that people take too long to connect, and just waste bandwidth.
For larger maps, it is highly recommended to enable pause_on_join, as it eliminates the need to catch-up with the game after map downloading.
I am having trouble with cheating. Help!
- There is a guide to shielding yourself from the worst elements of Multiplayer cheating. Also, check the Multiplayer Rules.
Are there any rules?
- There are some rules, yes. You can see the article Multiplayer Rules. However, the servers are not run by the OpenTTD Team, and they have no control over them what-so-ever. As such if you have any problems you should contact the person who runs the server.
Can console commands be executed automatically?
- Yes, this is possible, and can be pretty handy. The page Running Startup Scripts will explain this in more detail.
I started a new server. However, my game doesn't show up in my friends' game list, even after inserting the server manually on the list. Why does this happen?
- There seems to be a problem when starting a new server from a computer connected to Internet via a router, you can fix this by forwarding port number 3979, both UDP and TCP.
What is a desync error?
- See Desync error.
My NewGRFs are not appearing at my server
Best approach is to use a normal desktop game to construct a configuration file, and then copy that file with the NewGRFs to your server. Some things to watch out for:
- Don't copy the config file while the server is running (OpenTTD writes its config file on exit by default, overwriting the just copied file).
- Fix the paths of the NewGRFs, \ is not a directory separator at a Unix system.