How to reduce ut2004 input lag - no placebo (Win8 and newer)  (Read 272 times)

holyspam

  • Newbie
  • *
  • Posts: 9
  • Country: gr
////***********THE ACTUAL GUIDE IS AFTER MY INTRO
YOU CAN FIND IT BELOW**************///


This is my first post on the forums, so hello to everyone.

Ok, so you know how there are some times that you would get absolutely perfect zero-lag shooting for some rounds and land everything you hit, no unregs, no misses, only for the lag to come back and make you want to smash your keyboard on ZEUS' face. (just kidding, <3 ZEUS)

So this has been happening for years and at this point i thought it was just the usual network latency jumping up and down.

BUT, two weeks ago i decided to try and play with my monitor's settings, which has freesync but also CRT emulation mode, also called ULMB or strobing-backlight or in my case "Faster Response time(who came up with this??????)" and try these out...

I normally play with Freesync all the time, which has a range of up to 144Hz, anything higher and it gets disabled.

Now when you enable the strobing backlight mode on a gaming monitor it disables freesync/gsync and you start to get tearing...only in my case not much changed visually at my usual 142fps, which i found odd so i enabled freesync again and then i saw it...the game actually had tearing every 1-2 seconds but only on the very bottom of the screen and it kept going in and out of freesync which is laggy as hell.

So what can i do in order to try and keep fps within range of freesync to keep it on?
I drop to the next fps limit of UT, 125fps which kept framerates constant during low activity but wasn't as fluid as 142fps.

To fix that, i turn to RTSS(old Rivatuner), at first i tried 143fps - DIDNT WORK, i had to drop all the way down to 135 to keep ut from jumping up and down and disable freesync.

After 3-4 days of testing different fps and settings i found out that the ingame fps limiter is working, but every 1-2 seconds it doesnt actually limit fps, although it shows it's stable.

So i decided to do what every IT professional and computer nerd who respects himself would do, i used google.

The first thing i found, which i already have was the "DX8 to DX9 converter" which helps when old games written for DX8 are being played on newer OS.

Then other people suggested using a different fps limiter and the best available for my gpu are Radeon FRTC and RTSS, FRTC was working but so that's out and RTSS was my next choice.

Now RTSS is good, everything was really fluid and smooth, but it made me notice that there is a small delay between my mouse and the game, which becomes less noticeable if you get up to 200-250-300 fps and disappears in the menu, where fps is 400+

At that high fps i was already out of freesync range and i can't ACTUALLY play online above 200fps, since i would stutter, warp, get packet loss and increased latency, so that wasnt a solution either.

For the last 2 weeks i've been trying to minimise this input lag on my pc, trying hundreds of things. One thing that kinda works is to give higher priority to ut2004.exe, like "above normal" or "high".

When i tried the 64bit version, the input lag was gone but the game feels...odd at best and aiming is inconsistent.

So while i was testing other stuff today, i decided i would check every unused setting in the .ini around the D3D section.

Most settings break the graphics or crash the game, or do nothing at all and suddenly, one setting, which i had already tried without the DX8 converter and didn't do anything for me.

AvoidHitches=False

i switch that to True....

BOOM, zero lag. mouse feels like i've increased sensitivity but is actually as snappy as it can get.

Now i land instant lg shots even on servers without netcode, netcode is just the cherry on top.

So far brizzlybear and nanach had improvement and definitely something was different for zarina(waiting for feedback)

So for anyone else that might want to try it

Here's my guide.

TL;DR

Step 1:
Download the latest DX8 converter(d3d8.dll) from here

Find your installation directory. For example mine is "C:\UT2004\system"

Paste d3d8.dll inside the system folder.

The same folder that contains ut2004.ini and user.ini, alternatively you can right-click on the Play UT2004 shortcut and choose "Open file location" it will take you directly there.

Step 2:
Open ut2004.ini, find
Code: [Select]
AvoidHitches=Falsereplace with
Code: [Select]
AvoidHitches=True
Step 3:
Run the normal version of the game(ut2004.exe), not ut2004-win64.exe.
Avoid "Safe Mode" in Audio tab of ingame settings, it's behaving weirdly with hit sounds.

Optional:
Change fps limit to higher than 120, by typing in console this:
Code: [Select]
set Engine.LevelInfo MaxClientFrameRate 142,166,200,250
Increase process priority to high.
To do so, open Task Manager, details tab, find ut2004.exe, right-click, Set Priority, select High or Above Normal.


Step 4:
Enjoy!
« Last Edit: November 19, 2019, 18:16 by holyspam »

kops

  • Sr. Member
  • *
  • Posts: 221
  • Country: gb
  • Green Eggs and Spam
Re: How to reduce ut2004 input lag - no placebo (Win8 and newer)
« Reply #1 on: November 20, 2019, 16:26 »
Thanks for posting this up here. It looks like a number of people have already found this helpful.

Piglet

  • 1337
  • *
  • Posts: 1690
  • Country: gb
Re: How to reduce ut2004 input lag - no placebo (Win8 and newer)
« Reply #2 on: November 20, 2019, 17:41 »
Questions:

1. How does the game know to use the dll?

2. What does the console command do? The variable is defined as "var globalconfig float MaxClientFrameRate;" - so I can't see what providing "142,166,200,250" to it is intended to do. It can only take a single floating point number.

3. How does changing MaxClientFrameRate through console have any effect different to just configuring it in the ut2004.ini file?

4. Changing MaxClientFrameRate needs to be done in conjunction with a change in netspeed to have any effect on uncapping the frame rate. Something like this is a good idea - press numpad 8 at the start of every map to take effect: NumPad8=Stat Net | stat fps | netspeed 10880

5. AvoidHitches? What is it and what dos it do? I can only see its value being reset in the code - so can't tell what it's doing.

Nardaq_NL

  • 1337
  • *
  • Posts: 305
  • Country: nl
Re: How to reduce ut2004 input lag - no placebo (Win8 and newer)
« Reply #3 on: November 20, 2019, 18:06 »
1 I think its looking first in the root map (ut2004/system) and then looking for the DLL in the windows/system folder.
and which one to use?
[Engine.Engine]
-> RenderDevice=D3DDrv.D3DRenderDevice
-> RenderDevice=D3D9Drv.D3D9RenderDevice

2 The FPS steps has to do with this

3 none  ;D

4 Yup, I use tab for that  "Tab=ScoreToggle | setspectatespeed 5000 | netspeed 15000" (setspectatespeed is also freeing handy)

5 see here

This will not apply for me as I'm still using Windows 7  8)
« Last Edit: November 20, 2019, 18:09 by Nardaq_NL »

Piglet

  • 1337
  • *
  • Posts: 1690
  • Country: gb
Re: How to reduce ut2004 input lag - no placebo (Win8 and newer)
« Reply #4 on: November 20, 2019, 18:47 »
Yeah but you can't set Engine.LevelInfo MaxClientFrameRate 142,166,200,250. You have to pick a value and match with netspeed

Zinst

  • Junior Member
  • *
  • Posts: 38
  • Country: fr
Re: How to reduce ut2004 input lag - no placebo (Win8 and newer)
« Reply #5 on: November 20, 2019, 19:13 »
I use a 144 hz monitor and nice internet speed so  MaxClientFrameRate=250 and MaxClientRate=20000 or 30000 works perfectly for me. One important setting UseVSync=False (everywhere) will prevent a lot of input lag and add comfort especially when moving mouse around.
 



 
« Last Edit: November 20, 2019, 19:19 by Zinst »

Piglet

  • 1337
  • *
  • Posts: 1690
  • Country: gb
Re: How to reduce ut2004 input lag - no placebo (Win8 and newer)
« Reply #6 on: November 20, 2019, 19:26 »
What's the reason for max rate over monitor refresh rate?

Zinst

  • Junior Member
  • *
  • Posts: 38
  • Country: fr
Re: How to reduce ut2004 input lag - no placebo (Win8 and newer)
« Reply #7 on: November 20, 2019, 20:44 »
What's the reason for max rate over monitor refresh rate?

I tried to set MaxClientFrameRate to 144 before and recently  200-250, i didn't see big difference.

holyspam

  • Newbie
  • *
  • Posts: 9
  • Country: gr
Re: How to reduce ut2004 input lag - no placebo (Win8 and newer)
« Reply #8 on: November 21, 2019, 17:21 »
Questions:

1. How does the game know to use the dll?

2. What does the console command do? The variable is defined as "var globalconfig float MaxClientFrameRate;" - so I can't see what providing "142,166,200,250" to it is intended to do. It can only take a single floating point number.

3. How does changing MaxClientFrameRate through console have any effect different to just configuring it in the ut2004.ini file?

4. Changing MaxClientFrameRate needs to be done in conjunction with a change in netspeed to have any effect on uncapping the frame rate. Something like this is a good idea - press numpad 8 at the start of every map to take effect: NumPad8=Stat Net | stat fps | netspeed 10880

5. AvoidHitches? What is it and what dos it do? I can only see its value being reset in the code - so can't tell what it's doing.

1.
For DX8 games the executable looks for d3d8.dll, if it can't find it near, windows handles it.(which also applies to all .dll files required by programs)

D3D8.dll is the name of the windows Direct3D 8 library responsible for rendering in DirectX 8 and DirectX 8.1 games.
It was used in Windows 98/XP maybe 95/2000 too, cant remember.

Even when DX9 released it support was provided for earlier versions.
The 32bit version of UT2004 uses DirectX 8.1

DX9 was not included in Win Vista and 7, there is only DX10-11 included and in order to play old games you have to install "DirectX 9 Redistributables" by yourself, which also provides support for DX8 and earlier, so this dll might not help much.

Then for windows 8/10 m$ decided that DX9 should "run" inside DX11...but only D3D9 is "properly" supported
They called it D3D9 Extended(D3D9Ex)

Using earlier versions of D3D you get something like an emulation inside D3D9Ex, which adds complexity in the rendering process and creates issues for old games, since it runs everything on D3D11.

So these guys got the SDK(software development kit) for DX8 and DX9 and instead of emulating DX8 or looking for quick solutions, they translated all DX8 code to DX9 which requires lots of testing and feedback, almost impossible for one person.

But the result is much faster than being emulated and allows you to make every game to actually work properly.

When people started using it for stuff like ReShade, it got lots of feedback and old games ran on newer windows without issues, they even fixed some graphics bugs in games while translating, even fixed some old unpatched crashes.

Anyway they put all of this inside a d3d8.dll so you won't have to mod your exe or any file.

So instead of this:
D3D8->D3D9
D3D9->D3D11
you get something like this:
(D3D8)D3D9->D3D11

For me this changes the game from MEGA stutters and lag, to super smooth.


2.
The console command can be used to change the variable MaxClientFramerate in class LevelInfo inside class Engine, while ingame, instead of editing the ini and having to restart the game.
You can use this syntax for EVERYTHING inside ut2004 and user.ini:
Code: [Select]
set SECTION.SECTION VARIABLE VALUECATEGORY is indicated inside brackets like [Engine.LevelInfo]
VARIABLE is plain text followed by "=" symbol and then the VALUE specified.

3.
Numbers provided are the limits that ut2004 actually enforces depending on system timer used, there are more details in "The holy grail of ut2004"

4.
Yes you need 10001 netspeed in order to unlock framerates higher than default of 90(maybe less sometimes) to max 250.

5.
Well, it does what the name implies, it probably sacrifices some speed for consistency in framerates (the difference might have been bigger on older systems),  not sure on the technical side you'll have to ask Epic for that.

I was mostly testing various stuff from the .ini and noticed that when it's true it made my movements from mouse to display(called input lag) snappier, no change in framerates or anything.

hagis

  • Sr. Member
  • *
  • Posts: 139
  • Country: gb
Re: How to reduce ut2004 input lag - no placebo (Win8 and newer)
« Reply #9 on: November 22, 2019, 16:00 »
hello :)

I don't tend to mess with any settings generally but thanks for posting, it's interesting :)

holyspam

  • Newbie
  • *
  • Posts: 9
  • Country: gr
Re: How to reduce ut2004 input lag - no placebo (Win8 and newer)
« Reply #10 on: November 26, 2019, 23:24 »
One extra setting to reduce input lag for nvidia users.

DO NOT CHANGE GLOBAL SETTINGS FOR THIS ONE, IT MIGHT NOT WORK WELL FOR ALL GAMES.
THIS WILL DROP YOUR FPS BUT YOU GET FASTER FRAME DELIVERY


1.Go to Nvidia control panel
2.Manage 3d settings
3.Program settings
4. Find unreal tournament 2004, if it doesnt exist,  ADD IT.
5.Now edit ut2004 profile, find "Maximum pre-rendered frames" set it to 1.

That's it!

This might make a huge difference, depending on your setup.




For AMD users you need to edit registry or download radeonmod, i won't go into details because it's dangerous, the setting name is Flip Queue Size.
« Last Edit: November 26, 2019, 23:26 by holyspam »

Piglet

  • 1337
  • *
  • Posts: 1690
  • Country: gb
Re: How to reduce ut2004 input lag - no placebo (Win8 and newer)
« Reply #11 on: December 02, 2019, 23:28 »
d3d8.dll has been causing GPFs for me.

Renamed it. GPF's stopped.