Picture Of Old Kid

Compiling Odamex on a Raspberry Pi (3B+/4B)

12/26/2020 by Old Kid

Odamex is a source port of Doom/Doom 2 that features well-implemented TCP/IP network play, a server browser and faithful gameplay to the orginal Doom games. Tonight I worked out how to compile it for my Raspberry Pi 3B+ and 4. I have not tested any other Pi's but I can say the binaries created on the 3B+ work for both versions. This guide uses Raspberry Pi OS.

Thanks to Asriel on the Odamex Discord for helping me sort this out.

References from the Odamex Wiki:

https://odamex.net/wiki/How_to_build_from_source
https://odamex.net/wiki/Required_Libraries
https://odamex.net/wiki/Compiling_using_CMake


1) Install Required Dependencies

To compile, you will need libsdl2-mixer-dev, libwxgtk3.0-dev, and cmake. Fire up the terminal and enter the following commands:

sudo apt-get install libsdl2-mixer-dev

sudo apt-get install libwxgtk3.0-dev

sudo apt-get install cmake

2) Grab Odamex and Create Build Folder

First, make sure you have Git installed on your Pi:

sudo apt update
sudo apt install git

Once Git is installed, navigate to your home directory and grab a "git clone" of Odamex. This example uses 0.8.3 stable commit.

cd ~

git clone https://github.com/odamex/odamex.git --branch=0.8.3

In the source directory (~/odamex), create a folder named 'build'.

cd ~/odamex

mkdir build

3) Compile Odamex

From inside of the build directory, we need to run a cmake command to create our make files.

cd build

cmake .. -DCMAKE_BUILD_TYPE=Release

Now that our make files are created, we can compile. To build Odalaunch, Odaserv, and Odamex, run:

cmake --build .

Note: If you only wanted to build only Odamex (without Odalaunch and Odaserv), add "--target odamex" to the end of the last command.


4) Odamex Binary Files and Odamex.wad

The compiler will make many folders and files in the /odamex/build folder. We only need to be concerned with a few. Let's collect these up into a folder of their own. To make it easy, let's create a folder in our home directory.

mkdir ~/odamex-binary

Now we can copy what we need into there.


Odamex Binary: /home/pi/odamex/build/client/odamex

cp /home/pi/odamex/build/client/odamex ~/odamex-binary

Odamex.wad: /home/pi/odamex/build/wad/odamex.wad

cp /home/pi/odamex/build/wad/odamex.wad ~/odamex-binary

Odasrv Binary: /home/pi/odamex/build/server/odasrv

cp /home/pi/odamex/build/server/odasrv ~/odamex-binary

Odalaunch Binary: /home/pi/odamex/build/odalaunch/odalaunch

cp /home/pi/odamex/build/odalaunch/odalaunch ~/odamex-binary

5) IWADS

We need a Doom or Doom 2 IWAD file to run Odamex. They are going to be called "doom.wad" and "doom2.wad" respectively. Regardless how you acquire these, for simplicity's sake we want to put them in our "~/odamex-binary" folder.


We have a few options:


Buy It

If you buy Doom or Doom 2 on Steam and install it to your Windows PC, you can find the file in your     "\steamapps\common\DOOM\" or "\SteamLibrary\SteamApps\common\Doom 2" folder.

If you skim through my Cross-Compiling ScummVM on a RPi article, you can learn how to FTP files to your RPi from a Windows computer using Filezilla. If you use this approach, put the wad files in our new "~/odamex-binary" directory.

Buy The Ultimate Doom here: https://store.steampowered.com/app/2280/Ultimate_Doom/

Buy Doom 2 here: https://store.steampowered.com/app/2300/DOOM_II/


Fake It

Freedoom is a project that replaces the original IWADs from Doom and Doom 2 with non-copyrighted community created assets (levels, textures, monsters, etc). The idea is that people can enjoy Doom for free.

Download "Freedoom: Phase 1+2" here: https://freedoom.github.io/download.html

Inside the Freedoom zip file are two files we can use, "Freedoom1.wad" and "Freedoom2.wad". Either file will be detected and run in Odamex.


Find It

Proceed at your own risk.

Google is your friend. Try "doom.wad" or "Doom IWADs" and see what you can hunt down.


6) Odalaunch

A simple way to load up Odamex is through Odalaunch. This will allow you to browse and join online servers, as well as boot into a single player game from a GUI. Let's fire it up:

~/odamex-binary/odalaunch

1

Before we can get into the game, we need to make sure Odalaunch knows where our files are located.
Click File - Settings, and navigate to the "File Locations" tab.

2


We need to set the Odamex Path to "/home/pi/odamex-binary". To do so, click on the drop-down bar immediately below "Odamex Path", and select "Other". From here, we can navigate the file explorer to our  "/home/pi/odamex-binary" directory.


For good measure, we can click the second button from the top of the "Wad Directories" field to add a new WAD path. Navigate to "/home/pi/odamex-binary" and click Ok. Click OK in the bottom right to exit the settings menu. If asked to save settings, click "Yes".


To test it out, Click File - Start Odamex (Single Player) to launch the game.


3

Hurray! You are playing Doom on Odamex from a binary you compiled yourself. You might try to hit Esc - Options - Video Modes and toggle to Fullscreen before getting too far into your frag fest.

You can explore the many, many options to configure in Odamex here: https://odamex.net/wiki/Main_Page

Happy fragging on your RPi!


If you just want a copy of my binary for this project, get it here: odamex-0.8.3-rpi-binary.zip
To run this binary, you will need these packages for it to work, install them thusly:

sudo apt-get install libsdl2-mixer-dev

sudo apt-get install libwxgtk3.0-dev



Thanks for sticking around to the end! Email comments and questions to patrickclaytonworking@gmail.com