Colobot Gold assembly

Colobot Gold, a computer game for programmers, is gaining more and more popularity. They wrote about it more than once on Habré, but the material becomes obsolete over time. The program is actively developing. And many users want to try the latest features of Colobot Gold. So, one of my acquaintances read about a new type of robots, which is not yet in the official master version and asked me to write this instruction for assembling an executable file from the Colobot Gold source.



Build is possible on various platforms , but the easiest way is implemented on Linux distributions, For example, on Ubuntu 20.



A couple of introductory notes about the build process, that is, the process of obtaining an executable file. The source code of the Colobot program links to other source codes of completely different projects. In order to build Colobot, we need to connect the corresponding third-party packages to the system. Open the console and write



0)



sudo apt-get install build-essential cmake libsdl2-dev libsdl2-image-dev libsdl2-ttf-dev libsndfile1-dev libvorbis-dev libogg-dev libpng-dev libglew-dev libopenal-dev libboost-dev libboost-system-dev libboost-filesystem-dev libboost-regex-dev libphysfs-dev gettext git po4a vorbis-tools


1) Now let's create a base directory for our manipulations, let's say ColobotBld. (The mkdir command creates a dialog with the given name). And also a directory that will subsequently contain directly executable files, let exe.



mkdir ColobotBld
cd ColobotBld
mkdir exe


2) Let's use the now fashionable source code delivery (versions) and request the latest (dev) version.



git clone -b dev https://github.com/colobot/colobot.git 


3) We see that the colobot folder has appeared in the base ColobotBld directory. Let's go to it



cd colobot


4) Download all submodules



git submodule update --init


5) Create a so-called build directory, let build. Thus, we have the base ColobotBld directory, which contains the colobot and exe directories. colobot, in addition to sources, will now contain a build folder for building, that is, creating intermediate files at compile time.



mkdir build


Accordingly, you need to compile while in the build folder, so let's go to it

6)



cd build


7) Next, we will tell the build system where to take from: the sources from the colobot directory, and put the executable file in the exe directory. I use full paths to avoid confusion, leave them unchanged here as an example, of course, the full paths are different on your system.



cmake /home/andrei//ColobotBld/colobot  -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/home/andrei//ColobotBld/exe


8) Next, tell the make utility where the source codes are



make /home/andrei//ColobotBld/colobot


9) Run the build



make


10) Since in step 7) we indicated where to put the executable file, the following code will do this. Those interested can arrange in a package



make install


Now go to the exe / games folder and run the colobot.



11) Fun exercise for those who consider themselves already familiar with the Linux console: go to the exe / games folder in the console and run (from the console) the colobot file!



So, we have successfully compiled the game for programmers Colobot Gold from source. It seems to me that this task is a feasible lesson for beginners who begin their journey in the world of automation, scripting.



All Articles