This article provides a detailed step-by-step guide to setup a development environment for OpenTomb on Linux. It requires some familiarity with the command line, file manager and how to install software.
On Linux the build instructions for OpenTomb are provided by a CMake script that will generate the native Makefile.
- SDL2 installed
- zlib installed
- Mercurial SCM installed
- CMake 2.8 installed
- Qt Creator installed
- Game assets of TombRaider 1-5 games
- Latest config files from Sourceforge.net
Get the source code
Choose a directory and clone the OpenTomb source code repository from the command line:
Compile using Qt Creator
- Start up QtCreator and select File -> Open File or Project.
- Navigate to your cloned repository directory and open CMakeLists.txt.
- Choose a build directory. Make sure it is located outside of the repository. The default build directory suggested by Qt Creator (e.g. opentomb-code-build) is usually just fine.
- Provide CMake with the arguments -DCMAKE_BUILD_TYPE=Debug (if you plan to develop) or -DCMAKE_BUILD_TYPE=Release (if you just want to run the engine).
- Select Unix Generator as the generator and click Run CMake. This should successfully create a Makefile if the required libraries are installed. Click Finish.
- Hit Ctrl+B to start compilation. This can take a while to complete and creates the OpenTomb executable inside the build directory.
Pro tip for faster compilation
Add -j2 or -j4 (depending on how many CPU cores you have) into Projects -> Build & Run -> Build Steps -> Details -> Additional arguments.
Add config files
Extract the files form the OpenTomb binary archive (engine.7z) into the build directory. The important files/directories are: data, save, scripts, VeraMono.ttf, ascII.txt, config.lua.
Add game assets
Copy game files from the original Tomb Raider games into the corresponding data subdirectory like you would on Windows. E.g. copy all “*.TR2” levels from the Tomb Raider 2 data directory into opentomb-code-build/data/tr2/data. To get audio, copy MAIN.SFX, too.
Modify cvars.game_level in config.lua to match an existing level file, e.g. data/tr2/data/WALL.TR2. Keep in mind, that file paths in Linux are case sensitive.
Now you should be able to launch the game using the file browser or from within Qt Creator via Ctrl+R.