Skip to content

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dtclamp

Havok physics dt clamp for Watch Dogs (WD1). Clamps the per-frame physics delta-time to max 1/30s — prevents ragdoll, vehicle, and object glitches when running above 60fps.

Why

At high framerates, the game feeds the Havok physics world a very small delta time each frame. A single-frame hitch (e.g. after a shader compile, file load, or frame drop) can spike that delta and make physics explode. dtclamp clamps the per-frame delta to a maximum of 1/30s before it reaches the physics accumulator, keeping physics stable regardless of framerate.

How it works

dtclamp hooks the Havok world-step accumulator in Disrupt_b64.dll at RVA 0x021285A9:

addss xmm6, dword ptr [rbx + 0x758]   ; physics accumulator += delta-time

It rewrites that instruction as:

minss xmm6, [1/30]                    ; clamp delta-time to 1/30
addss xmm6, [rbx + 0x758]             ; original instruction
jmp  [return address]                 ; return

The hook is a 6-byte trampoline patch (addss xmm6,[rbx+0x758] = F3 0F 58 B3 58 07 00 00) with an embedded float for 1/30.

Build

make            # outputs bin/dtclamp.asi
make clean      # removes bin/

Requires: x86_64-w64-mingw32-g++ (MinGW cross-compiler).

Install

Copy bin/dtclamp.asi to the game bin/ directory alongside watch_dogs.exe.

Logging

dtclamp writes dtclamp.log next to the game executable. It logs:

  • Whether the DLL was found
  • The hook RVA and whether target bytes matched
  • "HOOK INSTALLED OK" on success, or an error description

If you see ERROR: target bytes don't match addss xmm6,[rbx+0x758], your game build has a different RVA — send the log and your game version to the author.

Files

File Purpose
dtclamp.cpp Single-source C++23 DLL
Makefile MinGW cross-compile + strip
LICENSE MIT

License

MIT

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages