UT2004 patch to fix timer resolution for solid FPS

Got a Glitch? Always Lagging? Need help with anything technical? Want to move off Windows XP?
Post Reply
User avatar
captainsnarf
Posts: 3115
Joined: Tue Jul 06, 2021 1:51 pm
Location: Washington
Server Sponsor: Yes
Server Admin: Yes
Contact:

UT2004 patch to fix timer resolution for solid FPS

Post by captainsnarf »

Download here - https://github.com/aldehir/ut2004-patches
Add support for framerates that require higher resolution than 1ms.

UT2004's original timers caused framerates to vary wildly due to their low resolution. Now you can maintain any desired framerate.

Fix the framerate limiting algorithm.

UT2004 performed additional operations after limiting your framerate, resulting in a reported framerate less than MaxClientFrameRate. The limit is now applied after those operations to provide a more stable fps.

NOTE: You may notice that single player no longer hits up to 1000 fps. This was a misleading metric, as it only occurs when there are no OS events to process. The counter now reports an accurate fps.
It works very well! My FPS is very stable now.

*note* if you have the Steam version of the game it was already patched by Valve to work with Steam, so if you apply this patch you'll no longer have Steam integration. It's not a big deal though.
User avatar
pooty
Posts: 5273
Joined: Sat Apr 03, 2021 10:22 am
Location: Michigan
Server Sponsor: Yes
Server Admin: Yes

Re: UT2004 patch to fix timer resolution for solid FPS

Post by pooty »

Nice, so much like the bandwidth limiter, the original code wasn't quite capable for the more modern hardware?
User avatar
pooty
Posts: 5273
Joined: Sat Apr 03, 2021 10:22 am
Location: Michigan
Server Sponsor: Yes
Server Admin: Yes

Re: UT2004 patch to fix timer resolution for solid FPS

Post by pooty »

Have you connected to the server? Since this patches UT by replacing .exe and several .dlls it may trigger AntiTCC warnings.
User avatar
captainsnarf
Posts: 3115
Joined: Tue Jul 06, 2021 1:51 pm
Location: Washington
Server Sponsor: Yes
Server Admin: Yes
Contact:

Re: UT2004 patch to fix timer resolution for solid FPS

Post by captainsnarf »

Ok, I just checked, nothing in AntiTCC logs for this. If it were an issue I think it would have been complaining about my Steam patched version for a while now.
User avatar
captainsnarf
Posts: 3115
Joined: Tue Jul 06, 2021 1:51 pm
Location: Washington
Server Sponsor: Yes
Server Admin: Yes
Contact:

Re: UT2004 patch to fix timer resolution for solid FPS

Post by captainsnarf »

Microsoft broke the timers in Win10+. sleep(1) doesn't actually sleep for 1ms anymore, so it broke UT fps stability. This patch fixes that. It doesn't use sleep(1) anymore in the engine.
Post Reply