OpenRCT2 is an open-source re-implementation of RollerCoaster Tycoon 2 (RCT2), expanding the game with new features, fixing bugs and raising game limits.
Note: OpenRCT2 only recently (Jan. 2022) updated to support non-interactive Docker environments, and development is ongoing to improve it. Please understand future updates may be unstable, or this Egg may update in the future to accommodate changes.
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.
Port | Default (TCP) |
---|---|
Game | 11753 |
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 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.
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).
Unfortunately, because console commands currently do not register, becoming the first admin on the server takes some steps, listed below:
ServerData/serverlogs/<Server Name>/<Latest Date>.txt
and copy the SHA1 hash next to your client's username (note the username as well).ServerData/users.json
. Paste the hash into the "hash" value, change the "name" value to your client's username, and save the file.After becoming an admin, you can use the in-game users management window to add additional admins (or groups) more easily if you wish.
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.
SEGFAULT_SIGNALS=fpe LD_PRELOAD=/lib/x86_64-linux-gnu/libSegFault.so
Name | Tag |
---|---|
ghcr.io/ptero-eggs/yolks:debian | ghcr.io/ptero-eggs/yolks:debian |
Name | Description | Environment Variable | Default Value | User Viewable | User Editable |
---|---|---|---|---|---|
Save File | 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_URI | ServerData/save/save.park | Yes | Yes |
Load Latest Autosave | 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_AUTOSAVE | true | Yes | Yes |
Autosave Interval | 0 = Every 1 min, 1 = Every 5 min, 2 = Every 15 min, 3 = Every 30 min, 4 = Every hour, 5 = Never | AUTOSAVE_INTERVAL | 1 | Yes | Yes |
Autosaves To Keep | Number of autosaves to keep before rolling over and deleting the oldest one. Set to 0 to disable autosaving. | AUTOSAVE_AMOUNT | 10 | Yes | Yes |
Max Players | Maximum players allowed to connect to the server. | MAX_PLAYERS | 16 | Yes | Yes |
Server Password | Password requested by the server for clients to connect. Admins do not have to enter password to join. Leave empty for no password. | SERVER_PASSWORD | Yes | Yes | |
Advertise Server | If set to "false", the server will not be advertised in the master server list, and clients must manually connect. | SERVER_ADVERTISE | true | Yes | Yes |
Pause Server If No Clients | Set to "true" to have the server pause simulation if no clients are on the server. | PAUSE_NO_CLIENTS | false | Yes | Yes |
Server Name | Name of the server that appears in the server list. | SERVER_NAME | Yes | Yes | |
Server Description | Description of the server that appears when hovering over the server in the server list. | SERVER_DESCRIPTION | Yes | Yes | |
Server Player Name | The server appears as a player in the player list. This is the name it will have. | SERVER_PLAYER_NAME | Server | Yes | Yes |
Server Greeting | The "Message of the Day" that gets sent to all clients who join. | SERVER_GREETING | Yes | Yes | |
Provider Name | Server provider name that appears in server information window. | PROVIDER_NAME | Yes | Yes | |
Server Provider E-Mail | Server provider e-mail that appears in server information window. | PROVIDER_EMAIL | Yes | Yes | |
Server Provider Website | Server provider website that appears in server information window. | PROVIDER_WEBSITE | Yes | Yes | |
Log Chat | Set to "true" if you would like in-game chat logged to file in Data/chatlogs. | LOG_CHAT | false | Yes | Yes |
Log Server Actions | Set to "true" if you would like in-game actions logged to file in Data/serverlogs. | LOG_SERVER_ACTIONS | false | Yes | Yes |
OpenRCT2 Version | 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). | VERSION | latest | Yes | Yes |
[Advanced] Library Path | What path to load libraries from for release binaries. Rarely needs to be changed. | LD_LIBRARY_PATH | ./OpenRCT2/lib | No | No |
#!/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!"