Jump to content

Building OpenRCT2 on Rpi4 with Raspberry Pi OS


Recommended Posts

The previous guide was a bit out of date so I created this:

 

I make a folder called OpenRCT2 that contained two sub folders: OpenRCT2 and RCT. OpenRCT was built after using the git command to download the latest repo. RCT is where I saved the source install file and extracted it using innoextract.

 

Part 1 Purchase and extract the original RCT files. I used the GOG version of the installer.

https://openrct2.org/quickstart/extract-rct2-files/linux

sudo apt update
sudo apt install innoextract
mkdir OpenRCT2 && cd OpenRCT2
mkdir RCT && cd RCT

This folder is where the main RCT files will go. Transfer the setup files to this folder from where ever you may have them:

EX I navigated to the USB folder with the files in it and transferred from there

sudo mv setup_roller* [Path to RCT] && cd [Path to RCT]

From the folder where the installer was transferred to

innoextract setup*

The RCT2 files are now in the folder: ../OpenRCT2/RCT/app

 

Part 2 Building for RPi 4

Based off https://www.raspberrypi.org/forums/viewtopic.php?t=219430 with updates

sudo apt install cmake libsdl2-dev libicu-dev gcc pkg-config libjansson-dev libspeex-dev libspeexdsp-dev libcurl4-openssl-dev libcrypto++-dev libfontconfig1-dev libfreetype6-dev libpng-dev libssl-dev libzip-dev build-essential make duktape-dev -y

Note: may require additional libraries: https://github.com/OpenRCT2/OpenRCT2/#2-downloading-the-game-pre-built

cd .. 

(should be a the top OpenRCT2 folder now)

I also installed google benchmark via git. https://github.com/google/benchmark directions provided there.

Benchmark cmake:

cmake ../ -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-mcpu=cortex-a72"
sudo apt full-upgrade

This step ensures that the system is fully up to date and the required dependencies are installed.

 

At this point I expect you’re in the folder ../OpenRCT with the subfolder of RCT.

git clone https://github.com/OpenRCT2/OpenRCT2.git

cd OpenRCT2

mkdir build && cd build

cmake ../ -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-Ofast -DNDEBUG -mcpu=cortex-a72"

*Updated for RPi4 CPU
 

make

make g2

cp g2.dat [Path to/OpenRCT2/OpenRCT2/data/. ]

EX: cp g2.dat /home/pi/OpenRCT2/OpenRCT2/data/.

ln -s ../data data

To install the game:

sudo make install

Alternatively: start the game from the build directory:

./openrct2

There's a setting that causes it to crash with a segmentation fault but I haven't narrowed it down to which one. It's random title sequence.

If that happens:

cd ~/.config/OpenRCT2

rm config.ini

Or you can try and edit it using a text editor. Happy Gaming

 

Edited by Hans5849
Link to comment
On 20/06/2020 at 16:43, Hans5849 said:

Addendum:

I was having constant errors with the objects. Followed this https://github.com/OpenRCT2/OpenRCT2/wiki/Building-OpenRCT2-on-Linux and created a folder called "object" in the data folder. I unzipped the contents of https://github.com/OpenRCT2/objects to here and copied the contents of the /rct/app/ObjData to /data/rct2 and everything worked. Only took 4 days to figure that problem out.

There is no need to get sarcastic. This is also not the right way to do it. `make install` will take care of downloading objects and title sequences. If you ever need to install objects manually, the best way is to download an objects release and unzip it.

Link to comment
1 hour ago, Gymnasiast said:

There is no need to get sarcastic. This is also not the right way to do it. `make install` will take care of downloading objects and title sequences. If you ever need to install objects manually, the best way is to download an objects release and unzip it.

I can be as sarcastic as I want, I scoured the available resources to come up with something that benefits others. Upon finding a problem with the process I displayed it in a manner where other people wouldn't have to spend time figuring it out. If using 'make install' is the correct way to do it why not make changes here https://github.com/OpenRCT2/OpenRCT2#32-compiling-and-running so others don't run into problems.

Link to comment
  • 2 weeks later...
11 hours ago, janisozaur said:

Which part of

DESTDIR=. make install # the install target creates all the necessary files in places we expect them

That you linked to, do you not understand?

Well, as I wrote:

Quote

This was meant to serve as an updated version of that guide, as DESTDIR wasn't included in that guide so it wasn't included here. If you have a manner to improve what I have written please write it out, otherwise your thoughts carry as much weight as the electrons that brought them here. If you notice I added Gymnasiast's recommendation to use make install over the previous method of running it from the folder.

Link to comment
  • 1 year later...

I tried to follow this guide....but no luck. 

It tripped up on the 

make

make g2

cp g2.dat [Path to/OpenRCT2/OpenRCT2/data/. ]

error was

fatal error: nlohmann/json_fwd.hpp: No such file or directory
   12 | #include <nlohmann/json_fwd.hpp>

Any suggestions for a fix? I'm now heading to github to see if I can get it working there. 

Edited by DavidAJack
Link to comment

Just attempted the GitHub instructions. 

All was going well until the last hurdle "make install"

My error reads...

Downloading /usr/local/share/openrct2/sequence/
CMake Error at /home/pi/snap/OpenRCT2/OpenRCT2/cmake/download.cmake:33 (file):
  file DOWNLOAD error: cannot create directory
  '/usr/local/share/openrct2/sequence' - Specify file by full path name and
  verify that you have directory creation and file write privileges.


Any advice?

Link to comment
  • 2 months later...

I've had to rebuild my pi and I'm yet again struggling to get ORCT2 to install.....even though I've already successfully install it. 

When carrying out the following instructions......

cp g2.dat [Path to/OpenRCT2/OpenRCT2/data/. ]

..... I get get the following errors. 

-- Checking for module 'flac'
--   No package 'flac' found
CMake Error at /usr/share/cmake-3.18/Modules/FindPkgConfig.cmake:545 (message):
  A required package was not found
Call Stack (most recent call first):
  /usr/share/cmake-3.18/Modules/FindPkgConfig.cmake:733 (_pkg_check_modules_internal)
  src/openrct2-ui/CMakeLists.txt:27 (PKG_CHECK_MODULES)
  CMakeLists.txt:368 (include)

I believe I've installed all dependencies, but who knows maybe I've missed something. 

 I'm going to reboot and try again....but any help would be appreciated. 

Link to comment

The full output on the console reads....

-- IPO supported and enabled in Release.
CMake Warning at cmake/LibFindMacros.cmake:263 (message):
  WARNING: MISSING PACKAGE

  We could not find development headers for DISCORDRPC.  Do you have the
  necessary dev package installed? This package is NOT REQUIRED and you may
  ignore this warning but by doing so you may miss some functionality of
  openrct2.

  Relevant CMake configuration variables:

    DISCORDRPC_INCLUDE_DIR=<not found>
    DISCORDRPC_LIBRARY=<not found>

  You may use CMake GUI, cmake -D or ccmake to modify the values.  Delete
  CMakeCache.txt to discard all values and force full re-detection if
  necessary.

Call Stack (most recent call first):
  cmake/FindDiscordRPC.cmake:25 (libfind_process)
  CMakeLists.txt:203 (find_package)


-- Unsupported CXXFLAG: -Wmissing-variable-declarations
-- Unsupported CXXFLAG: -Wunreachable-code-break
-- Unsupported CXXFLAG: -Wrange-loop-analysis
-- Unsupported CXXFLAG: -Wtautological-unsigned-zero-compare
Found Google benchmark, enabling support
-- Found the following ICU libraries:
--   uc (required)
-- Checking for module 'flac'
--   No package 'flac' found
CMake Error at /usr/share/cmake-3.18/Modules/FindPkgConfig.cmake:545 (message):
  A required package was not found
Call Stack (most recent call first):
  /usr/share/cmake-3.18/Modules/FindPkgConfig.cmake:733 (_pkg_check_modules_internal)
  src/openrct2-ui/CMakeLists.txt:27 (PKG_CHECK_MODULES)
  CMakeLists.txt:368 (include)


-- Configuring incomplete, errors occurred!
See also "/home/raspberrypi/OpenRCT2/OpenRCT2/build/CMakeFiles/CMakeOutput.log".
See also "/home/raspberrypi/OpenRCT2/OpenRCT2/build/CMakeFiles/CMakeError.log".

Any help would be appreciated

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...