Skip to content

Commit

Permalink
fix!: replace the gSecondsSinceLastFrame_WorldTime use by the
Browse files Browse the repository at this point in the history
gSecondsSinceLastFrame_RealTime

This is quite a conceptual change: the physics are calculated not
depending on what we think is the inner game clock, but depending on what we
think is the external real clock. Theoretically this should be a worse choice,
as we calculate physics for the game world with its own world clock. But the
preliminary tests show a better stability of the physics simulation when the
game time is strongly slowed, when the fps are high (for example 100+), and of
course with a combination of both. My hypothesis for this better physics
simulation is that the inner game clock has a larger error margin / a
larger deviation than the real world clock, and that this causes
artifacts in the physics simulation.
Players tests will indicate if this is a choice to keep.
  • Loading branch information
DaymareOn committed Jun 12, 2022
1 parent 848edb5 commit 7f0115d
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 97 deletions.
4 changes: 4 additions & 0 deletions hdtSMP64/Offsets.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

//function 1.5.97 1.6.318 id 1.6.323 1.6.342 1.6.353
//GameStepTimer_SlowTime 0x02F6B948 0x030064C8 410199 0x030064c8 0x03007708 0x03007708
//GameStepTimer_RealTime 0x02F6B94C 0x0300770C
//ArmorAttachFunction 0x001CAFB0 0x001D6740 15712 0x001d66b0 0x001d66a0 0x001d66a0
//BSFaceGenNiNode_SkinAllGeometry 0x003D87B0 0x003F08C0 26986 0x003f0830 0x003f09c0 0x003f0830
//BSFaceGenNiNode_SkinSingleGeometry 0x003D8840 0x003F0A50 26987 0x003f09c0 0x003f0b50 0x003f09c0
Expand All @@ -25,8 +26,10 @@ namespace hdt
// 74 35 45 33 C0 33 D2
#ifdef ANNIVERSARY_EDITION
constexpr std::uintptr_t GameStepTimer_SlowTime = 0x03007708;
constexpr std::uintptr_t GameStepTimer_RealTime = 0x0300770C;
#else
constexpr std::uintptr_t GameStepTimer_SlowTime = 0x02F6B948;
constexpr std::uintptr_t GameStepTimer_RealTime = 0x02F6B94C;
#endif

// Hooks.cpp
Expand Down Expand Up @@ -77,6 +80,7 @@ namespace hdt

#else
constexpr std::uintptr_t GameStepTimer_SlowTime = 0x030C3A08;
constexpr std::uintptr_t GameStepTimer_RealTime = 0x030C3A0C;
constexpr std::uintptr_t ArmorAttachFunction = 0x001DB9E0;
constexpr std::uintptr_t BSFaceGenNiNode_SkinAllGeometry = 0x003e8120;
constexpr std::uintptr_t BSFaceGenNiNode_SkinSingleGeometry = 0x003e81b0;
Expand Down
Loading

0 comments on commit 7f0115d

Please sign in to comment.