This page describes how to build Stunt Rally 3 on Linux (Debian-based).
How to build on Windows is on other page.
It is detailed and has all steps done manually.
All these steps are done quicker in provided .py script as written in Building.
Tested on GNU/Linux, Debian 11 and 12. It should work on Debian-based (like Ubuntu etc).
First steps here are same as in my ogre3ter-demo it could be easier to build that for start.
Guide below has setup steps for empty Debian 12:
Basic setup for building C++ etc, need to run in terminal:
sudo apt-get -y install g++ binutils gdb git make cmake ninja-build
Next to install Ogre dependencies (as in here):
sudo apt-get -y install libfreetype6-dev libfreeimage-dev libzzip-dev libxrandr-dev libxcb-randr0-dev libxaw7-dev freeglut3-dev libgl1-mesa-dev libglu1-mesa-dev libx11-xcb-dev libxcb-keysyms1-dev doxygen graphviz python-clang libsdl2-dev rapidjson-dev
-
Build Ogre-Next from sources, using scripts.
-
Save the file build_ogre_linux_c++latest.sh and put it inside our root folder, called here
dev/
-
We need Ogre-Next branch v3.0 now. So edit
build_ogre_linux_c++latest.sh
and replace in this top line:
OGRE_BRANCH_NAME="master"
toOGRE_BRANCH_NAME="v3-0"
and save file. -
Also in same file we have to add
-D OGRE_BUILD_COMPONENT_PLANAR_REFLECTIONS=1
in 2 lines starting withcmake -D
...
So they should start like:
cmake -D OGRE_BUILD_COMPONENT_PLANAR_REFLECTIONS=1
... -
Go into
dev/
and start it:cd dev/ chmod +x ./build_ogre_linux_c++latest.sh ./build_ogre_linux_c++latest.sh
-
This should succeed after a longer while and build Ogre-Next with its dependencies.
-
If so you can start and check Ogre demos and samples inside:
dev/Ogre/ogre-next/build/Release/bin/
It's good to check if they work before continuing.
-
Now not needed, optional step. We need to have below 2 components built with Ogre.
In all existing / needed configurations (all 3 below):
(Release is enough if all goes well, if not then Debug too)cd dev/ cd Ogre/ogre-next/build/Debug cd Ogre/ogre-next/build/Release cd Ogre/ogre-next/build/RelWithDebInfo
edit the file
CMakeCache.txt
and be sure the lines:OGRE_BUILD_COMPONENT_ATMOSPHERE:BOOL=ON ... OGRE_BUILD_COMPONENT_PLANAR_REFLECTIONS:BOOL=ON
have ON at end. At least PLANAR_REFLECTIONS is not by default.
-
Now build Ogre again. So, in all existing / needed configurations (3 folders above),
startninja
(ormake -j6
if that was used, but-G Ninja
is in Ogre.sh
).
This will take less time than first time.
If you want a full rebuild, domake clean
orninja clean
before. -
Optional rebuild note.
This (rebuild Ogre) step is also needed, after updating Ogre sources to latest (git pull
inOgre/ogre-next/
).
Caution: if this was done later, after building MyGui and/or StuntRally3,
then you need to rebuild also MyGui and then StuntRally3.
Get MyGui-Next, my fork of MyGui on branch ogre3
.
I follow its build guide here.
No need to set, it is so by default:
- MYGUI_RENDERSYSTEM: 8 - Ogre 3.x
- MYGUI_USE_FREETYPE: yes
- all MYGUI_BUILD*: no
- MYGUI_STATIC: no, MYGUI_DONT_USE_OBSOLETE: no
We need Release build, and possibly Debug too.
git clone https://github.com/cryham/mygui-next --branch ogre3 --single-branch
cd mygui-next
mkdir build
cd build
mkdir Release
cd Release
cmake ./../.. -DCMAKE_BUILD_TYPE="Release"
make -j6
cd ..
mkdir Debug
cd Debug
cmake ./../.. -DCMAKE_BUILD_TYPE="Debug"
make -j6
We won't use Conan (in step 7 we replace CI CMake files with manual ones that don't use Conan).
So we need to get all needed deps for SR3 installed first:
sudo apt-get -y install libbullet-dev libbullet-extras-dev libtinyxml2-dev libenet-dev libogg-dev libvorbis-dev libopenal-dev libboost-system-dev libboost-thread-dev
Clone SR3 (this repo) and SR3 tracks inside data/tracks
:
cd dev/
git clone https://github.com/stuntrally/stuntrally3.git sr3
cd sr3/data
git clone https://github.com/stuntrally/tracks3.git tracks
cd ..
At first we need to:
- rename
CMake/
dir to e.g.CMakeCI/
- rename
CMakeManual/
dir toCMake/
- rename
CMakeLists.txt
to e.g.CMakeListsCI.txt
- rename
CMakeLists-Debian.txt
toCMakeLists.txt
Then Inside dev/sr3
:
mkdir build
cd build
cmake ../
(or: cmake ../ -DCMAKE_BUILD_TYPE="Debug" - for better debugging of issues)
make -j5
(or: ninja - if not using makefile)
If it succeeds, go into one of:
sr3/bin/RelWithDebInfo
- if used cmake ../
sr3/bin/Release
- if used cmake ../ -DCMAKE_BUILD_TYPE="Release"
sr3/bin/Debug
- if used cmake ../ -DCMAKE_BUILD_TYPE="Debug"
and start the executable:
./sr-editor3
- for SR3 Track Editor
./stuntrally3
- for SR3 game
For any crashes or issues, check logs inside:
/home/user/.config/stuntrally3
it has current logs and configs (_ed for SR3 Track Editor, without for SR3 game):
editor.cfg - editor options
game.cfg - game options
Ogre.log - log from game
Ogre_ed.log - log from editor
ogre.cfg - Ogre start window, Render Systems setup
ogre_ed.cfg - same, for editor
MyGUI.log - MyGui logs from game and editor
MyGUI_ed.log
For reference here are all key paths and files:
dev - root folder
sr3 - has this repo
bin - output binaries
Debug
Release - has stuntrally3, sr3-editor, plugins.cfg
RelWithDebInfo
data
tracks - has Test1-Flat, Test3-Bumps - cloned tracks3 repo (or old tracks)
mygui-next
build/Release/lib - has libMyGUI.Ogre2Platform.a, libMyGUIEngine.so.3.2.3
build/Debug/lib - has libMyGUI.Ogre2Platform_d.a, libMyGUIEngine_d.so.3.2.3
Ogre
ogre-next
build/Release/bin/ - has Ogre binaries, samples and tutorials
build/Release/lib/ - has libOgreMain.so.3.0, RenderSystem_GL3Plus.so.3.0
build/Debug/bin/ - has Ogre binaries, samples and tutorials
build/Debug/lib/ - has libOgreMain_d.so.3.0, RenderSystem_GL3Plus_d.so.3.0
Dependencies/lib/ - has libFreeImage.a, libfreetype.a
OgreMain/include/ - has Ogre*.h
ogre-next-deps
build_ogre_linux_c++latest.sh - script used to get and build Ogre
Note: I use ../Ogre/ogre-next
dir with Ogre. But CMake default is Dependencies/Ogre
, it can be as link.