Required Packages (General)
Required libraries include:
| Package | Note(s) |
|---|---|
sdl2 |
Only for UI client. |
freetype |
Can be disabled. |
fontconfig |
Can be disabled. |
libzip |
>= 1.0 |
libpng |
>= 1.2 |
speexdsp |
Only for UI client. |
curl |
only if building with http support. |
openssl |
>= 1.0; Only if building with multiplayer support. |
icu |
>= 59.0 |
zlib |
|
mesa |
Only for UI client, can be disabled. |
cmake |
|
nlohmann-json |
>= 3.6.0 |
duktape |
Unless scripting is disabled. |
benchmark |
Optional. |
innoextract |
Optional runtime dependency; used for GOG installer extraction during setup |
libvorbis |
|
libogg |
|
flac |
|
zstd |
You can add support for Discord's Rich Presence API by cloning https://github.com/discordapp/discord-rpc into the root clone directory. Do note discord-rpc requires rapidjson, which don't bother fixing their bugs and you may need the hackish workaround: janisozaur/rapidjson/commit/20f8604ee6cd078c1cb2346148c69c0c2c160db2
pacman -S pactoys
pacboy sync --needed SDL2 freetype fontconfig libzip libpng speexdsp curl openssl icu zlib mesa cmake nlohmann-json duktape libvorbis libogg flac zstd
And optionally
pacboy sync --needed benchmark innoextract
Compiling
GCC Toolchain (mingw-x86_64, mingw-i686, and ucrt-x86_64)
MSYS2's default cmake configuration uses ninja, but also provides options the option to use GNU Make
mkdir build && cd build
cmake -G "MinGW Makefiles" .. # Remember to set your build flags, e.g. -DCMAKE_BUILD_TYPE=RelWithDebInfo, you must specify the generator if you want to use make and not ninja
mingw32-make
This will generate a openrct2 binary in the build directory. To run you have two options: make install or running it locally.
make install
mingw32-make install will download required resources (json objects, title sequences) and installs openrct2 under /usr/local by default, but DESTDIR will be properly honoured (see below).
Running it from the build directory
Alternatively you can install the required resources manually so can launch openrct2 from the project directory.
You need a functional data directory next to the current working directory when you start openrct2.
An easy way to generate such a data directory is by leveraging make install. Type the following in the build directory:
DESTDIR=. make install
Alternatively you can install these assets yourself. The following needs to satisfied:
$build/data/has to have contents of$repo/data/$build/data/g2.datneeds to exist. Build it usingmake g2and then copy it intodata.$build/data/objecthas to have the extracted contents from https://github.com/OpenRCT2/objects/releases- (optional)
$build/data/titlehas to have extracted contents from https://github.com/OpenRCT2/title-sequences/releases
$XDG_CONFIG_HOME/OpenRCT2/ (or ~/.config/OpenRCT2/ in its absence) has to have config.ini with game_path set to an RCT install. openrct2 will ask you for this directory when it first starts.
Keep in mind you can symlink stuff and that filesystems are case sensitive!
Alternatively you can specify the data directory like this:
./openrct2 --openrct-data-path=../data
OR
Just symlink the data directory in the current build directory, which is the easiest approach for development
ln -s ../data data
Clang (clang-x86_64 and clang-i686)
Building with clang works the same way as building with GCC, you just need to change the CXX environment variable. Keep in mind, that you need to have an empty build directory as cmake will not switch compilers after it has already generated a Makefile.
mkdir build && cd build
export CXX=$(which clang++) # OpenRCT2 is purely a C++ project, there's no need to set CC
cmake ..
make
See the optimization note above.
Ninja
If you prefer to use ninja just run cmake without the -G flag:
mkdir build && cd build
cmake .. # Any other arguments you want, for example -DCMAKE_BUILD_TYPE=RelWithDebInfo
ninja # No need to specify parallel, it does that automatically
DESTDIR=. ninja install
discord-rpc
#6658 added support for discord-rpc, Discord's Rich Presence client library. It gets automatically picked up when cloned into the root of repository.
That should work, but it might require a little debugging. This is still quite finicky at the end of the day.
- Home
- FAQ & Common Issues
- Roadmap
- Installation
- Building
- Features
- Development
- Benchmarking & stress testing OpenRCT2
- Coding Style
- Commit Messages
- Overall program structure
- 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 drawers, RTDs and vehicle types
- Track types
- Vehicle Sprite Layout
- Widget colours
- Debugging OpenRCT2 on macOS
- OpenGL renderer
- Rebase and Sync fork with OpenRCT2
- Release Checklist
- Replay System
- Using minidumps from crash reports
- Using Track Block Get Previous
- History
- Testing