Second attempt of porting HeXen: Edge Of Chaos#45
Draft
DanielGibson wants to merge 18 commits intoupdatefrom
Draft
Second attempt of porting HeXen: Edge Of Chaos#45DanielGibson wants to merge 18 commits intoupdatefrom
DanielGibson wants to merge 18 commits intoupdatefrom
Conversation
Member
Author
|
A testbuild for Windows: https://github.com/user-attachments/files/24464496/hexen-eoc-dhewm3-win32-upd.zip |
based on their patch for the original SDK (without their changes to d3xp/, because their game DLL is built from game/) Doesn't work yet, I only fixed merge conflicts. There were some bigger changes (and conflicts) in Player_local.h, I hope I didn't break anything.. if some variable is missing after all, check out the original code (for the Doom3 SDK)
did small adjustments to formatting in the README
from the initial port at #32
it caused an assertion (`assert(data)`) when starting a level because it wasn't linked. when linking it it causes > ERROR: Missing 'AI_ATTACK2_HELD' field in script object 'player' which indicates that the scripts don't support it, so I just commented it out completely
so they have deterministic values. fixes NaN-related trouble in the first level
the old code would read out of bounds and then most probably do nothing, or if surprisingly rocks[i] == NULL it would dereference that pointer .. which would've blown up, but not as intended, höhö
script variables must be linked before they're used.
like I just did in main dhewm3, it triggered when loading the swamp
|
Nice work! Thanks, I couldn't find out what's wrong all that time! Please apply to fix the crash for the item pickups: |
`assert( idStr::Icmpn( soundName, "snd_", 4 ) == 0 );` happens when trying to use god cheat.. nothing critical, warning suffices
Member
Author
|
done, thanks! |
…mps due to null children.
and turn the prints into warnings moved the commented out assertions to where they were before commit c22965bf580f0a718b7117a92da83205fccc32ec so the code is a bit closer to the original (and the SDK)
|
Found compiler warnings of unused variables, PR: #46 |
The "Recalculate gameLocal.msec each frame so 60 frames add up to 1000ms" commit, that makes gameLocal.msec take either 16 or 17ms so on average it's 16.666ms, caused problems with the "sys.waitFrame()" script function, that calls idThread::WaitFrame() which sets `waitingUntil = gameLocal.time + gameLocal.msec;`. When we're in a 17ms frame and this is set, and the next frame is a 16ms frame, then in the next frame this timeout won't have passed yet, because it's just 16ms later, not 17ms later, so it will effectively wait for two frames instead of one in every third frame. This caused the (script-driven) MD3 animation in #727 to run too slowly. Other similar calculations where gameLocal.msec is used to calculate a (usually future) time relative to gameLocal.time will have similar problems. Mitigate this by introducing gameLocal.msecPrecise: It's always 16.666ms (except in d3xp when slowmo is active) so when added to an integer it's rounded down to 16ms (which will always trigger in the next frame), and when multiplied to get the time of several frames it will also be way more exact, off by < 1ms (instead of up to n*2/3 ms for n frames)
basically the same as in the previous commit, but more complicated due to d3xp's slowmo feature. slowmoMsec was always a float, now its value is based on the precise frametime (16.666ms, added USERCMD_MSEC_PRECISE for that) instead of USERCMD_MSEC = 16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Based on @LegendaryGuard's #32 but fixes several issues and has a more concise commit history.
This PR is kind of fake: the branch already is at its final place (has its final name and is in this repo), but I figured that it would be easier to discuss it here we code changes can be easily commented on.