Git Product home page Git Product logo

dhewm3-sdk's Introduction

dhewm3 Mod SDK

This repository contains an SDK that can be used to create modifications ("mods") for (or port Doom3 mods to) dhewm3.

It contains (mostly) the same source files as the original Doom3 SDK, but these are taken from dhewm3 and are licensed under GPLv3, not the SDK license.
Another small difference is that this is built using CMake instead of SCons + VS Project files.
This means that you need CMake to build it, but don't worry, on Windows it can create a Visual Studio Solution for you so you can program and compile with Visual Studio like you might be used to.

Some ports of existing Mods

This repository also contains ports of existing mods whichs authors released the source under GPL; you can find these in their own branches: Blood Mod, Classic Doom 3, Denton's Enhanced Doom3, Fitz Packerton, Hard Corps, Perfected Doom 3, Scarlet Rivensin: The Ruiner, Doom3: The Lost Mission and Sikkmod

In addition to this repository, there is also the LibreCoop mod that implements Coop gameplay for dhewm3: LibreCoop Github for the source code and LibreCoop on ModDB which has the game data.

You can find Win32 DLLs and Linux x86_64 (amd64) .so libraries of those mods that work with dhewm3 1.5.x at the dhewm3 Github release page (the dhewm3-mods-1.5.* archives).

How to build

On Windows

You need CMake either Visual Studio (2010 and newer have been tested) or MinGW-w64

  1. Clone the dhewm3-sdk git repo
  2. (optional: switch to an existing mods branch: git checkout dentonmod)
  3. create a build directory in your dhewm3-sdk/ directory (build/ or build-dentonmod/ or whatever)
  4. Start the CMake GUI
  5. Select your dhewm3-sdk/ folder for "Where is the source code" and your
    build directory from step 3 for "Where to build the binaries".
  6. Click [Configure], select what you want to build with, e.g. "Visual Studio 15 2017", click [Finish], wait for CMake to do its thing
    • If you're using MinGW you'll have to select your build type now, e.g. Debug (not optimized but debuggable) or Release (optimized and thus faster, but can't be debugged that well).
    • (For Visual Studio you don't have to select a build type now, you can do it in in Visual Studio)
  7. Click [Generate]
  8. Building:
    • If you're using Visual Studio, you should be able to just click [Open Project] to open the generated Project in Visual Studio. You can now compile the SDK in Visual Studio (and of course make your changes to the code).
    • (Untested:) For MinGW, open your MinGW or MSys shell, switch to your build directory and execute make -j4 to build the game DLL
  9. Now it's time to copy the DLL (e.g. dentonmod.dll) to your dhewm3 install, where base.dll and d3xp.dll are
    • For Visual Studio the DLL should be in a subdirectory of your build directory, depending on the build type you selected in build/Debug/ or build/Release/ or similar
    • For MinGW the DLL should be directly in your build directory.
  10. start the game with that mod, like dhewm3 +set fs_game dentonmod

(Make sure to actually have the mods game data in the right directory as well; the directory name should be the same as the game lib name, but without .dll, for example dentonmod/ for dentonmod.dll)

On Linux and other Unix-likes

On Linux and similar the following should work (if you have cmake, make and GCC/g++ installed):

  1. Clone the dhewm3-sdk git repo
  2. switch to your git clone's directory: cd dhewm3-sdk
  3. (optional: switch to an existing mods branch: git checkout dentonmod)
  4. create a build directory: mkdir build
  5. switch to build directory: cd build
  6. create Makefile with CMake: cmake ..
    • by default, this will create an RelWithDebInfo build, which is optimized but still has debug info, so it's somewhat debuggable. You can select another kind of build with cmake -DCMAKE_BUILD_TYPE=Debug .. for a Debug build with less optimization, which will make it easier to debug (but possibly slower). You could also replace "Debug" with "Release" for a proper optimized Release build without any Debug info.
  7. compile the mod .so: make -j4
  8. it (e.g. dentonmod.so) should now be in the build/ directory, copy it to your dhewm3 install, where base.so and d3xp.so are
  9. start the game with that mod, like dhewm3 +set fs_game dentonmod

(Make sure to actually have the mods game data in the right directory as well; the directory name should be the same as the game lib name, but without .so/.dylib, for example dentonmod/ for dentonmod.so)

How to port a Mod to dhewm3

Please note that currently I only accept mods that are released under the GPL license - the one used by Open Source Doom3 (i.e. not only the Doom3 SDK license) - because neither the GPL nor the SDK license allow merging code from both licenses.
So please get permission from the mod authors first.

The usual (easiest) way to port a mod is to make a diff between the mod's source and the Doom3 SDK and apply the resulting patch to the vanilla game source (from the master branch).
Afterwards usually some manual work must be done to resolve patching conflicts and get the mod to compile.
Also, the CMakeLists.txt file must be adjusted (see the dentonmod branch for examples).

Here is the approximate steps I use to port a mod.
Note that you'll need basic C++ (or at least C) programming skills, so you can resolve the little (and sometimes not-so-little) issues that (almost) always occur when porting a mod, like merge conflicts and compiler errors due to missing #includes.

Getting the difference between the original Doom3 SDK and the Mod's source code

IMHO, the easiest way is to use a git repo of the the origin Doom3 SDK source code, copy the modified source from the mod on top and then let git create the diff.

For your convenience, I created such a git repo: https://github.com/DanielGibson/Doom3-SDK

So clone it and switch into its directory, by running the following commands in a terminal (on Windows, use the "Git Bash"):

  • cd doom3dev/ (change into a directory you want to put Doom3 projects in, adjust this to your needs)
  • git clone https://github.com/DanielGibson/Doom3-SDK.git
  • cd Doom3-SDK

Now copy the mod's source code to the correct place in the repo, usually src/ or src/game, replacing the existing files.
git status
shows which files have been changed,
git diff will show the actual differences (but only for files that already exist in the repo!); or use
git gui for a GUI-based overview.

It's possible that the copied files use different line endings than the git repo, in which case git will show lots of changes that are really none.

You can fix the line endings by running the following commands:

  • find -iname "*.cpp" -exec dos2unix {} \;
  • find -iname "*.h" -exec dos2unix {} \;
    • If you're on Windows, use unix2dos instead of dos2unix.

Now create a branch for the mod in your local Doom3-SDK repo and stage all the changes, including added files:

  • git checkout -b mymodname (adjust the name...)
  • git add --all

I recommend using git gui to check if any files have been added that are irrelevant, i.e. files that are not source files but from build directories or in Visual Studio project files or similar (those won't be needed for dhewm3-sdk, it uses CMake to handle the build).
You can unstage files or changes by clicking the file icon left of the filename in the "Staged Changes" list to remove them from the commit (the files/changes are not deleted, they will just not be committed).

If you insist on using the commandline,
git status
will also show the staged files, and you can unstage files with
git rm --cached path/to/file.name
or unstage whole directories with
git rm --cached -r path/to/

Now commit the changes, either on the commandline with
git commit -m "imported mymodname"
or by just typing a commit message in git gui and clicking "Commit" there.

Finally, to get a diff patch you can apply to the dhewm3 SDK, run the following command:
git diff main > ../mymodname.diff

Applying the mod diff to the dhewm3 SDK

First, clone the dhewm3 SDK and create a branch for the new mod, with the following terminal commands (again, on Windows, use the "Git Bash"):

  • cd doom3dev/ (same directory as used in the other step)
  • git clone https://github.com/dhewm/dhewm3-sdk.git
  • cd dhewm3-sdk
  • git checkout -b mymodname

If you've already cloned the repo earlier, make sure to check out the master branch before creating the new branch for your mod, so the new branch is based on the unmodified gamecode, and make sure there are no uncommitted changes:

  • git checkout master
  • git reset --hard HEAD (undo all uncommitted changes)
  • git pull (get the latest changes from the dhewm3-sdk repo)

Now apply the patch with the mod's code with:

patch -p2 -l --merge --no-backup-if-mismatch < ../mymodname.diff

Explanation:

  • -p2 skips an additional directory layer: In the Doom3 SDK the source src/game/, for example, in the dhewm3 SDK it's directly in game/, so src/ must be skipped
  • -l ignore whitespace changes, in case the mod has replaced tabs with spaces or something
  • --merge when there are merge conflicts (patch isn't sure how to apply a change to the dhewm3 SDK), they are marked in the corresponding source files with sections containing the new code and the old code, marked with <<<<<<<, ======= and >>>>>>> (see below)
  • --no-backup-if-mismatch if this is not set, patch will create bla.cpp.orig (containing the original unpatched file) for every file that's patched, we don't want that

Now look very carefully at the output the patch command printed to the terminal!
It often happens that some changes can't be merged automatically, and patch will tell you about that like this:

patching file game/Misc.cpp
Hunk #1 NOT MERGED at 143-148.

This means that one change in game/Misc.cpp could not be merged automatically, so it must be merged manually.
patch then inserts something like this in that file:

 ...
 switch( event ) {
    case EVENT_TELEPORTPLAYER: {
       entityNumber = msg.ReadBits( GENTITYNUM_BITS );
       idPlayer *player = static_cast<idPlayer *>( gameLocal.entities[entityNumber] );
       if ( player != NULL && player->IsType( idPlayer::Type ) ) {
          Event_TeleportPlayer( player );
       }
       return true;
    }
    default:
       break;
    }
<<<<<<<

	return idEntity::ClientReceiveEvent( event, time, msg );
=======
	//	return false;	// sikk - warning C4702: unreachable code
>>>>>>>
}

So open the file and search for "<<<<". The first section (between <<<<<<< and =======) is the existing code of dhewm3-sdk, the second section (between ======= and >>>>>>>) is what that code looked like in the mod you're trying to merge (in this example Sikkmod).

In this case, both Sikkmod and dhewm3 fixed a compiler warning: return idEntity::ClientReceiveEvent( event, time, msg ); used to be in the default: case of switch, and after the switch was return false;, which was unreachable because the function would always return at default: return idEntity::ClientReceiveEvent( event, time, msg ); (if it didn't already return before), and the compiler warned about that unreachable code.
sikk got rid of that warning by commenting out return false;, in dhewm3 we moved the return idEntity::ClientReceiveEvent( event, time, msg ); behind the switch-case - both valid (and equivalent) solutions.

You need to remove the lines with <<<<<<< and ======= and >>>>>>>, and make sure that the code that was in this sections is merged completely, i.e. in a state that works correctly like it did in the mod.

In this example it's simple: Just keep dhewm3's code and remove sikk's change:

...
    switch( event ) {
       case EVENT_TELEPORTPLAYER: {
          entityNumber = msg.ReadBits( GENTITYNUM_BITS );
          idPlayer *player = static_cast<idPlayer *>( gameLocal.entities[entityNumber] );
          if ( player != NULL && player->IsType( idPlayer::Type ) ) {
             Event_TeleportPlayer( player );
          }
          return true;
       }
       default:
          break;
    }
   
    return idEntity::ClientReceiveEvent( event, time, msg );
}

Sometimes it makes sense to open the file from Doom3 SDK and the patched one from dhewm3 SDK side-by-side to compare functions with merge conflicts to see more context from the original file.

If you're really unlucky, patch will show you messages like

patching file d3xp/Item.cpp
Hunk #1 merged at 653.
misordered hunks! output would be garbled
Hunk #2 FAILED at 77.
misordered hunks! output would be garbled
Hunk #3 FAILED at 109.
2 out of 4 hunks FAILED -- saving rejects to file d3xp/Item.cpp.rej

This means that it has no idea whatsoever where that code from the patch belongs, and it will not create such a merge-conflict section in the file as shown above. In that case you'll have to check the .rej files for what changes have been omitted and try to merge them manually. In this case, even the first hunk (which was supported to be around line 50) was, for reasons unclear to me, merged at the totally wrong location so it must be fixed as well.

When merging the changes for a file fails completely, it can help to use a graphical diff and merge tool like meld or kdiff3 or Beyond Compare to compare the file from the Doom3 SDK and the one from the dhewm3 SDK and merge the changes in there.
However note that it will also show you differences that are unrelated to the mod, like fixes made in dhewm3 - and the first lines of the file are always different, because in the dhewm3 SDK they contain the GPL license note from the Doom3 GPL release, while in the original Doom3 SDK there usually is only a very short comment like

// Copyright (C) 2004 Id Software, Inc.
//

This is also the reason why it's easiest to create a diff in the Doom3 SDK and apply that diff in the dhewm3 SDK (instead of using a merge tool on all files, for example): The diff only contains the changes made in the SDK, so those copyright notices are not in the diff (unless the Mod author changed those lines), and don't create merge conflicts in dhewm3 code.

In my experience, most of the changes from the patch are merged without any conflict, and then you'll have a handful of Hunk #X NOT MERGED errors that at least can be resolved within the file.
I've only ever seen the Hunk #X FAILED error in one project..


Anyway, when you think you've resolved all merge conflicts, you can make double-sure like this:

grep -r "<<<<"
and
grep -r ">>>>"

both shouldn't find anything, at least not in .cpp or .h files.

Once all merge conflicts are resolved, remove any .rej files and commit the changes, like described above (or just use git gui for that).
Don't forget to also commit added source files, if any - in fact, remember which (source) files were added, because they're needed in the next step!

Build the Mod for dhewm3

Now edit CMakeLists.txt.

If the mod only uses the code in game/, you can set the ON in option(D3XP "Build the d3xp/ game code" ON) to OFF, if it only uses the code in d3xp/, you can do the same for option(BASE ... (if both are used, i.e. the mod builds two DLLs, one for the base game and one for Resurrection of Evil, leave those options as they are).

Make sure to adjust BASE_NAME and/or D3XP_NAME according to the mod directory name, for example, the Classic Doom 3 mod directory is called cdoom and it uses the source code in game/, so the line is adjusted like set(BASE_NAME "cdoom" CACHE STRING "Name of the mod...").

If the mod requires definitions passed to the compiler (like -DMY_OPTION for #ifdef MY_OPTION), adjust BASE_DEFS and/or D3XP_DEFS accordingly.

Last but not least, if the mod adds any source files to the SDK (instead of just modifying the existing ones), add them to src_game_mod or src_d3xp_mod.

Look at the CMakeLists.txt of the Rivensen Mod for an example that does several of the things mentioned above (disable D3XP DLL, set custom compiler definitions, add custom source files).

Once that's done, you can finally try to build the mod, as described in the How to build section.

You'll likely get compiler errors because of missing includes, or maybe there's #include "../idlib/precompiled.h" or similar somewhere which is an error because dhewm3 doesn't have precompiled.h (so remove that). It's usually best to scroll up to the first compiler error and fix it (for example, if it complains that unknown type is used, that type is likely defined in a header that must be included) and retry building, because often further errors are caused by the first one, and fixing it fixes several others as well, so by building again after fixing the first you'll see which errors remain.

Getting in touch

If you are a mod author and want to release your mod's sourcecode under GPL, but don't want to port it yourself (or don't have time or are unsure how) please contact me, I can probably help you :-)

The easiest way to contact me is by creating an issue in this Github repository, or by sending a DM to caedes in the id Tech Forums or by pinging caedes in the #iodoom3 IRC channel on FreeNode.
If you prefer E-Mail, you can find my address in the git commits.

New features that mods can use

dhewm3 has some features that the original Doom3 didn't have that are interesting for Mods.

The Script Debugger

dhewm3 1.5.2 and newer contain the Script Debugger (that you may remember from Quake4).
While most of the code for it is in the engine, the game code also needs some small changes for it to work.

The debugger branch has the necessary changes in its last commit.

Injecting all supported resolutions into the video menu

Mods that have their own video settings menu can tell dhewm3 to replace the "choices" and "values" entries in their choiceDef with the resolutions supported by dhewm3 (and corresponding modes).
So if we add new video modes to dhewm3, they'll automatically appear in the menu without changing the .gui
To enable this, you only need to add a injectResolutions 1 entry to the resolution choiceDef. By default, the first entry will be "r_custom*" for r_mode -1, which means "custom resolution, use r_customWidth and r_customHeight".
If the "r_custom*" entry should be disabled for your mod, just add another entry: injectCustomResolutionMode 0

Scale GUIs to 4:3

Fullscreen menus (like the main menu and the PDA) are scaled to 4:3 by default, adding black bars on the left/right when using widescreen resolutions (users can disable this with r_scaleMenusTo43 0).
By default, this is not done for other GUIs, mainly because the HUD is a fullscreen GUI and also handles damage effects (coloring the whole screen red), which would look shitty if scaled to 4:3 with black/empty bars on the left/right.
However, you can still enable this for your WIN_DESKTOP GUIs, either in the .gui itself or via C++ code when loading the GUI (I found this especially useful for the crosshairs/cursor GUI).

WIN_DESKTOP means that this can currently only be set for the top-level window in a .gui (all its subwindows/widgets will be scaled implicitly).

There are two ways to make a GUI use this:

  1. in the .gui add a window variable scaleto43 1, like

     windowDef Desktop {
     rect	0 ,0 ,640 ,480
     nocursor	1
     float	talk 	0
    
     scaleto43 1
    
     // .. etc rest of windowDef
    
  2. When creating the GUI from C++ code, you can afterwards make the UserInterface scale to 4:3 like this:

     idUserInterface* ui = Whatever(); // create it
     ui->SetStateBool("scaleto43", true);
     ui->StateChanged(gameLocal.time);

    Both lines are important!

    Keep in mind that if the GUI is saved to the savegame, you need to call this after restoring the GUI from the savegame, see https://github.com/dhewm/dhewm3-sdk/commit/5070b8c7ec6f3a8ba1cb4123de37732f9cd9437f for an example.

    Also note that you can not generally inject variables into GUIs like that from C++, dhewm3 has special code to make the "scaleto43" case work.

dhewm3-sdk's People

Contributors

andre-d avatar coldtobi avatar danielgibson avatar devnexen avatar jayaddison avatar kalamatee avatar kevindqc avatar leffmann avatar scottwakeling avatar svdijk avatar turol avatar yamagi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dhewm3-sdk's Issues

Dentommod: Screen artifact with mussleflashes for guns

artifects-mussleflash.mp4

Details

Not sure what is happening here. Made a short video to show you the effect.

Version

1.5.4 RC2, which you can find here: flathub/org.dhewm3.Dhewm3#26

Basic details

config.spec	    game00.pk4	game03.pk4   pak000.pk4  pak003.pk4  pak006.pk4  savegames
consolehistory.dat  game01.pk4	gamex86.dll  pak001.pk4  pak004.pk4  pak007.pk4  screenshots
DoomConfig.cfg	    game02.pk4	maps	     pak002.pk4  pak005.pk4  pak008.pk4  STEAM_doomkey
dhewm3 1.5.4rc2.1305 linux-x86_64 Jul 28 2024 13:37:42 using SDL v2.28.5
SDL video driver: wayland
Logging console output to /home/kevin/.var/app/org.dhewm3.Dhewm3/data/dhewm3/dhewm3log.txt
terminal support enabled ( use +set in_tty 0 to disable )
pid: 4
64000 MB System Memory
found interface lo - loopback
found interface wlp0s20f3 - 192.168.1.172/255.255.255.0
doom using MMX & SSE & SSE2 for SIMD processing
enabling Flush-To-Zero mode
enabling Denormals-Are-Zero mode
----- Initializing File System -----
Loaded pk4 /home/kevin/.var/app/org.dhewm3.Dhewm3/data/dhewm3/base/pak000.pk4 with checksum 0x28d208f1
Loaded pk4 /home/kevin/.var/app/org.dhewm3.Dhewm3/data/dhewm3/base/pak001.pk4 with checksum 0x40244be0
Loaded pk4 /home/kevin/.var/app/org.dhewm3.Dhewm3/data/dhewm3/base/pak002.pk4 with checksum 0xc51ecdcd
Loaded pk4 /home/kevin/.var/app/org.dhewm3.Dhewm3/data/dhewm3/base/pak003.pk4 with checksum 0xcd79d028
Loaded pk4 /home/kevin/.var/app/org.dhewm3.Dhewm3/data/dhewm3/base/pak004.pk4 with checksum 0x765e4f8b
Loaded pk4 /home/kevin/.var/app/org.dhewm3.Dhewm3/data/dhewm3/base/pak005.pk4 with checksum 0x8ffc3621
Loaded pk4 /home/kevin/.var/app/org.dhewm3.Dhewm3/data/dhewm3/base/pak006.pk4 with checksum 0x95b65ab
Loaded pk4 /home/kevin/.var/app/org.dhewm3.Dhewm3/data/dhewm3/base/pak007.pk4 with checksum 0x666bdb3c
Loaded pk4 /home/kevin/.var/app/org.dhewm3.Dhewm3/data/dhewm3/base/pak008.pk4 with checksum 0x23ae5993
Current search path:
/home/kevin/.var/app/org.dhewm3.Dhewm3/config/dhewm3/base
/home/kevin/.var/app/org.dhewm3.Dhewm3/data/dhewm3/base
/home/kevin/.var/app/org.dhewm3.Dhewm3/data/dhewm3/base/pak008.pk4 (3 files)
/home/kevin/.var/app/org.dhewm3.Dhewm3/data/dhewm3/base/pak007.pk4 (38 files)
/home/kevin/.var/app/org.dhewm3.Dhewm3/data/dhewm3/base/pak006.pk4 (48 files)
/home/kevin/.var/app/org.dhewm3.Dhewm3/data/dhewm3/base/pak005.pk4 (63 files)
/home/kevin/.var/app/org.dhewm3.Dhewm3/data/dhewm3/base/pak004.pk4 (5137 files)
/home/kevin/.var/app/org.dhewm3.Dhewm3/data/dhewm3/base/pak003.pk4 (4676 files)
/home/kevin/.var/app/org.dhewm3.Dhewm3/data/dhewm3/base/pak002.pk4 (6120 files)
/home/kevin/.var/app/org.dhewm3.Dhewm3/data/dhewm3/base/pak001.pk4 (8972 files)
/home/kevin/.var/app/org.dhewm3.Dhewm3/data/dhewm3/base/pak000.pk4 (2698 files)
/app/share/dhewm3/base
Addon pk4s:
----- Initializing Decls -----
5206 strings read from strings/english.lang
Couldn't open journal files
execing editor.cfg
execing default.cfg
execing dhewm.cfg
couldn't exec autoexec.cfg
5206 strings read from strings/english.lang
----- Initializing OpenAL -----
Setup OpenAL device and context
OpenAL: found device 'Built-in Audio Analog Stereo'
OpenAL: found extension for HRTF
OpenAL: found extensions for resetting disconnected devices
OpenAL: found extension to control output-limiter
OpenAL vendor: OpenAL Community
OpenAL renderer: OpenAL Soft
OpenAL version: 1.1 ALSOFT 1.23.1
OpenAL: found EFX extension
OpenAL: found 256 hardware voices
----- Initializing OpenGL -----
Initializing OpenGL subsystem
Will create a fullscreen-window with resolution 1920x1080 (r_mode = 15)
SDL detected 2 displays: 
 0: 1920x1080 at (0, 0) to (1920, 1080)
 1: 1920x1080 at (1920, 0) to (3840, 1080)
Will use display 0 because mouse cursor is at (0, 0).
Got a fullscreen window with resolution 1920 x 1080
Requested 8 color bits per chan, 8 alpha 24 depth, 8 stencil
Got 8 stencil bits, 24 depth bits, color bits: r8 g8 b8 a8
Initializing ImGui
Detected keyboard layout as "english"
OpenGL vendor: Intel
OpenGL renderer: Mesa Intel(R) Graphics (RPL-P)
OpenGL version: 4.6 (Compatibility Profile) Mesa 24.1.3 (git-0c49f54c76)
...using GL_ARB_multitexture
...using GL_ARB_texture_env_combine
...using GL_ARB_texture_cube_map
...using GL_ARB_texture_env_dot3
...using GL_ARB_texture_env_add
...using GL_ARB_texture_non_power_of_two
...using GL_ARB_texture_compression
...using GL_EXT_texture_compression_s3tc
...using GL_EXT_texture_filter_anisotropic
   maxTextureAnisotropy: 16
...using GL_1.4_texture_lod_bias
X..GL_EXT_shared_texture_palette not found
...using GL_EXT_texture3D
...using GL_EXT_stencil_wrap
...using GL_EXT_stencil_two_side
...got GL2.0+ glStencilOpSeparate()
...using GL_ARB_vertex_buffer_object
...using GL_ARB_vertex_program
...using GL_ARB_fragment_program
...using EXT_depth_bounds_test
...found GL_ARB_debug_output, but not using it (r_glDebugContext is not set)
ARB2 renderer: Available.
----- R_ReloadARBPrograms -----
glprogs/test.vfp
glprogs/test.vfp
glprogs/interaction.vfp
glprogs/interaction.vfp
glprogs/bumpyEnvironment.vfp
glprogs/bumpyEnvironment.vfp
glprogs/ambientLight.vfp
glprogs/ambientLight.vfp
glprogs/shadow.vp
glprogs/environment.vfp
glprogs/environment.vfp
glprogs/arbVP_glasswarp.txt: File not found
glprogs/arbFP_glasswarp.txt: File not found
<internal> soft_particle.vfp
<internal> soft_particle.vfp
using ARB_vertex_buffer_object memory
using ARB2 renderSystem
Will apply r_gamma and r_brightness in shaders (r_gammaInShader 1)
loaded game library '/app/lib/dhewm3/base.so'.
game using MMX & SSE & SSE2 for SIMD processing
Flush-To-Zero mode is already enabled
Denormals-Are-Zero mode is already enabled
----- Initializing Game -----
gamename: baseDOOM-1
gamedate: Jul 28 2024
Initializing event system
...473 event definitions
Initializing class hierarchy
...142 classes, 764368 bytes for event callbacks
Initializing scripts
Compiled 'script/doom_main.script': 274 ms
----- Compile stats -----
Memory usage:
     Strings: 79, 10288 bytes
  Statements: 67875, 2172000 bytes
   Functions: 2109, 318020 bytes
   Variables: 170888 bytes
    Mem used: 3937768 bytes
 Static data: 3558984 bytes
   Allocated: 5109956 bytes
 Thread size: 14056 bytes
...6 aas types

Spelling

I recommend mussles with brown bear. Gives them a slightly sweet flavour, with a lot of texture.

Doom3[CC]: Current state and what still needs to be done

Ok, the current state compiles and kinda works..
You can find it in this repository in the doom3cc branch

Still TODO (likely incomplete): likely only d3cclib/* needs to be modified, and the integration into the rest of the gamecode code is complete - but of course it's no problem if we need to do additional changes to the gamecode after all:

  • Make language selection work, I think ccBst::initLanguages() in d3cclib/CCBst.cpp was supposed to do that, but it's not called from anywhere in the code I got from Víctor - likely it was still WIP or he didn't get the final code?
  • memory leak: ccBst::Tree is not deleted completely (only the root node, not the rest of the tree)
  • several memory leaks, see all the TODOs and FIXMEs I added to the code
  • Resurrection of Evil (d3xp) support - easy enough, we only need to replicate the changes done in game/ there and do like two small additions/modifications to the cmake file
  • English translations that are missing and for RoE
  • Document how to integrate D3CC into other mods; there is a PDF describing the process but there's at least one additional thing that I added (I can do this part, should not take me too long)
  • On/Off option (CVar, maybe setting in menu) for the radar in the HUD
  • proper sub appearances or proper sub line counting (see #12 (comment))
  • Separate GUI for subtitles (instead of in HUD), see same comment as before
  • Subtitles canceling: When playing audio logs or videodiscs from within the PDA, stopping the playback does not stop the subtitles playback.
  • Enhancing subtitle priority system somehow, let user choose what to see (e.g. no SFX descriptions), see #12 (comment) and following
  • Something's wrong with the timings, should be fixed if possible (see #12 (comment))
  • Animation speed for scrolling captions, depending on a mix of duration and text length (see #12 (comment))
  • Some way to find out (in mod DLL) how many lines a string will need when rendered (see #12 (comment))
  • Once it all works, port it back to the original Doom3 SDK so it also works with vanilla Doom3 1.3.1
    (I guess this is just diffing this branch against the dhewm3 SDK's master branch and then applying the resulting patch to the Doom3 SDK and fix the minor merge issues that might occur, shouldn't be too hard, we have no changes here that are dhewm3 specific)

Planning an SDK port for the mod "Perfected Doom 3"

I would like to contribute to the Dhewm3 source port by making my favorite mod playable on it. So I did the direct way of adding the source code to the sdk repository and compile the .so files (I'm on Linux)

However when I run the executable with './dhewm3 +set fs_game perfected' I'm getting an error message:

----- Game Map Shutdown -----


ERROR: Error: file script/doom_events.script, line 13: Unknown event 'isLowered'

I don't know how I can address this so any help would be appreciated.

EDIT: I tried to redo the .so file since I didn't take into account the added .cpp and .h files in both the game and d3xp folders.

However when I try to recompile the .so files I get this error message:

/home/username/dhewm3/dhewm3-sdk-perfected/game/../idlib/../renderer/qgl.h:45:10: fatal error: SDL_opengl.h: No such file or directory
45 | #include <SDL_opengl.h>
| ^~~~~~~~~~~~~~

I installed and compiled the latest release of SDL2 and is in fact located at /usr/include/SDL2

I don't know what is wrong now.

[d3le] Missing Sounds in The Lost Mission mod

In Version 1.3 there still seem to be lots of missing sounds.

Pinging @Arl90 as these are bugs in the game data, not in the code, so they should ideally be fixed in a future d3le update.

Just starting the first level (le_enpro1) will give lots of warnings, and occasionally you will hear that beep sound (with s_playDefaultSound 1 which is default):

WARNING: Couldn't load sound 'sound/_reissue/ambient_events/metallic_noises/heavy_water_pipes_01/hwpipe_06.wav' using default
WARNING: Couldn't load sound 'sound/_reissue/ambient_events/metallic_noises/heavy_water_pipes_01/hwpipe_07.wav' using default
WARNING: Couldn't load sound 'sound/_reissue/ambient_events/metallic_noises/heavy_water_pipes_01/hwpipe_08.wav' using default
WARNING: Couldn't load sound 'sound/_reissue/ambient_events/metallic_noises/heavy_water_pipes_01/hwpipe_09.wav' using default
WARNING: Couldn't load sound 'sound/_reissue/ambient_events/metallic_noises/reverberant_metal_creaks_s1/reverberant_metal_creak_s1_06.wav' using default
WARNING: Couldn't load sound 'sound/_reissue/ambient_events/metallic_noises/reverberant_metal_creaks_s1/reverberant_metal_creak_s1_07.wav' using default
WARNING: Couldn't load sound 'sound/_reissue/ambient_events/metallic_noises/reverberant_metal_creaks_s1/reverberant_metal_creak_s1_08.wav' using default
WARNING: Couldn't load sound 'sound/_reissue/ambient_events/metallic_noises/reverberant_metal_creaks_s1/reverberant_metal_creak_s1_09.wav' using default
WARNING: Couldn't load sound 'sound/_reissue/ambient_events/metallic_noises/reverberant_metal_creaks_s1/reverberant_metal_creak_s1_10.wav' using default
WARNING: Couldn't load sound 'sound/_reissue/ambient_events/metallic_noises/reverberant_metal_creaks_s1/reverberant_metal_creak_s1_11.wav' using default
WARNING: Couldn't load sound 'sound/_reissue/ambient_events/metallic_noises/reverberant_metal_creaks_s1/reverberant_metal_creak_s1_12.wav' using default
WARNING: Couldn't load sound 'sound/_reissue/ambient_events/metallic_noises/reverberant_metal_creaks_s1/reverberant_metal_creak_s1_13.wav' using default
WARNING: Couldn't load sound 'sound/_reissue/ambient_events/metallic_noises/reverberant_metal_creaks_s1/reverberant_metal_creak_s1_14.wav' using default
WARNING: Couldn't load sound 'sound/_reissue/ambient_events/metallic_noises/reverberant_metal_creaks_s1/reverberant_metal_creak_s1_15.wav' using default
WARNING: Couldn't load sound 'sound/_reissue/ambient_events/metallic_noises/reverberant_metal_creaks_s1/reverberant_metal_creak_s1_16.wav' using default
WARNING: Couldn't load sound 'sound/_reissue/ambient_events/metallic_noises/reverberant_metal_creaks_s1/reverberant_metal_creak_s1_17.wav' using default
WARNING: Couldn't load sound 'sound/_reissue/ambient_events/metallic_noises/reverberant_metal_creaks_s1/reverberant_metal_creak_s1_18.wav' using default
WARNING: Couldn't load sound 'sound/_reissue/ambient_events/metallic_noises/reverberant_metal_creaks_s1/reverberant_metal_creak_s1_19.wav' using default
WARNING: Couldn't load sound 'sound/_reissue/ambient_events/metallic_noises/reverberant_metal_creaks_s1/reverberant_metal_creak_s1_20.wav' using default
WARNING: Couldn't load sound 'sound/_reissue/ambient_events/metallic_noises/reverberant_metal_creaks_s1/reverberant_metal_creak_s1_21.wav' using default
WARNING: Couldn't load sound 'sound/_reissue/ambient_events/metallic_noises/reverberant_metal_creaks_s1/reverberant_metal_creak_s1_22.wav' using default
WARNING: Couldn't load sound 'sound/_reissue/ambient_events/metallic_noises/reverberant_metal_creaks_s1/reverberant_metal_creak_s1_23.wav' using default
WARNING: Couldn't load sound 'sound/_reissue/ambient_events/metallic_noises/reverberant_metal_creaks_s1/reverberant_metal_creak_s1_24.wav' using default
WARNING: Couldn't load sound 'sound/_reissue/ambient_events/metallic_noises/reverberant_metal_creaks_s1/reverberant_metal_creak_s1_25.wav' using default
WARNING: Couldn't load sound 'sound/_reissue/ambient_events/metallic_noises/reverberant_metal_creaks_s1/reverberant_metal_creak_s1_26.wav' using default
WARNING: Couldn't load sound 'sound/_reissue/ambient_events/metallic_noises/reverberant_metal_creaks_s1/reverberant_metal_creak_s1_27.wav' using default
WARNING: Couldn't load sound 'sound/_reissue/ambient_events/metallic_noises/reverberant_metal_creaks_s1/reverberant_metal_creak_s1_28.wav' using default
WARNING: Couldn't load sound 'sound/_reissue/ambient_events/metallic_noises/reverberant_metal_stresses_s3/metal_stressverb_06.wav' using default
WARNING: Couldn't load sound 'sound/_reissue/ambient_events/metallic_noises/reverberant_metal_stresses_s3/metal_stressverb_07.wav' using default
WARNING: Couldn't load sound 'sound/_reissue/ambient_events/metallic_noises/reverberant_metal_stresses_s3/metal_stressverb_08.wav' using default
WARNING: Couldn't load sound 'sound/_reissue/ambient_events/metallic_noises/reverberant_metal_stresses_s3/metal_stressverb_09.wav' using default
WARNING: Couldn't load sound 'sound/_reissue/ambient_events/pipe_moans/pipe_moans_s1/pipe_moans_s1_06.wav' using default
WARNING: Couldn't load sound 'sound/_reissue/ambient_events/pipe_moans/pipe_moans_s1/pipe_moans_s1_07.wav' using default
WARNING: Couldn't load sound 'sound/_reissue/ambient_events/pipe_moans/pipe_moans_s1/pipe_moans_s1_08.wav' using default
WARNING: Couldn't load sound 'sound/_reissue/ambient_events/pipe_moans/pipe_moans_s1/pipe_moans_s1_09.wav' using default
WARNING: Couldn't load sound 'sound/_reissue/ambient_events/pipe_moans/pipe_moans_s1/pipe_moans_s1_10.wav' using default
WARNING: Couldn't load sound 'sound/_reissue/ambient_events/pipe_moans/pipe_moans_s1/pipe_moans_s1_11.wav' using default
WARNING: Couldn't load sound 'sound/_reissue/ambient_events/pipe_moans/pipe_moans_s1/pipe_moans_s1_12.wav' using default
WARNING: Couldn't load sound 'sound/_reissue/ambient_events/pipe_moans/pipe_moans_s1/pipe_moans_s1_13.wav' using default
WARNING: Couldn't load sound 'sound/_reissue/ambient_events/pipe_moans/pipe_moans_s1/pipe_moans_s1_14.wav' using default
WARNING: Couldn't load sound 'sound/_reissue/ambient_events/pipe_moans/pipe_moans_s1/pipe_moans_s1_15.wav' using default
WARNING: Couldn't load sound 'sound/_reissue/ambient_events/pipe_moans/pipe_moans_s1/pipe_moans_s1_16.wav' using default

As an example, I looked at those warnings for hwpipe_06.wav more closely: Those files are referenced in sound/world_ambience.sndshd => ambient_events/metal/heavy_water_pipes {.
That shader also uses hwpipe_01.wav etc (up to ..._09); the first sound files do exist, but hwpipe_06.wav, hwpipe_07.wav (or .ogg) etc do not exist, so the warnings are legit.

We could collect more missing sounds in d3le in this issue, as a reference for the Lost Mission team.

Submitting Hard Corps to the list

Work has wrapped up on the updated version of hardqore2 for dhewm 3 hard corps.

I have git up with only the updated files. Rest of the files are the same as what is here.

https://github.com/revility/hardcorps

Outside of a few possible bug fixes in the future; i would consider this pretty stable. The documents folder has a full list of changes to the files & what for.

Hard corps is already uploaded & will go live 10.15.21.

Doom3[CC]: Suggestion - Release Packages

I would like to make an suggestion regarding Doom3[CC] mod. I cannot build the package on my Steam Deck for some reason, so hopefully people here will help out, to make a lot of other people’s lives a lot easier.

Maybe built packages be released for others to download the .dll or .so files more easily instead of building from the source ourselves? This can apply to other branches as well.

Thank you so much.

cdoom: "shutting down: Couldn't load default.cfg"

I tried starting the "Classic Doom 3" mod, but I'm getting the following error on the console: "shutting down: Couldn't load default.cfg".

I've used the link here to download it from ModDB. And unpacked the cdoom folder from the zip file to ~/.local/share/dhewm3/.

I'm on Debian Sid and am using the dhewm3 package Debian provides (1.5.2+dfsg-1). Downloading and unpacking the Doom3 demo to ~/.local/share/dhewm3/demo/ and then starting it worked without any issues.

The full console log output looks as follows:

$ dhewm3 +set fs_game cdoom
dhewm3 1.5.2.1305 linux-x86_64 Jun 13 2022 13:37:42 using SDL v2.28.0
SDL video driver: x11
Logging console output to /home/linus/.local/share/dhewm3/dhewm3log.txt
terminal support enabled ( use +set in_tty 0 to disable )
pid: 1941073
30848 MB System Memory
found interface lo - loopback
found interface br0 - 192.168.23.1/255.255.255.0
found interface wlp1s0 - 10.204.36.69/255.255.240.0
doom using MMX & SSE & SSE2 for SIMD processing
enabling Flush-To-Zero mode
enabling Denormals-Are-Zero mode
WARNING: base path '/usr/share/games/doom3' does not exist
----- Initializing File System -----
Loaded pk4 /home/linus/.local/share/dhewm3/cdoom/cdoom_main.pk4 with checksum 0x9ff6284b
Loaded pk4 /home/linus/.local/share/dhewm3/cdoom/cdoom_maps.pk4 with checksum 0xa7bb2433
Loaded pk4 /home/linus/.local/share/dhewm3/cdoom/cdoom_models.pk4 with checksum 0x22e8b18
Loaded pk4 /home/linus/.local/share/dhewm3/cdoom/cdoom_sounds.pk4 with checksum 0xae50243c
Loaded pk4 /home/linus/.local/share/dhewm3/cdoom/cdoom_textures.pk4 with checksum 0x1be0b07f
Current search path:
/home/linus/.config/dhewm3/cdoom
/home/linus/.local/share/dhewm3/cdoom
/home/linus/.local/share/dhewm3/cdoom/cdoom_textures.pk4 (163 files)
/home/linus/.local/share/dhewm3/cdoom/cdoom_sounds.pk4 (113 files)
/home/linus/.local/share/dhewm3/cdoom/cdoom_models.pk4 (449 files)
/home/linus/.local/share/dhewm3/cdoom/cdoom_maps.pk4 (66 files)
/home/linus/.local/share/dhewm3/cdoom/cdoom_main.pk4 (456 files)
/home/linus/.config/dhewm3/base
/home/linus/.local/share/dhewm3/base
Addon pk4s:
shutting down: Couldn't load default.cfg
idRenderSystem::Shutdown()
Shutting down OpenGL subsystem
Sys_Error: Couldn't load default.cfg
shutdown terminal support

CDOOM: setting the mod into fullscreen on MacOS

I'm having trouble setting the mod into fullscreen on MacOS when I load from base. I have:

seta r_customHeight "1200"
seta r_customWidth "1600"
seta r_fullscreen "1"
seta r_mode "-1"

1200 x 1600 is supported in window mode

But it resets r_mode to 3 and r_fullscreen to 0 and then kicks me out to windowed 640x480. Any ideas?

Would be good to have a GUI function to set fullscreen.

Suggestion: change CMakeLists.txt to build on MacOS 10.5

Building Lost Mission on a PowerPC Mac (MacOS 10.5) failed with the following errors:

cc1plus: error: unrecognized command line option "-ffp-contract=off"
cc1plus: error: unrecognized command line option "-Wno-strict-overflow"

The first one I fixed following advice on the same issue with Dhewm3 by changing "add_compile_options(-ffp-contract=off)" in CMakeLists.txt to:

CHECK_CXX_COMPILER_FLAG("-ffp-contract=off" cxx_has_fp-contract)
if(cxx_has_fp-contract)
add_compile_options(-ffp-contract=off)
endif()

I also replaced "add_compile_options(-Wno-strict-overflow)" with:

CHECK_CXX_COMPILER_FLAG("-Wno-strict-overflow" cxx_has_Wno-strict-overflow)
if(cxx_has_Wno-strict-overflow)
add_compile_options(-Wno-strict-overflow)
endif()

Now I'm able to build d3le.dylib and run the mod.

ruiner runtime errors

We've come across 2 c++ runtime errors in Ruiner so far. Both crashes are rare and hard to replicate and there is nothing in the console when it happens. Game will crash and the runtime error pops up.

assertion failure
renderworld.cpp line 954
expression bound [0][0].... (i'll write the full details if you need it)

Seems to happen most when cacodemons or something that inherits from them is around. I can not confirm this the only thing to cause it.

The second is sound related. This one is rare too. Seems to happen if you hit escape just immediately after a level loads.

assertion failure
snd_decoder.cpp line 525
expression false

A side note: I have not tested the mod with the source hook removed version yet and this is from my fork. Both were in win 64bit versions on windows 10. Systems configurations for all 3 systems are completely different.

Ruiner sdk Known Issues

Here is a list of known problems and their status for the Ruiner sdk. This is for the initial public testing.

Bug: Weapons make "Beeping" sounds during when fired or other animations.
info: Not sdk related so far. created when a sound is called to play and doesn't exist or sometimes a missing animation for either the weapon or player.
Status: problems were in def and script files, not sdk. Fixes have been done and will be next ruiner patch.

Bug: Frozen Ragdolls after headshots
info: Not sdk related. This is a problem caused by sys.waits in the enemy base script for when head shots happen. During hectic times the waits are skipped or not done properly. Sometimes this is also caused from a missing headshot key in the weapon's damage def.
Status: Fixed. Will be apart of the next game patch. SDK needs actor.cpp updated.

Not a Bug: Holding down the unused run key will also cause zooming. Zoom key does not work.
Status: This is intentional and apart of the new walk aiming system for the upcoming patch. System will not work without the updated defs, scripts and animation files.

Bug: Cross hair jumps around and sometimes sticks to objects and the world. Projectiles don't always fire exactly at it.
info: The crosshair is drawn at the end of a line. The end position of this line is converted to gui cordinates and used by the crosshair for it's placement. The info for it is found in player.cpp> idPlayer::Think. starting around line 7850. You can see this line by typing g_debugweapon 1 in the console. Whereever the line is stopped is where the crosshair goes. It's worth noting that is unused code from an old version of this system floating around the player.cpp.
The actual crosshairs are found in the cursor.gui file. Cross hair style and their offset are set per weapon in the cursor.gui. Some of these offsets are wrong btw.
Status: Still investigating the best fix for this. Getting a good thirdperson crosshair has been an issue since day 1 with this mod. In the mean time laser sites for all projectile weapons and launching projectiles from the barrel direction have been activated. This was an un-used mechanic added in the mod. Will be apart of the 2018 update.

cdoom doesn't work

I tried out the branch that uses the cdoom mod, and it doesn't work.

At first, I tried the path /user/lib/x86_64-linux-gnu/dhewm3/cdoom.so

Then, I tried /user/lib/x86_64-linux-gnu/dhewm3/cdoom/cdoom.so

Neither works, and when I boot up Dhewm3 and go to the mods menu, it never shows up.

[dentonmod] Library search seems to be hardcoded

I've compiled dentonmod.so for Linux.

I want to be able to run the mod without putting dentonmod.so (or a symlink) in /usr/lib64/dhewm3/. The reason for this is I don't want messing around with the root filesystem.

Is there a way to change the directory where the game/mod searches for .so files?

[d3le] Unknown stat 'adrenaline' added to player's inventory

Apologies if this should actually be posted to https://www.moddb.com/mods/the-lost-mission/downloads/d3-lost-mission/. I don't know how this feature is separated: game files vs code.

Versions: Doom3_The_Lost_Mission_1.3.rar with d3le (2e1dc5c) and dhewm3 (dhewm/dhewm3@a7e4eb8).

Adrenaline cannot be picked up. There is the following message in the console:

WARNING: Unknown stat 'adrenaline' added to player's inventory

To reproduce:

map game/le_exis1.map
setviewpos -2911 2573 4.25 70                                                                                                                                                     

Adrenaline should be right in front of the player on the floor to try to pick up.

This also happens on other maps.

HQ Music after respawn bug

There is an issue with the current and future version of HardQore with the music system. I'm still wrapping my around a way to fix it....

While playing the demo, if you die and re spawn; it resets entity info related to the current music playing.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.