An experimental DOOM Node-Builder that preprocesses maps for the classic DOOM 1 & 2 games, with the option to render cool animations of the BSPs and Block Maps being generated. Written in C++ 17 with SDL2 and Cairo. For both Windows and Unix based systems. WARNING: This utility is still in development, and therefore still contains various bugs that need fixed.
E1M1.mp4
For those of you who are unfamiliar with the technology behind the engine that powered the hit 1993 game DOOM, extensive preprocessing was used beforehand on the level data to speed up the actual game run-time performance. This involved a very clever technique known as a Binary Space Partition(BSP). This process takes the map, which is composed of many 2D lines forming sectors, and then splits it into a series of polygons which are then stored inside a binary tree, with each leaf node containing a convex polygon. While this may sound simple, it is actually quite computationally intensive, and with the hardware of the era, it could take several minutes to do all the calculations just for a single map!
This resulted in a huge boost in the rendering performance, which in turn allowed DOOM to have some of the most revolutionary graphics and game-play of its era, which is one of the contributing factors which helped to make it one of the most iconic games of all time!
I made this software as a fun proof of concept to honor one of my favorite video games. The algorithms employed are almost identical to the ones in ID software's original preprocessing utility, so the data generated by this program is nowhere near on par with other more modern tools. Because of this, I would not recommend using this program to build your maps, and instead look into other tools and solutions. However, what makes this program unique, is its ability to render interesting real-time visualizations of the nodes being built.
To build on Linux, the following dependencies are required:
- CMake (3.8 or newer)
- G++
- SDL2
- Cairo
You may install these on Ubuntu with:
$ sudo apt-get update
$ sudo apt-get install cmake g++ libsdl2-dev libcairo2-dev
Or install them on Arch with:
$ sudo pacman -Syy
$ sudo pacman -S cmake g++ sdl2 cairo
And then to actaully build the program, for all distros, run the following commands in the Terminal:
$ mkdir build
$ cd build
$ cmake .. -DCMAKE_BUILD_TYPE=Release
$ make -j 4
To build on Windows, the following dependencies are required:
And then run the following commands in the Command Prompt:
$ mkdir build
$ cd build
$ cmake .. -G "Visual Studio 17 2022" -DCMAKE_PREFIX="C:\path\to\SDL2;C:\path\to\Cairo"
$ cmake --build . --config Release
Note: Instead of running the very last command, you have the option to alternatively open the generated .sln file and use Visual Studio directly.
A DOOM WAD file is required to use this program. If you do not own DOOM, I suggest using the original shareware WAD which is freely available, and can be found here.
You may then start the NodeBuilder by running:
$ bin/nodebuilder [WAD PATH] [MAPS...] [OPTIONS...]
Add the --draw option to render animations of the BSPs being built.
You may run the Google Test suite with:
$ bin/nodebuilder_tests
- Add WAD loading/saving
- Add BSP generation
- Add Blockmap generation
- Add build animation rendering
- Add Reject generation
- Improve rendering quality
- Add text rendering messages
This software is licensed under the GPL3 license. Copyright © 2022 Zach Collins
Special thanks to ID software for releasing the DOOM engine as open-source. It's been a great tool for learning!