Multiplayer

Aaron van Geffen edited this page Aug 12, 2018 · 27 revisions

Something to note: multiplayer is a relatively new feature, and still contains a good deal of bugs. You're very likely to encounter them. If that happens, please report it if it hasn't been reported already, and please say if the bug only occurs on multiplayer games.

OpenRCT2 now has initial support for co-op multiplayer. You can use or test it by clicking the "Multiplayer" button in the Main Title.

Starting the server

To start the built-in server, click "Multiplayer" from the Main Title of OpenRCT2, and then select "Start Server". Specify the save that you want to host in the "Load Save" window to finish the start. The default port for OpenRCT2 is 11753 (TCP), this can be changed by manually editing the config file in your OpenRCT2 user directory.

In order for the server to successfully accept clients, the port must be open for the server's own firewall and any router's firewall the computer is behind. Additionally if the server is behind a router with NAT enabled, the router must be configured to have the port forwarded to the server's local address.

You can also launch a server by command line, e.g.

openrct2 host <saved game path> --port 22050

Dedicated server

OpenRCT2 also supports a headless mode where the game will run as a console application with no UI. This is useful for running dedicated game servers. This can be launched by the following command line:

openrct2 host <saved game path> --port 11753 --headless

Alternatively, on Linux, the openrct2-cli binary may be used:

openrct2-cli host <saved game path> --port 11753

Additional arguments:

Argument Variable Description
--headless N/A Runs OpenRCT without graphical interface
--port Port number Changes the server port number
--user-data-path Path to directory containing config.ini Changes the server configuration data path
--password Password to set Sets the server password
--verbose N/A Output additional information to the console
--help N/A Prints out help for CLI

Running as a service on Linux with systemd

To have an always-on server, OpenRCT2 needs to be run as a service. Create the file /etc/systemd/system/openrct2.service and change it where needed:

[Unit]
Description=OpenRCT2 server instance
After=network.target

[Service]
ExecStart=<path_to_openrct2-cli> host "<path_to_saved_game>" --headless

Type=simple
User=<username>
Group=<groupname>

[Install]
WantedBy=multi-user.target

Reload the systemd daemon:

systemctl daemon-reload

Enable the service:

systemctl enable openrct2.service

Start the service:

systemctl start openrct2.service

Starting the client

To connect to a server, click "Multiplayer" from the Main Title of OpenRCT2, and then select the server. If the server is not on the list, click "New Server", and enter the IP/hostname of the server. After that, click on the entry to connect the server. If the server is not running on the default port, you can specify that after the IP address, e.g. 127.0.0.1:22050.

To connect to a server by command line with the IP address 192.168.1.102 and listening on port 22050 in command prompt, type the following command (replace with the actual values of the server you want to connect to):

openrct2 join 192.168.1.102 --port 22050

Permissions

See https://github.com/OpenRCT2/OpenRCT2/wiki/Multiplayer-permissions

Desynchronisation

For a list of causes, see here: https://github.com/OpenRCT2/OpenRCT2/wiki/Multiplayer-issues

In order for network games to be reliable, they must stay synchronised. This works by each client always running the game slightly later than the server and never overtake its number of game ticks. When a player sends a game action (e.g. placing a path or opening a ride) - the action is sent to the server. The server then sends the action to all the clients - the clients then all run the action on precisely the same game tick as the server. So long as the game logic is deterministic, the games remain synchronised down to every peep position.

Currently there are still bugs relating to the initial connection setup and some of the user actions which cause the game state to diverge between the server and the client. If the client detects that its game state is not the same as the server, it will automatically disconnect. The client is able to reconnect to the server if this happens.

If you would like to ignore de-synchronisation for testing purposes, you can enable the "stay connected" option in the options dialog. Warning: doing this can lead to strange side effects.

Alternatively set the following configuration option as a client in your config.ini file. This will alert you when the game has desynchronised but keep the connection open so you can still play.

[network]
stay_connected = true

Server List API

Available at https://servers.openrct2.io

Request:

GET HTTP/1.1
Host: servers.openrct2.io
Accept: application/json

Response:

{
    "status": 200,
    "servers": [
        {
            "name": "Server Name",
            "description": "Description of the server...",
            "version": "0.0.3",
            "players": 3,
            "maxPlayers": 16,
            "port": 11753,
            "ip": {
                "v4": [
                    "80.12.231.106"
                ],
                "v6": [
                    "2001:0:9e18:6ac8:34:23be:ad67:7c52"
                ]
            },
            "requiresPassword": false,
            "supportsIPv4": true,
            "supportsIPv6": true,
            "serverId": 390,
            "gameInfo": {
                "guests": 1520,
                "month": 46,
                "day": 44564,
                "cash": 5969616,
                "parkValue": 1399430,
                "mapSize": 126
            },
            "customGI": {
                "month": "September",
                "day": "21st",
                "year": 5,
                "cash": "596,961",
                "parkValue": "139,943",
                "guests": "1,520"
            },
            "provider": {
                "website": "https://myopenrct2server.net",
                "email": "support@myopenrct2server.net",
                "name": "MyOpenRCT2 Server"
            }
        }
    ]
}
Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.