Skip to content

Conversation

@LegendaryGuard
Copy link

@LegendaryGuard LegendaryGuard commented Jul 26, 2023

I would like to contribute adding an old mod into a new branch in the repository. Currently, the mod works in a vanilla Doom3 game with 1.3.1 patch.

https://github.com/LegendaryGuard/HeXen_Edge_Of_Chaos

HEOC source code has been publicly released on moddb: https://www.moddb.com/mods/hexen-edge-of-chaos/downloads/hexen-edge-of-chaos-demo-source-patch

I'm working to make it work in dhewm3, I haven't finished to write the README yet.

Any help and review is welcomed.

@LegendaryGuard
Copy link
Author

Could someone give me a hand? I'm trying to compile completely the source code and run as should in dhewm3.

It isn't the first time I'm working in a C++ project here, I tried to generate a Visual Studio solution in Windows, but I get errors:

The C compiler identification is unknown
The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:2 (project):
  No CMAKE_C_COMPILER could be found.



CMake Error at CMakeLists.txt:2 (project):
  No CMAKE_CXX_COMPILER could be found.



Configuring incomplete, errors occurred!
See also "C:/msys64/home/user/heoc_dhewm3/build/CMakeFiles/CMakeOutput.log".
See also "C:/msys64/home/user/heoc_dhewm3/build/CMakeFiles/CMakeError.log".
  • CMakeError.log:
Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler:  
Build flags: 
Id flags: 

The output was:
1
Microsoft (R) Build Engine version 14.0.25420.1
Copyright (C) Microsoft Corporation. All rights reserved.

Build started 27/07/2023 0:24:29.
Project "C:\msys64\home\user\heoc_dhewm3\build\CMakeFiles\3.5.2\CompilerIdC\CompilerIdC.vcxproj" on node 1 (default targets).
PrepareForBuild:
  Creating directory "Debug\".
  Creating directory "Debug\CompilerIdC.tlog\".
InitializeBuildStatus:
  Creating "Debug\CompilerIdC.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
ClCompile:
  CL.exe /c /nologo /W0 /WX- /Od /Oy- /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"Debug\\" /Fd"Debug\vc140.pdb" /Gd /TC /analyze- /errorReport:queue CMakeCCompilerId.c
TRACKER : error TRK0005: Failed to locate: "CL.exe". El sistema no puede encontrar el archivo especificado. [C:\msys64\home\user\heoc_dhewm3\build\CMakeFiles\3.5.2\CompilerIdC\CompilerIdC.vcxproj]
  
  
Done Building Project "C:\msys64\home\user\heoc_dhewm3\build\CMakeFiles\3.5.2\CompilerIdC\CompilerIdC.vcxproj" (default targets) -- FAILED.

Build FAILED.

"C:\msys64\home\user\heoc_dhewm3\build\CMakeFiles\3.5.2\CompilerIdC\CompilerIdC.vcxproj" (default target) (1) ->
(ClCompile target) -> 
  TRACKER : error TRK0005: Failed to locate: "CL.exe". El sistema no puede encontrar el archivo especificado. [C:\msys64\home\user\heoc_dhewm3\build\CMakeFiles\3.5.2\CompilerIdC\CompilerIdC.vcxproj]

    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:00.34


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler:  
Build flags: 
Id flags: 

The output was:
1
Microsoft (R) Build Engine version 14.0.25420.1
Copyright (C) Microsoft Corporation. All rights reserved.

Build started 27/07/2023 0:24:30.
Project "C:\msys64\home\user\heoc_dhewm3\build\CMakeFiles\3.5.2\CompilerIdCXX\CompilerIdCXX.vcxproj" on node 1 (default targets).
PrepareForBuild:
  Creating directory "Debug\".
  Creating directory "Debug\CompilerIdCXX.tlog\".
InitializeBuildStatus:
  Creating "Debug\CompilerIdCXX.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
ClCompile:
  CL.exe /c /nologo /W0 /WX- /Od /Oy- /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"Debug\\" /Fd"Debug\vc140.pdb" /Gd /TP /analyze- /errorReport:queue CMakeCXXCompilerId.cpp
TRACKER : error TRK0005: Failed to locate: "CL.exe". El sistema no puede encontrar el archivo especificado. [C:\msys64\home\user\heoc_dhewm3\build\CMakeFiles\3.5.2\CompilerIdCXX\CompilerIdCXX.vcxproj]
  
  
Done Building Project "C:\msys64\home\user\heoc_dhewm3\build\CMakeFiles\3.5.2\CompilerIdCXX\CompilerIdCXX.vcxproj" (default targets) -- FAILED.

Build FAILED.

"C:\msys64\home\user\heoc_dhewm3\build\CMakeFiles\3.5.2\CompilerIdCXX\CompilerIdCXX.vcxproj" (default target) (1) ->
(ClCompile target) -> 
  TRACKER : error TRK0005: Failed to locate: "CL.exe". El sistema no puede encontrar el archivo especificado. [C:\msys64\home\user\heoc_dhewm3\build\CMakeFiles\3.5.2\CompilerIdCXX\CompilerIdCXX.vcxproj]

    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:00.33

I tried to compile in Linux, but I get these errors and I don't know what's wrong:

/home/user/heoc_dhewm3/game/Player.h:311:14: error: ‘idProjectile’ was not declared in this scope; did you mean ‘idObjective’?
  311 |  idEntityPtr<idProjectile> soulCubeProjectile;
      |              ^~~~~~~~~~~~
      |              idObjective
/home/user/heoc_dhewm3/game/Player.h:311:26: error: template argument 1 is invalid
  311 |  idEntityPtr<idProjectile> soulCubeProjectile;
      |                          ^
/home/user/heoc_dhewm3/game/Player.h:502:34: error: ‘idProjectile’ has not been declared
  502 |  void     SetSoulCubeProjectile( idProjectile *projectile );
      |                                  ^~~~~~~~~~~~

@DanielGibson
Copy link
Member

HEOC source code has been released in public domain

Where does it say that it's in the public domain? The README says

(...)

This package is made available with the intention that:

  • you abide by the Doom3 SDK License.
    (...)

Which means that it's under the Doom3 SDK License - to be compatible with dhewm3's license, it must be under GPL, so the original authors must relicense their patch under GPL (or simply agree that it's used with the GPLv3 source of open source Doom3).

Regarding your compile problems: The Windows errors looks like you told CMake to build with Visual Studio, but it couldn't find it, or its compiler (cl.exe) - do you have it installed?.

The compile error on Linux looks like there's an #include missing in Player.h, so the definition of idProjectile is available there - probably #include "Projectile.h"

@LegendaryGuard
Copy link
Author

LegendaryGuard commented Jul 26, 2023

Which means that it's under the Doom3 SDK License - to be compatible with dhewm3's license, it must be under GPL, so the original authors must relicense their patch under GPL (or simply agree that it's used with the GPLv3 source of open source Doom3).

I sent an email in https://hexenmod.com/ to ask about that. No response from them.

Also I tried to search the authors in idtech 4 Discord server. No one of them are there.

The source code is still public and there are no license from the authors (but only Doom3 SDK license), looks like they didn't care about that.

Regarding your compile problems: The Windows errors looks like you told CMake to build with Visual Studio, but it couldn't find it, or its compiler (cl.exe) - do you have it installed?.

Looks like this CMake only supports Visual Studio 2019, 2017 or older, so I managed to install and configure the tools correctly as I could. So, it needed the 'build environment C++ tools' part installed.

The compile error on Linux looks like there's an #include missing in Player.h, so the definition of idProjectile is available there - probably #include "Projectile.h"

It's already included: https://github.com/dhewm/dhewm3-sdk/pull/32/files#diff-db89ff4435f28b0d2ebaacc8aab8e31c3f553256a76756271a608d41ad04c761L38

I don't know what's going on with this error, keeps outputing.

@DanielGibson
Copy link
Member

https://www.moddb.com/mods/hexen-edge-of-chaos/news/team-updates-project-updates mentions hexen.team@gmail.com - have you tried that email address?

Maybe there are other compiler errors before that one?
Always scroll up in the compiler output and fix the first error(s) first, often that also resolves later errors

@LegendaryGuard
Copy link
Author

LegendaryGuard commented Jul 27, 2023

https://www.moddb.com/mods/hexen-edge-of-chaos/news/team-updates-project-updates mentions hexen.team@gmail.com - have you tried that email address?

I already told:
I sent an email in https://hexenmod.com/ to ask about that. (in the last posted news (March 12th) mentions hexen.team@gmail.com too)

Maybe there are other compiler errors before that one? Always scroll up in the compiler output and fix the first error(s) first, often that also resolves later errors

I tried to fix, no idea what's going on, d3xp outputs no errors compared to the other.
Here the full compiler log: https://pastebin.com/dF4DYGjg

@LegendaryGuard
Copy link
Author

LegendaryGuard commented Jul 28, 2023

Ok, I fixed all the code to be compiled successfully in Windows and Linux.
I run the game using the release builds. But when I try the "new game", it shows these annoying assertions errors (I post the links of the lines of code of these errors here):
https://github.com/LegendaryGuard/dhewm3-sdk/blob/hexeneoc/idlib/containers/List.h#L154
image

https://github.com/LegendaryGuard/dhewm3-sdk/blob/hexeneoc/idlib/containers/StrPool.h#L157
image


Same when I try to load the map with map hexen/test/some_map command.
https://github.com/LegendaryGuard/dhewm3-sdk/blob/hexeneoc/game/script/Script_Program.h#L234
image

https://github.com/LegendaryGuard/dhewm3-sdk/blob/hexeneoc/idlib/Heap.h#L821
image

I wonder why changed the values for the assertions when this isn't supposed to happen.

@LegendaryGuard
Copy link
Author

LegendaryGuard commented Jul 30, 2023

I'm debugging deeply as I can. So, when I break one of the barrels/pots, the script in this part works:
image

But when I'm picking up one of the items like blue little health item, blue triangle, green cube and red sphere, looks like it's becoming NULL for some reason and after the game crashes (same happens with "pickup_effect" on them, no matter what, tries to search the "object" thing):
image

…g is wrong with calling a script object in a function
@LegendaryGuard
Copy link
Author

LegendaryGuard commented Jul 31, 2023

I finished to port everything of HEOC to dhewm3 in a stable state.

https://www.moddb.com/games/doom-iii/downloads/hexen-edge-of-chaos-dhewm3-edition

Btw, no response from the authors. They didn't give a damn about sharing the source code, they haven't licensed nothing, apart from the Doom3 SDK.

@LegendaryGuard
Copy link
Author

LegendaryGuard commented Dec 16, 2025

Finally, thanks to the replies from the main coder from HEOC team, the source code has been licensed as says in this part from LICENSE.txt:

The modifications are free software; you can redistribute them and/or modify
them under the terms of the GNU General Public License as published by the Free
Software Foundation, either version 2 of the License, or (at your option) any
later version.

Btw, the README.md here needs some modifications, tell me what I should do and I'll prepare to complete this PR to be ready.

@DanielGibson
Copy link
Member

Regarding the license, you can just add a note in the README like "The code changes of HeXen EOC have been released under GPLv2 or later (by $NAME). As the Doom 3 source code (that the dhewm3 SDK is based on) was released under GPLv3 or later, that's the effective license of this code."
(feel free to reword)

================
*/
ID_INLINE void idHashIndex::SetGranularity( const int newGranularity ) {
#if defined(_DEBUG) && 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find it a bit frightening how many assertions have been commented out - they usually were there for a reason..

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 83b0423. But the assertions still happen, needs to be debugged and corrected for some reasons

game/Trigger.cpp Outdated
savefile->WriteBool( on );
savefile->WriteFloat( delay );
savefile->WriteInt( nextTime );
savefile->WriteInt( (int &) nextTime );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nextTime now is an idList<idDict> - that definitely shouldn't be saved as an int (same issue in Restore())

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in e8e0e94, forgot to copy these pieces of code.

game/Trigger.cpp Outdated
const char *damage;

if ( on && other && gameLocal.time >= nextTime ) {
if ( on && other && gameLocal.time >= (int &) nextTime ) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(int &) nextTime doesn't make any sense, it's a list of dicts now - though maybe it should just be an int? but this code here is broken

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in e8e0e94, forgot to copy these pieces of code.

DanielGibson added a commit that referenced this pull request Jan 7, 2026
@DanielGibson
Copy link
Member

I started a fresh branch applying the original changes they made to the mod SDK and then
applied all your little fixes to get it to compile (but just those).
Also got the first level to start, getting rid of that assert( data ) error.
See https://github.com/dhewm/dhewm3-sdk/tree/eoc

It still doesn't work well though, after playing a bit I got assert( rotation.GetOrigin() == start );, backtrace

idClip::Motion() at Clip.cpp:1,209 0x7fffa502dbfb	
idPhysics_RigidBody::CheckForCollisions() at Physics_RigidBody.cpp:194 0x7fffa507c3cf	
idPhysics_RigidBody::Evaluate() at Physics_RigidBody.cpp:904 0x7fffa507fb54	
idEntity::RunPhysics() at Entity.cpp:2,693 0x7fffa4e7e2ee	
idDebris::Think() at Projectile.cpp:2,431 0x7fffa4f4c3ab	
idGameLocal::RunFrame() at Game_local.cpp:2,560 0x7fffa4ead202	
idSessionLocal::RunGameTic() at Session.cpp:2,904 0x5555556e0b05	
idSessionLocal::Frame() at Session.cpp:2,853 0x5555556e0804	
idCommonLocal::Frame() at Common.cpp:2,527 0x5555556776b7	
main() at main.cpp:452 0x555555810e0e	

it seems like some of the values have NaNs, for example current.i.position. No idea yet why that is the case.

DanielGibson added a commit that referenced this pull request Jan 7, 2026
@DanielGibson
Copy link
Member

I managed to fix the aforementioned assertion, the NaNs were caused by uninitialized variables that the compiler thankfully warned about. Also fixed a few other compiler warnings.

It seems to work now 🎉

DanielGibson added a commit that referenced this pull request Jan 7, 2026
@DanielGibson
Copy link
Member

DanielGibson commented Jan 7, 2026

So please test https://github.com/dhewm/dhewm3-sdk/tree/eoc, I'm keeping this PR open to discuss the port (bugs).

Here's a build for Windows: hexen-eoc-dhewm3-win32.zip

DanielGibson added a commit that referenced this pull request Jan 7, 2026
@DanielGibson
Copy link
Member

just pushed two more fixes so the second level (the swamp) can load

updated windows build: hexen-eoc-dhewm3-win32-upd.zip

@DanielGibson
Copy link
Member

I changed my mind and created a (pseudo-) pull request for my branch after all.
Please discuss it there: #45

DanielGibson added a commit that referenced this pull request Jan 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants