DRL a.k.a. doomrl, a.k.a, D**m, the Roguelike, version 0.9.9.8 http://drl.chaosforge.org/
This release is dedicated to Jupiter Hell Classic, the newly announced commercial remake/expansion to DRL:
https://store.steampowered.com/app/3126530/Jupiter_Hell_Classic/
If you enjoy this Open Source release, please consider wishlisting and later buying Jupiter Hell Classic! Also, you might be interested in DRL's modern 3D spiritual successor, Jupiter Hell (yes, it's still turn-based :P):
https://store.steampowered.com/app/811320/Jupiter_Hell/
Parts of this codebase date back to 2002, please do not judge! :P
This FreePascal source code release is provided as is. You can try compiling it using the latest version of Lazarus ( http://www.lazarus-ide.org/ ). You will also need the FPC Valkyrie library ( https://github.com/ChaosForge/fpcvalkyrie/ ), version 0.9.0. You will also probably need the binary files of the full game downloadable from http://drl.chaosforge.org/ (in particular the sound, soundhq, music and mp3 folder contents, and the premade drl.wad and core.wad if you don't want to create it yourself).
There are two IDEs available: Visual Studio Code and Lazarus. You should only need one of them.
- Fpcvalkyrie: is the low level engine that manages the core functions of the game world
- Makewad.exe assembles the wad files, which contain the digital assets (sounds) and rules (lua)
- drl.exe is the drl-specific game engine, which references the wads (drl.wad and core.wad)
- Download DRL source from http://drl.chaosforge.org/
- Download the DRL binaries (if you haven't already)
- Copy the following DLLs from the DRL binaries into bin:
- SDL2.dll (true source: https://github.com/libsdl-org/SDL/releases/tag/release-2.32.0)
- SDL_mixer.dll (true source: https://github.com/libsdl-org/SDL_mixer/releases/tag/release-2.6.3)
- SDL_image.dll (true source: https://github.com/libsdl-org/SDL_image/releases/tag/release-2.8.5)
- fmod64.dll (true source: www.fmod.com/download)
- (if referencing v0.9.9.8 or less) mp3\* to (bin\)data\drlhq\music
- (if referencing v0.9.9.8 or less) wavhq\* to (bin\)data\drlhq\sound
- (if referencing v0.9.9.8 or less) wavhq\* to (bin\)data\drllq\sound
- (if referencing v0.9.9.9 or higher) data\drlhq\music\* to (bin\)data\drlhq\music
- (if referencing v0.9.9.9 or higher) data\drlhq\sounds\* to (bin\)data\drlhq\sound
- (if referencing v0.9.9.9 or higher) data\drlhq\sounds\* to (bin\)data\drllq\sound
- Download fpcvalkyrie from https://github.com/ChaosForge/fpcvalkyrie/ to a folder at the same level as the DRL source
- Ensure doomrl and fpcvalkyrie are on the same release branch (e.g. master or development)
DRL uses a few sophisticated Lua tricks however v5.1 specifically is compulsory:
- DRL references the dll by name, and the dynamic headers are written against 5.1.
- Upgrading probably won't work simply due to the changes in env-tables.
- Initially the reason to keep being 5.1 compatible for both DRL and JH was due to LuaJIT compatibility, but that point is moot now.
- Download lua 5.1 (e.g. 5.1.5) from https://sourceforge.net/projects/luabinaries/files/5.1.5/Tools%20Executables/. Unzip it
- Add lua5.1 in your path
- Download fpc (e.g. 3.2.2) from https://sourceforge.net/projects/freepascal/ and install it
- Add fpc to your path
- To build the packages, open a command prompt at the drl root folder and run "lua5.1 makefile.lua". There are also options for lq and hq if you want to change the asset quality.
[Instructions appropriated from https://stephan-bester.medium.com/free-pascal-in-visual-studio-code-e1e0a240a430]
- Download lua 5.1 (e.g. 5.1.5) from https://sourceforge.net/projects/luabinaries/files/5.1.5/Tools%20Executables/. Unzip it
- Add lua5.1 in your path (the location will be referred to as %lua%)
- Download and install Lazarus 64-bit (the location will be referred to as %lazarus%)
- Add %lazarus%\fpc\3.2.2\bin\x86_64-win64 to your path (to support the release package build)
- Add %lazarus%\mingw\x86_64-win64\bin to your path (required for gdb, integrated via the Native Debug extension)
- Install Visual Studio Code
- Open drl.code-workspace
- Install the lua extension (by sumneko)
- Install the OmniPascal - Open Preview (by Wosi)
- Install the Native Debug extension (from WebFreak)
- Manage (the cog)/Settings/User/Extensions/OmniPascal configuration
- Default Development Environment: FreePascal
- Free Pascal Source Path: %lazarus%\fpc\3.2.2
- Lazbuild path: %lazarus%
- In the 'drl' (source) folder, open .vscode/settings.json and update the folders to your locations
- In the status bar you'll see "OmniPascal: Select project". Click and choose drl.lpi (appears to improve the linking experience, although you'll need to do this each time you load the workspace)
- Open drl.code-workspace
- Terminal/Run Task/Build makewad.exe (debug)
- Terminal/Run Task/Build drl.exe (debug)
- Terminal/Run Task/Build drl.wad, core.wad
- Terminal/Run Task/Build the release package (all). This won't work on a windows machine without some adjustments to the build script. You can test all these steps with Terminal/Run Task/Unit test build scripts (noting the release build step may fail).
There seems to be an error when attempting to rebuilding drl.exe after the wads exist. Some further analysis might understand this better and possibly remove the wads prior to recompiling drl.exe. The easiest approach to recover from the situation:
- Terminal/Run Task/Clean Build Folders
- Repeat the Build tasks from step 1.
- Set a breakpoint (F9). For example at the first line of code in drl.pas.
- Run/Start Debugging.
Because the lua code is packaged into the wad file, inline debugging is more difficult. Instead the lua console provides an interface to run commands.
- Run/Start Debugging
- Launch a game
- F1
- Some examples of useful commands are:
- player:exit("the_wall") (Exit and open this level)
- player.inv:add("nuke") (Give me some real firepower)
- player:relocate(coord(10,10)) (Send me to this location)
- You can also use = to print values for classes, methods or properties:
- =player (class)
- =player:get_id() (method)
- =player.id (property)
- =player.eq.weapon.ammo
- =player.eq.weapon:is_damaged()
- Run/Start Debugging
- Start a new game
- There is a myriad of game keys defined in godmode.lua to accelerate the character.
The Lazarus installation is preferred for VS Code (compared with the simpler fpc installation) because using fpc in Windows triggers an error when the debugger is used.
- Download lua 5.1 (e.g. 5.1.5) from https://sourceforge.net/projects/luabinaries/files/5.1.5/Tools%20Executables/. Unzip it
- Add lua5.1 in your path (the location will be referred to as %lua%)
- Download and install Lazarus 64-bit (the location will be referred to as %lazarus%)
- Add %lazarus%\fpc\3.2.2\bin\x86_64-win64 to your path (to support the release package build)
- Open src/makewad.lpi (with Lazarus). Build. You should receive '...bin\makewad.exe: Success'
- Start a command prompt and change to the bin folder. Run makewad.exe
- Open src/drl.lpi. Build. You should receive '...bin\drl.exe: Success'
- Open up the Run\Run Parameters screen. Correct the working directory to point to your bin folder. Also note the Command Line Parameters, which might change the application's behaviour
- Run
- To build the packages, open a command prompt at the drl root folder and run "lua5.1 makefile.lua all". There are also options for lq and hq if you want to change the asset quality.
All code is (C) 2003-2024 Kornel Kisielewicz
Code is distributed under the GPL 2.0 license (see LICENSE file in this folder)
Original art and sprites (0.9.9.7) by Derek Yu, (C) 2003-2024, licensed under CC BY-SA 4.0. Modified version and additions (0.9.9.8+) by Łukasz Śliwiński, (C) 2024, licensed under CC BY-SA 4.0.
All art is distributed under the CC-BY-SA 4.0 license (see LICENSE file in bin/data/drl/graphics).
sincerely, Kornel Kisielewicz ChaosForge