This project is a re-implementation of the game Duke Nukem II, originally released by Apogee Software in 1993. RigelEngine works as a drop-in replacement for the original executable: It reads the original data files and implements (mostly) the same behavior, but runs natively on modern operating systems, and is written in modern C++ code with a completely new architecture under the hood. It is similar to projects like Omnispeak or Commander Genius, which do the same thing for the Commander Keen series of games.
There was never any source code released for the original game, so this project is based on reverse-engineering: A mix of reading the original executable's disassembly and analyzing its behaviour using video captures of the game running in DosBox.
I recently gave a presentation about the project at a local C++ meetup. You can find the slides here.
Here's a short video showcasing the project's current state:
The project is still very much work in progress, but already partially playable. The first level of the Shareware episode is completely playable, the following levels are not completable due to missing game mechanics (e.g. player being able to climb on pipes), but some of the enemies found in those levels are already functional. Overall, roughly 50 % of the functionality found in the original Shareware episode is reimplemented in Rigel Engine so far. The issue list should give a comprehensive overview of what's still missing.
If you're on Linux and running a recent enough Ubuntu/Debian-like distro1, here's how to quickly get the project up and running. Instructions for OS X and Windows can be found further down.
# Install all external dependencies, as well as the CMake build system:
sudo apt-get install cmake libboost-all-dev libsdl2-dev libsdl2-mixer-dev
# Clone the repo and initialize submodules:
git clone [email protected]:lethal-guitar/RigelEngine.git
cd RigelEngine
git submodule update --init --recursive
# Configure and build:
mkdir build
cd build
cmake ..
make
# NOTE: Pass -j<NUM_PROCESSES> to 'make' in order to get multi-core
# compilation, '8' is a good number for a 4-core machine with hyperthreading
# Now run it!
./src/RigelEngine <PATH_TO_YOUR_GAME_FILES>
In order to run RigelEngine, the game data from the original game is required. Both the shareware version and the registered version work.
The game is currently not being sold anymore after the rights to the whole Duke Nukem franchise went to Gearbox, but you can still download the freely available shareware version from the old 3D Realms site - look for a download link for the file 4duke.zip
. You can also find the same file on various websites if you Google for "Duke Nukem 2 shareware".
The download contains an installer which only runs on MS-DOS, but you don't need that - you can simply rename the file DN2SW10.SHR
(also part of the download) to .zip
and open it using your favorite archive manager. After that, you can point RigelEngine to the directory where you extracted the files, and it should work.
If you already have a copy of the game, you can also point RigelEngine to that existing installation.
The only files actually required for RigelEngine are:
NUKEM2.CMP
(the main data file)NUKEM2.F1
,.F2
,.F3
etc. up to.F5
(intro movie files)
Currently, the game will abort if the intro movies are missing, but they aren't mandatory for gameplay, and I'm planning to make them optional in the future.
Since most levels cannot be completed at the moment, only the first level of each episode is accessible
from the main menu. In order to try different levels, you can use the -l
command line option:
# Jump to 6th level of first episode
./src/RigelEngine <PATH_TO_YOUR_GAME_FILES> -l L6
This will skip the intro movies and main menu, and jump straight to the specified level at Medium difficulty.
Other command line options are:
-s
: skip intro movies, go straight to main menu--no-music
: don't play music-h
/--help
: show all command line options
To build from source, a C++ 14 compatible compiler is required. The project has been built successfully on the following compilers:
- Microsoft Visual Studio 2015 (Update 2 or newer)
- gcc 5.4.0
- clang 3.9
Slightly older versions of gcc/clang might also work, but I haven't tried that.
The project depends on the following libraries:
- SDL >= 2.0.4
- SDL_mixer >= 2.0.1
- Boost >= 1.55
The following further dependencies are already provided as submodules or source
code (in the 3rd_party
directory):
- entityx Entity-Component-System framework, v. 1.1.2
- Speex Resampler (taken from libspeex)
- DBOPL AdLib emulator (taken from DosBox)
- Catch testing framework
- atria C++ utilities
Building on OS X works almost exactly like the Linux build, except for getting the dependencies. If you have homebrew, you can get them using the following:
brew install cmake sdl2 sdl2_mixer boost
To build on Windows, you'll need to install CMake and provide binaries for the external dependencies listed above. You can get them using the following links:
In order for CMake (or cmake-gui) to automatically find all dependencies, you can set the following environment variables prior to running CMake:
# Assuming you've used the Boost installer linked above, and installed to BOOST_LOCATION
BOOST_ROOT=<BOOST_LOCATION>
BOOST_LIBRARYDIR=<BOOST_LOCATION>/lib64-msvc-14.0
# These should point to the respective root directory of the unzipped packages linked above
SDL2DIR=<SDL2_LOCATION>
SDL2MIXERDIR=<SDL2_MIXER_LOCATION>
If you're using git-bash on Windows, an easy way to do so is by adding the
corresponding export
commands in your.bashrc
.
Note: All of the above would need slight adjustments in order to create a 32-bit build. Also I haven't tried building 32-bit so far, so it's possible that some additional changes would be necessary.
[1]: I'm using Linux Mint 18, based on Ubuntu 16.04 Xenial Xerus