Moonmarch
Posts: 39
Joined: Thu Mar 07, 2019 1:34 am

Compile QZDoom

Wed Apr 24, 2019 5:32 am

You will need a copy of Doom or other supported Doom engine game, here is a list of supported games:
https://zdoom.org/wiki/IWAD

Here is the download link to the QZDoom source code:
https://zdoom.org/downloads

Why use QZdoom instead of GZDoom, because compiling latest GZDoom source code on the RPI3 without editing certain files, compiling your own software, or not using certain compiler flag arguments, will lead to compile errors. GZDoom vintage can be compiled on the RPI, the latest releases of GZDoom are not compatible with RPI, because GZDoom requires Opengl 3, the RPI can only use Opengl 2, I''ll post a short guide on compiling GZDoom, the GZDoom vintage releases are compatible with Opengl 2 GPU's, and are more up to date compared to QZDoom builds, which was last updated June 2018.

Here is a link to all of the dependencies you will need to compile QZDoom for RPI3:
https://zdoom.org/wiki/Compile_ZDoom_on_Raspberry_Pi

Here is a link to how to compile QZDoom on Linux, copy and paste all of the dependencies under the Debian/Ubuntu section, we are not using the instructions, because those instructions are for x86/x64 CPUs:
https://zdoom.org/wiki/Compile_GZDoom_on_Linux

Download the QZDoom source code, then unzip the file, after unzipping, open the terminal:

Code: Select all

cd /home/pi/"QZDoom folder location"

Code: Select all

sudo cmake /home/pi/"QZDoom folder location" -DCMAKE_C_FLAGS="-O1 -mcpu=cortex-a7 -mfloat-abi=hard -mfpu=neon-vfpv4" -DCMAKE_CXX_FLAGS="-O1 -mcpu=cortex-a7 -mfloat-abi=hard -mfpu=neon-vfpv4" 

Code: Select all

sudo make
The CFlag arguments are intended for the RPI2, because within the QZDoom makefile mentions ARMv7-a CPUS and below, don't use the RPI3b+ optimizations or compiling the source code will lead to segmentation fault, if segmentation fault does occur, then compile without CFlag arguments, if you are compiling on a different RPI, then you need to know which CFlag arguments are compatible with your RPI computer, here is a list of compiler optimizations:

https://gist.github.com/fm4dd/c66321793 ... c81b0aa845

You can use "sudo make -j4" to compile faster, this can cause your computer to freeze or overheat, because the computer will always be at 100% utilization, using "sudo make" or "sudo make -j2" will take longer to compile the source code, this is safer to use, compiling can take 30 minutes to 1 hour. After compiling the source code, copy and paste "doom.wad" or other IWAD file into the QZDoom folder, then open the terminal to run the QZDoom program:

Code: Select all

cd /home/pi/"QZDoom folder location"

Code: Select all

sudo ./qzdoom
To enable dynamic lights you will need QZDoom to load .pk3 files, you will need access to the QZDoom config file which will be located in the /root directory, to access the /root directory on the RPI open the terminal:

Code: Select all

sudo su

Code: Select all

cd /root

Code: Select all

cd .config

Code: Select all

cd qzdoom

Code: Select all

nano qzdoom.ini

Code: Select all

exit
Here is a shortcut to qzdoom.ini, access the folder using the "su" command:

Code: Select all

cd /root/.config/qzdoom

Code: Select all

nano qzdoom.ini

Code: Select all

exit
The QZDoom folder in the /root directory will be located in a hidden folder, to see hidden files in the terminal after using the "sudo su" command, use the command:

Code: Select all

ls -a
Check the terminal to see if the .pk3 files were loaded, if the files were not loaded, then try editing the qzdoom.ini that is located in the .config folder in the /home/pi directory, here is the file location:

Code: Select all

/home/pi/.config/qzdoom
Inside the /home/pi/"QZDoom folder location," you will see 4 .pk3 files, we need to auto load "lights.pk3" and "brightmaps.pk3" to enable dynamic lights, here is a guide that shows you how to enable autoloading in QZDoom:

https://zdoom.org/wiki/How_to_autoload_files

During the "nano qzdoom.ini" command, scroll all the way down the text file until you see [doom.Autoload], you need to determine which .wad file you are using with QZDoom to determine where to load the .pk3 files in the text file, here is a example of loading the .pk3 files if you are running Ultimate Doom or Doom 1993:

[doom.Autoload]
Path=/home/pi/"QZDoom folder location"/"Base-Game".wad
Path=/home/pi/"QZDoom folder location"/lights.pk3
Path=/home/pi/"QZDoom folder location"/brightmaps.pk3

Any .wad file that is located in the /home/pi/"QZDoom folder location" will be loaded into QZDoom automatically, to use a certain .wad file or a different .wad file, you should only store 1 .wad file in the QZDoom folder.

After editing the qzdoom.ini file, save the file and exit the terminal, enabling dynamic lights will reduce your frame rates significantly, expect to see slowdown in outdoor areas, or areas with large numbers of enemies in one location, expect to see reduced frame rates between 10 - 20 FPS at 720p with dynamic lights, without dynamic lights, the frame rate will be more stable, not dropping below 30 fps at 720p.

Will update this post later, you need to enable Full KMS drivers (OpenGL) in raspi-config or the game will not launch. Here is how you open raspi-config, open the terminal:

Code: Select all

sudo raspi-config
Then select Advanced Options - GL driver - GL Full KMS

*Update May 24 2019
-Removed miscellaneous content
-Added qzdoom.ini troubleshooting explanation
-Added doom.autoload explanation
-Added miscellaneous explanations

*Update May 12 2019
-Updated QZDoom instead of GZDoom explanation, included updates on GZDoom build for RPI.
-Added qzdoom.ini shortcut to sudo su command explanation
-Edited miscellaneous explanations
-Edited qzdoom.ini shortcut code
-Added description to raspi-config explanation

Return to “Gaming”