Skip to content

Instantly share code, notes, and snippets.

@SingingBush
Last active May 28, 2023 18:20
Show Gist options
  • Save SingingBush/893d96a1d0459925e968dd1558a30e90 to your computer and use it in GitHub Desktop.
Save SingingBush/893d96a1d0459925e968dd1558a30e90 to your computer and use it in GitHub Desktop.
Developing mods and maps for Doom 3 (dhewm3)

Developing mods and maps for Doom 3 (dhewm3)

Getting Doom 3

It's worth getting Doom 3 from the Steam store as it includes:

  • The original DOOM 3
  • Resurrection of Evil Expansion
  • DOOM 3: BFG Edition

You'll need the game data when setting up dhewm3

Geeting dhewm3

Since Doom 3 was open-sourced the only project that's really taken advantage of the source is dhewm3. The maintainer, Daniel Gibson, has done a great job in ensuring that the code can compile on multiple systems and is kept up to date.

I found the release builds of dhewm3 to be fairly behind. Potentially you could download a pre-built binary but I preferred to clone the repo and compile it myself (at least on Linux).

On Fedora I needed to install the following dependencies:

sudo dnf install cmake zlib-devel libcurl-devel SDL2-devel openal-soft-devel -y

Then from the project root, run the following to build it:

mkdir build
cd build/
cmake ../neo/
make -j8
sudo make install

You'll need to copy the Doom 3 data files (pk4 files) into /usr/local/share/dhewm3:

/usr/local/share/dhewm3
├── base
│   ├── game01.pk4
│   ├── game02.pk4
│   ├── game03.pk4
│   ├── pak000.pk4
│   ├── pak001.pk4
│   ├── pak002.pk4
│   ├── pak003.pk4
│   ├── pak004.pk4
│   ├── pak005.pk4
│   ├── pak006.pk4
│   ├── pak007.pk4
│   └── pak008.pk4
└── d3xp
    ├── game01.pk4
    ├── game02.pk4
    ├── game03.pk4
    └── pak001.pk4

Resources

Over the years many online resources have now become unavailable. Fortunately Daniel Gibson (the dhewm3 maintainer) has salvaged both modwiki.net and iddevnet.com and made them available via the dhewm3.org website:

In 2019 Tomas Barak posted 17 "Modding Doom 3" videos on youtube. This is an amazingly helpful resource and should be referred to by anyone interested in creating content for Doom 3: https://www.youtube.com/watch?v=pqDjm0pMZu4&list=PLSg9qRQr3OUHmDA9mHUX0IjP0l_5RAFVV

Making a mod (dhewm)

The dhewm3-sdk should be forked then any required changed can be made to the source and the project should get compiled. See existing branches for other mods for examples of what can be done, such as:

Making a level

Doom 3 Editor (Windows only)

Doom 3 ships with it's own editor (on Windows) which can be accessed from within the games terminal but entering editor. Note that Doom should not be running in full screen mode.

To make this more convenient to access, it's worth creating a shortcut specifically for launching the editor that ensures the game is run in windowed mode at a smaller resolution than your monitor:

dhewm3 +editor +r_fullscreen 0 +r_mode 7

Note that the possible values for r_mode are:

  • -1 : Tells the game to use the values for r_customHeight and r_customWidth to set screen width and height
  • 3 : 640 x 480
  • 4 : 800 x 600
  • 5 : 1024 x 768
  • 6 : 1152 x 864
  • 7 : 1280 x 1024
  • 8 : 1600 x 1200

Note that dhewm3 added support a bunch of other values for r_mode:

  • 9 : 1280 x 720
  • 10 : 1366 x 768
  • 11 : 1440 x 900
  • 12 : 1400 x 1050
  • 13 : 1600 x 900
  • 14 : 1680 x 1050
  • 15 : 1920 x 1080
  • 16 : 1920 x 1200
  • 17 : 2048 x 1152
  • 18 : 2560 x 1600

Dark Radiant (cross-platform, open-source editor)

As the editor in Doom 3 is Windows only (still the case in dhewm3), an alternative needs to be used for Mac or Linux. Dark Radiant can be used to create levels which can be loaded into Doom3

To build the Dark Radiant project from source (on Fedora)

sudo dnf install cmake pkg-config libsigc++20-devel zlib-devel libjpeg-turbo-devel libpng-devel ftgl-devel glew-devel freealut-devel libvorbis-devel gtest-devel eigen3-devel libxml2-devel wxGTK3-devel -y

Then compile the project:

git clone git@github.com:codereader/DarkRadiant.git
cd DarkRadiant
cmake .
make -j8
sudo make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment