Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port HeXen: Edge Of Chaos to dhewm3 #32

Open
wants to merge 26 commits into
base: master
Choose a base branch
from

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 [email protected] - 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 [email protected] - 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 [email protected] 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.

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