-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Multiplayer
OpenRCT2 has support for co-op multiplayer. It can be accessed by clicking the "Multiplayer" button in the Main Title.
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 11753
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 OpenRCT2 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. |
The quickest way to setup permissions as of v0.2.7, is for you to join the server from a client and then on the dedicated server's STDIN terminal, and then change yourself to 'admin' role. Executing network.players
in the terminal will print information about all the players connected to the server. Typically you would be the first user to join, so you will like be player index 1. You can change your player group to admin by running:
network.players[1].group = 0
Now you can make further changes to the permissions using the client as you will be admin.
You can modify other aspects of the server using the scripting API: https://github.com/OpenRCT2/OpenRCT2/blob/develop/distribution/openrct2.d.ts
One of the easiest ways to get a dedicated server up and running, is by using the official Docker container: https://github.com/OpenRCT2/openrct2-docker
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
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, run the following command (replace with the actual values of the server you want to connect to):
openrct2 join 192.168.1.102 --port 22050
For a list of causes, see 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 desynchronisation 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
- Home
- FAQ & Common Issues
- Roadmap
- Installation
- Building
- Features
- Development
- Benchmarking & stress testing OpenRCT2
- Coding Style
- Commit Messages
- Data Structures
- CSS1.DAT
- Custom Music and Ride Music Objects
- Game Actions
- G1 Elements Layout
- game.cfg structure
- Maps
- Music Cleanup
- Objects
- Official extended scenery set
- Peep AI
- Peep Sprite Type
- RCT1 ride and vehicle types and their RCT2 equivalents
- RCT12_MAX_SOMETHING versus MAX_SOMETHING
- Ride rating calculation
- SV6 Ride Structure
- Settings in config.ini
- Sizes and angles in the game world
- Sprite List csg1.dat
- Sprite List g1.dat
- Strings used in RCT1
- Strings used in the game
- TD6 format
- Terminology
- Track Data
- Track Designs
- Track types
- Vehicle Sprite Layout
- Widget colours
- Debugging OpenRCT2 on macOS
- OpenGL renderer
- Overall program structure
- Rebase and Sync fork with OpenRCT2
- Release Checklist
- Replay System
- Reverse Engineering
- Using minidumps from crash reports
- Using Track Block Get Previous
- History
- Testing