Skip to content

OpenRCT2

OpenRCT2 is an open-source re-implementation of RollerCoaster Tycoon 2 (RCT2), expanding the game with new features, fixing bugs and raising game limits.

egg-openrct2.json

updated

Ports

Add an allocation on the node for each port.

  • Game 11753

Install

Installer image
debian:bullseye-slim
Install script
113 lines

Image

  • Debian ghcr.io/ptero-eggs/yolks:debian

Startup

The Panel runs this command to start the server. It replaces each variable in the command with the value of that variable.

19 variables

Startup command

./OpenRCT2/openrct2-cli --version && ./OpenRCT2/openrct2-cli host $(if true && [ -d ServerData/save/autosave/ ]; then find ServerData/save/autosave/ | sort -r | head -1; else echo "ServerData/save/save.park"; fi) --port 11753 --user-data-path /home/container/ServerData/

Dotted values come from the server settings. These values are examples.

  • Save file (.sv4 / .sv6 / .park) to load. Can be a file path or can be a webhosted file URL. An existing save file must be specified; the server cannot generate a new scenario/save from scratch.

    SAVE_URIUsers can edit

    required|string|min:4

  • Will load the latest autosave (assuming one is present) *instead* of the Save File when the server is started. Useful for loading the latest progress of a park after a reboot. Set to "false" to "lock" progress of the park, and always load the original Save File on start up.

    LOAD_AUTOSAVEUsers can edit

    required|string|in:true,false

  • 0 = Every 1 min, 1 = Every 5 min, 2 = Every 15 min, 3 = Every 30 min, 4 = Every hour, 5 = Never

    AUTOSAVE_INTERVALUsers can edit

    required|integer|between:0,5

  • Number of autosaves to keep before rolling over and deleting the oldest one. Set to 0 to disable autosaving.

    AUTOSAVE_AMOUNTUsers can edit

    required|integer|min:0

  • Maximum players allowed to connect to the server.

    MAX_PLAYERSUsers can edit

    required|integer|min:0

  • Password requested by the server for clients to connect. Admins do not have to enter password to join. Leave empty for no password.

    SERVER_PASSWORDUsers can edit

    string|nullable

  • If set to "false", the server will not be advertised in the master server list, and clients must manually connect.

    SERVER_ADVERTISEUsers can edit

    required|string|in:true,false

  • Set to "true" to have the server pause simulation if no clients are on the server.

    PAUSE_NO_CLIENTSUsers can edit

    required|string|in:true,false

  • Name of the server that appears in the server list.

    SERVER_NAMEUsers can edit

    string|nullable

  • Description of the server that appears when hovering over the server in the server list.

    SERVER_DESCRIPTIONUsers can edit

    string|nullable

  • The server appears as a player in the player list. This is the name it will have.

    SERVER_PLAYER_NAMEUsers can edit

    string|nullable

  • The "Message of the Day" that gets sent to all clients who join.

    SERVER_GREETINGUsers can edit

    string|nullable

  • Server provider name that appears in server information window.

    PROVIDER_NAMEUsers can edit

    string|nullable

  • Server provider e-mail that appears in server information window.

    PROVIDER_EMAILUsers can edit

    string|nullable

  • Server provider website that appears in server information window.

    PROVIDER_WEBSITEUsers can edit

    string|nullable

  • Set to "true" if you would like in-game chat logged to file in Data/chatlogs.

    LOG_CHATUsers can edit

    required|string|in:true,false

  • Set to "true" if you would like in-game actions logged to file in Data/serverlogs.

    LOG_SERVER_ACTIONSUsers can edit

    required|string|in:true,false

  • The release tag (version) of OpenRCT2 to download and install from their official Github (ie. "v0.3.5.1"). Use "latest" to download the latest release, or "develop" to build from the latest source (takes longer to install but is the most up to date).

    VERSIONUsers can edit

    required|string|min:1

  • What path to load libraries from for release binaries. Rarely needs to be changed.

    LD_LIBRARY_PATHUsers cannot see

    required|string

Wings

Stop command
^C (SIGINT)
Running when the console shows
Listening for clients on

Files Wings edits

Wings sets these values in these files before each start.

ServerData/config.ini ini

general.autosave
{{server.build.env.AUTOSAVE_INTERVAL}}
general.autosave_amount
{{server.build.env.AUTOSAVE_AMOUNT}}
network.player_name
"{{server.build.env.SERVER_PLAYER_NAME}}"
network.default_port
{{server.build.default.port}}
network.default_password
"{{server.build.env.SERVER_PASSWORD}}"
network.advertise
{{server.build.env.SERVER_ADVERTISE}}
network.maxplayers
{{server.build.env.MAX_PLAYERS}}
network.server_name
"{{server.build.env.SERVER_NAME}}"
network.server_description
"{{server.build.env.SERVER_DESCRIPTION}}"
network.server_greeting
"{{server.build.env.SERVER_GREETING}}"
network.provider_name
"{{server.build.env.PROVIDER_NAME}}"
network.provider_email
"{{server.build.env.PROVIDER_EMAIL}}"
network.provider_website
"{{server.build.env.PROVIDER_WEBSITE}}"
network.log_chat
{{server.build.env.LOG_CHAT}}
network.log_server_actions
{{server.build.env.LOG_SERVER_ACTIONS}}
network.pause_server_if_no_clients
{{server.build.env.PAUSE_NO_CLIENTS}}

Readme

OpenRCT2

Authors / Contributors


Game Description

From OpenRCT2's Website:

OpenRCT2 is an open-source re-implementation of RollerCoaster Tycoon 2 (RCT2), expanding the game with new features, fixing bugs and raising game limits. The gameplay revolves around building and maintaining an amusement park containing attractions, shops and facilities. The player must try to make a profit and maintain a good park reputation whilst keeping the guests happy. OpenRCT2 allows for both scenario and sandbox play. Scenarios require the player to complete a certain objective in a set time limit whilst sandbox allows the player to build a more flexible park with optionally no restrictions or finance.


Server Ports

Port Default (TCP)
Game 11753

Installation/System Requirements

Minimum
Processor x86/64 (*multiarch may be supported for develop builds, but has not been tested)
RAM 256-512 MiB (depends on # of clients & park size)
Storage 110 MB (may require more if building from source)
RCT2 Files Not required

Save Files

Save files and autosaves are located in this directory:

/home/container/ServerData/save/

If the "Load Latest Autosave" startup variable is enabled, and the autosave/ directory exists, the server will load the latest autosave instead of the specified Save File.


Console Commands

Until support for console commands to interactive programs gets added to Pterodactyl, entering commands via the panel's console do nothing (reference issue pterodactyl/panel#3712).


Becoming an Admin on the Server

Unfortunately, because console commands currently do not register, becoming the first admin on the server takes some steps, listed below:

  1. Ensure the "Log Server Actions" startup variable is set to "true".
  2. Start the server and join it with the client you want to make an admin.
  3. Open ServerData/serverlogs/<Server Name>/<Latest Date>.txt and copy the SHA1 hash next to your client's username (note the username as well).
  4. Then, open ServerData/users.json. Paste the hash into the "hash" value, change the "name" value to your client's username, and save the file.
  5. Reboot the server, re-join it, and you should be an admin!

After becoming an admin, you can use the in-game users management window to add additional admins (or groups) more easily if you wish.


Known Issues

The following are known issues that are unique to running OpenRCT2 on Pterodactyl, but likely can only be fixed by further development/updates from OpenRCT2.

  • Configuring a password on the server disallows non-admin clients from entering in a password in their client to connect; it just disconnects them. Admin clients can still join normally. (reference issue OpenRCT2/OpenRCT2#16396)
  • You may rarely run into the server crashing on start due to a "Floating point exception(core dumped)" error. If this occurs to you, please help with OpenRCT2 development by doing the following:
    1. Add the following to the beginning of your server's startup command: SEGFAULT_SIGNALS=fpe LD_PRELOAD=/lib/x86_64-linux-gnu/libSegFault.so
    2. Start the server. If it boots normally, nothing extra will print. If it crashes, it will print a stack trace to the console.
    3. If a crash occurs, copy the entire stack trace, and save it to a log sharing website (like Hastebin).
    4. Open a new Bug Report Issue with OpenRCT2 and share your logs with them.

Changes

  1. OpenRCT2: Correct egg format and update readme

    · Red Banana · f13befa

  2. Validate and update embedded URLs

    · Daniel Barton · bf9f3cb

  3. SteamCMD + Other fixes

    · yesBad · edbf925

  4. Add standalone games

    · Daniel Barton · 74c706a

All changes on GitHub

Problem with this egg?

Open an issue on GitHub. Include your Panel and Wings versions.

Install script 113 lines /bin/bash in debian:bullseye-slim Show
#!/bin/bash

## File: Pterodactyl OpenRCT2 Egg - egg-openrct2.json
## Authors: David Wolfe (Red-Thirten), ptero-eggs
## Date: 2022/06/28
## License: MIT License

GITHUB_PACKAGE="OpenRCT2/OpenRCT2"
MATCH="linux-x86_64.AppImage"
DEFAULT_SAVE="https://raw.githubusercontent.com/ptero-eggs/game-eggs/main/openrct2/save.park"

## OpenRCT2 Install
apt -y update
[ ! -d /mnt/server ] && mkdir /mnt/server
cd /mnt/server
# Remove existing installation if present
[ -d OpenRCT2 ] && rm -rf OpenRCT2
# Setup OpenRCT2 directory
mkdir -p OpenRCT2/data
# Setup temp directory for building and move to it
[ -d temp ] && rm -rf temp
mkdir temp && cd temp

# Determine if installing from source or from release
if [ "${VERSION}" == "develop" ]; then
    # Get required packages
    apt -y install curl git make cmake gcc build-essential libicu-dev pkg-config libcurl4-openssl-dev libcrypto++-dev libpng-dev libssl-dev libzip-dev duktape-dev nlohmann-json3-dev
    echo -e "\nInstalling/Updating OpenRCT2 from source...\n"
    
    # Clone the branch and check if successful
    git clone --branch "${VERSION}" https://github.com/${GITHUB_PACKAGE}
    if [ ! -d OpenRCT2 ]; then
        echo -e "\nFailed to clone \"${VERSION}\" branch from https://github.com/${GITHUB_PACKAGE}\n"
        exit 1
    fi
    
    cd OpenRCT2
    mkdir build && cd build
    # Prepare CMake files for a lightweight and CLI-only build of OpenRCT2, using the appropriate flags
    cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DPORTABLE=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_CXX_FLAGS="-g -gz" -DDISABLE_TTF=ON -DDISABLE_GOOGLE_BENCHMARK=ON -DDISABLE_DISCORD_RPC=ON -DDISABLE_GUI=ON
    echo -e "\nBuilding OpenRCT2 package from source...\n\tThis process can take quite some time. Grab a coffee :)\n"
    # Build OpenRCT2
    DESTDIR=. make install
    # Check if build was successful
    if [ ! -d usr/local ]; then
        echo -e "\nFailed to successfully build OpenRCT2!\n"
        exit 1
    fi
    
    # Make executable-ready package by moving compiled files to the correct locations
    cd usr/local
    mv bin/* /mnt/server/OpenRCT2/
    mv share/openrct2/* share/openrct2-cli/* /mnt/server/OpenRCT2/data/
    mv share/doc /mnt/server/OpenRCT2/
    echo -e "\nBuild of OpenRCT2 package complete!"
else
    # Get required packages
    apt install -y curl jq
    echo -e "\nInstalling/Updating OpenRCT2 from release tag \"${VERSION}\"...\n"
    
    # This is a simple script to use the GitHub API for release versions.
    # This requires the egg has a variable for GITHUB_PACKAGE, VERSION and MATCH (MATCH is to match the filename in some way).
    # Get release info and download links
    LATEST_JSON=$(curl --silent "https://api.github.com/repos/${GITHUB_PACKAGE}/releases/latest")
    RELEASES=$(curl --silent "https://api.github.com/repos/${GITHUB_PACKAGE}/releases")
    if [ -z "${VERSION}" ] || [ "${VERSION}" == "latest" ]; then
        DOWNLOAD_URL=$(echo ${LATEST_JSON} | jq .assets | jq -r .[].browser_download_url | grep -i ${MATCH})
    else
        VERSION_CHECK=$(echo ${RELEASES} | jq -r --arg VERSION "${VERSION}" '.[] | select(.tag_name==$VERSION) | .tag_name')
        if [ "${VERSION}" == "${VERSION_CHECK}" ]; then
            DOWNLOAD_URL=$(echo ${RELEASES} | jq -r --arg VERSION "${VERSION}" '.[] | select(.tag_name==$VERSION) | .assets[].browser_download_url' | grep -i ${MATCH})
        else
            DOWNLOAD_URL=$(echo ${LATEST_JSON} | jq .assets | jq -r .[].browser_download_url)
        fi
    fi
    # Download the release and check if successful
    curl -L ${DOWNLOAD_URL} -o OpenRCT2.AppImage
    if [ ! -f OpenRCT2.AppImage ]; then
        echo -e "\nFailed to download release: ${DOWNLOAD_URL}\n"
        exit 1
    fi
    
    chmod +x OpenRCT2.AppImage
    # Extract AppImage and check if successful
    echo -e "Extracting AppImage files..."
    ./OpenRCT2.AppImage --appimage-extract
    if [ ! -d squashfs-root/usr ]; then
        echo -e "\nFailed to extract AppImage!\n\t(Is the `MATCH` variable set to download an AppImage?)\n"
        exit 1
    fi
    
    # Move needed files to correct directories
    cd squashfs-root/usr
    mv lib bin/openrct2-cli /mnt/server/OpenRCT2/
    mv share/openrct2/* /mnt/server/OpenRCT2/data/
    mkdir /mnt/server/OpenRCT2/doc && mv share/doc/openrct2 $_
    echo -e "\nDownload/Update of OpenRCT2 release successful!"
fi

cd /mnt/server
rm -rf temp # Clean up temp building directory

## OpenRCT2 Setup
# Setup ServerData/save directory
[ ! -d ServerData/save ] && mkdir -p ServerData/save
cd ServerData/save
# Download default save.park if missing
if [ ! -f save.park ]; then
    echo -e "Downloading default save.park file from ${DEFAULT_SAVE}"
    curl -sSLO ${DEFAULT_SAVE}
fi

echo -e "\nOpenRCT2 Successfully Installed!"