• Register

OpenTomb is a cross-platform reimplementation of classic Tomb Raider 1—5 engines.

Post tutorial Report RSS How to compile OpenTomb on Linux using Qt Creator

This article provides a detailed step-by-step guide to setup a development environment for OpenTomb on Linux.

Posted by on - Intermediate Client Side Coding

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.

Requirements:

  • 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:

$> hg clone http://hg.code.sf.net/p/opentomb/code opentomb-code

Compile using Qt Creator

  1. Start up QtCreator and select File -> Open File or Project.
  2. Navigate to your cloned repository directory and open CMakeLists.txt.Opening CMakeLists.txt
  3. 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.Choosing a build directory
  4. 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).
  5. Select Unix Generator as the generator and click Run CMake. This should successfully create a Makefile if the required libraries are installed. Click Finish.Configuring CMake
  6. Hit Ctrl+B to start compilation. This can take a while to complete and creates the OpenTomb executable inside the build directory.Qt Creator compiles

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.Configure parallel compilation jobs

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.OpenTomb config files

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.

Final touch

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.Configure startup game level

Now you should be able to launch the game using the file browser or from within Qt Creator via Ctrl+R.Running OpenTomb

Post comment Comments
Guest
Guest - - 689,220 comments

This comment is currently awaiting admin approval, join now to view.

Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: