How to build and setup on Raspberry PI.md - tx00100xt/SeriousSamClassic GitHub Wiki

How to build and setup on Raspberry PI 3B/3B+/4/400

Note: The build of the game for Raspberry PI OS 32-bit and 64-bit is identical. For the 32-bit version, you can optionally specify the -DUSE_I386_NASM_ASM=FALSE key for cmake.

Installing dependencies

sudo apt-get update -y --allow-releaseinfo-change
sudo apt-get install --no-install-recommends -y git bison flex cmake make gcc libc6-dev libsdl2-dev libogg-dev libvorbis-dev zlib1g-dev

Getting the source code

git clone https://github.com/tx00100xt/SeriousSamClassic.git
git clone https://github.com/tx00100xt/SeriousSamAlphaRemake.git

Getting Aplha Remake Data

wget https://archive.org/download/serious-sam-alpha-remake-data/SeriousSamAlphaRemake_v1.5.tar.xz
tar xJvf SeriousSamAlphaRemake_v1.5.tar.xz -C SeriousSamClassic/SamTFE

or

for var in a b c d; do wget https://github.com/tx00100xt/serioussam-mods/raw/main/SamTFE-SSA/SeriousSamAlphaRemake_v1.5.tar.xz.parta$var; done; cat SeriousSamAlphaRemake_v1.5.tar.xz.part* > SeriousSamAlphaRemake_v1.5.tar.xz
tar -xJvpf SeriousSamAlphaRemake_v1.5.tar.xz -C SeriousSamClassic/SamTFE

Getting XPLUS Data

wget https://archive.org/download/sam-tfe-xplus/SamTFE-XPLUS.tar.xz
tar -xJvpf SamTFE-XPLUS.tar.xz -C SeriousSamClassic/SamTFE

wget https://archive.org/download/sam-tse-xplus/SamTSE-XPLUS.tar.xz
tar -xJvpf SamTSE-XPLUS.tar.xz -C SeriousSamClassic/SamTSE

or

for var in a b c; do wget https://github.com/tx00100xt/serioussam-mods/raw/main/SamTFE-XPLUS/SamTFE-XPLUS.tar.xz.parta$var; done; cat SamTFE-XPLUS.tar.xz.part* > SamTFE-XPLUS.tar.xz
tar -xJvpf SamTFE-XPLUS.tar.xz -C SeriousSamClassic/SamTFE

for var in a b c; do wget https://github.com/tx00100xt/serioussam-mods/raw/main/SamTSE-XPLUS/SamTSE-XPLUS.tar.xz.parta$var; done; cat SamTSE-XPLUS.tar.xz.part* > SamTSE-XPLUS.tar.xz
tar -xJvpf SamTSE-XPLUS.tar.xz -C SeriousSamClassic/SamTSE

Building SamTFE, SamTSE and XPLUS:

cd SeriousSamClassic
mkdir build
mkdir build-xplus
cd build
cmake -DUSE_I386_NASM_ASM=FALSE .. # -DUSE_I386_NASM_ASM=FALSE need for 32-bit OS
make -j4
make install
cd ..
cd build-xplus
cmake -DXPLUS=TRUE -DUSE_I386_NASM_ASM=FALSE ..  # -DUSE_I386_NASM_ASM=FALSE need for 32-bit OS
make ecc
make -j4
make install

Note: for Raspberry Pi4 just add -DRPI4=TRUE for cmake command(-mcpu=cortex-a72 optimization will be added).

Build for SeriousSamAlphaRemake:

cd SeriousSamAlphaRemake/Sources
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DTFE=TRUE -DRPI4=TRUE ..
make ecc
make -j4

Place the resulting libraries libEntities.so and libGame.so from build/Debug into the SamTFE/Mods/SSA/Bin folder

cp -vfr Debug/libEntities.so ../../Mods/SSA/Bin
cp -vfr Debug/libGame.so ../../Mods/SSA/Bin
cd ../../../../

Game resources

To start the game, you'll need the original resurces of a licensed copy of Serious Sam: The First Encounter and Serious Sam: The Second Encounter.

Steam version.

If you have a digital copy of the game on Steam then the resources can be found in ~/.local/share/Steam/steamapps/common/Serious Sam Classic The Second Encounter/ (the default Steam game installation directory on Linux).

cd SeriousSamClassic
rsync --progress -rh "$HOME/.local/share/Steam/steamapps/common/Serious Sam Classic The First Encounter/" SamTFE
rsync --progress -rh "$HOME/.local/share/Steam/steamapps/common/Serious Sam Classic The Second Encounter/" SamTSE
rm -fr "SamTFE/Bin/"{*.exe,*.dll,*.EXE,*.DLL}
rm -fr "SamTSE/Bin/"{*.exe,*.dll,*.EXE,*.DLL}

GOG version.

If you bought a digital on GOG, you can unpack the resources with the innoextract CLI tool. To install innoextract via your package manager, run:

sudo apt-get install innoextract

Copy files "setup_serious_sam_the_first_encounter_2.0.0.10.exe" and "setup_serious_sam_the_second_encounter_2.1.0.8.exe" to a directory SeriousSamClassic and run the following commands:

cd SeriousSamClassic
innoextract --gog setup_serious_sam_the_first_encounter_2.0.0.10.exe
cp -vfr "app/"{*.gro,Levels,Help} SamTFE
rm setup_serious_sam_the_first_encounter_2.0.0.10.exe
rm -rf app
rm -rf tmp
innoextract --gog setup_serious_sam_the_second_encounter_2.1.0.8.exe
cp -vfr "app/"{*.gro,Levels,Help} SamTSE
rm setup_serious_sam_the_first_encounter_2.0.0.10.exe
rm -rf app
rm -rf tmp
rm -rf commonappdata

Physical version.

If you bought a physical copy of the game and you have an ISO of your disk, you can unpack the resources with the any archive manager. Game resources are located in the Install directory of the disk. Just copy all the *.gro files from there, as well as the Levels directory to directories SeriousSamClassic/SamTFE and SeriousSamClassic/SamTSE, respectively, for games Serious Sam: The First Encounter and Serious Sam: The Second Encounter.

Launching the game.

To start the game, use the script:

run_game.sh

or

run_game_hud.sh 

if you need to monitor MangoHUD.