Monday 26 January 2015

Unreal Tournament 4 (UT4) Framerate Optimization

My computer is getting old. When I built it, it only cost 500 dollars (CDN) but it was a pretty good gaming rig for the money back then. That was a few years ago though, it's certainly not a very good gaming machine now, especially not for playing a fast paced new shooter like Unreal Tournament 4 pre-Alpha.

My computer specs:

ASUS M4N68T-M motherboard
AMD Athlon II X3 440 CPU
8G RAM 2x4 DDR3 1600
Radeon 5670 512M DDR5
Samsung Evo 840 120G SSD
150G WD Caviar HD

The original machine only had 4G of RAM and no SSD, those are recent upgrades. I also upgraded the OS from XP to 8.1 (UT4 does not work on XP).

Initially I found UT4 to be practically unplayable. It almost seemed ok with nothing going on but stuttered badly whenever any fighting was going on. My FPS would start bouncing all over the place. I was having big trouble hitting anything and just about every time I died was a WTF moment. Even just playing bots in a local game was extremely frustrating and attempting to play online was much worse.

So I went looking for config tweaks to improve FPS stability, reduce stuttering and input lag and make the game playable. I soon found a thread on Epic's UT4 forums suggesting a console command that turns off ambient lighting.

r.SimpleDynamicLighting 1

It helped a lot, practically doubled my FPS, but the maps were very dark, some so dark I really couldn't see much of anything.  So I went looking for a console command to brighten the maps up and found this.

r.ExposureOffset 3

Some maps are very bright with r.ExposureOffset 3 but a few were still too dark in places with it only set to 2. I'd rather have a few maps a bit too bright than any too dark so I went with 3.

These can also be set in Engine.ini by adding the following lines under [SystemSettings]

r.SimpleDynamicLighting=1
r.ExposureOffset=3

These settings do make it harder to nail shock combos at range because without dynamic lighting you don't get the reflected glow along walls and floor that helps you gauge exactly where the moving core is.

Source https://forums.unrealtournament.com/archive/index.php/t-12691.html

Further down in the same forum thread a user named furiio posted his ini settings. I tried his settings later with  r.SimpleDynamicLight=1 and a few minor changes that seemed better for my hardware. That improved FPS and input lag a little more. They didn't increase my FPS but helped with FPS stability. My framerate didn't drop quite as low, nor nearly as often as before. Then after playing with that for a couple days I tried turning dynamic lighting back on tonight (r.SimpleDynamicLighting=0) and played a few local games.

The game feels smooth enough in local games, it looks better and it's easier to judge distances for shock combos with dynamic lighting on. But there wasn't anyone online to test it against so I'll have to wait till tomorrow to see if it's smooth enough for online play. I sure hope so, it'd be nice to be able to gauge distance on combos better.

Nope no luck with that, I had to turn dynamic lighting back off. The game just wasn't smooth enough for online play with it on.

I still can't play in the smaller, tighter maps with more than 4 or 5 players (including myself). It turns into a massive spamfest which kills my FPS and induces enough input lag that everything gets sort of wobbly. It feels like I'm dragging the screen around behind me and it doesn't want to follow me. I can't move very well and I can't hit the broad side of a barn unless it's not moving. But some of the larger maps are playable even with 8 or 10 players, I can move ok, I can hit other players and I say WTF a whole lot less.

My favourite maps so far are DM-Canon, DM-SidCastle and DM-DeckTest.


The following are furiio's settings.

\UnrealTournament\Saved\Config\WindowsNoEditor\Engine.ini:

[/Script/UnrealTournament.UTGameEngine]
bFirstRun=False
FrameRateCap=118
FrameRateMinimum=118

[SystemSettings]
r.HZBOcclusion=0
r.AmbientOcclusionLevels=0
r.BloomQuality=0
r.DepthOfFieldQuality=0
r.SSR.Quality=0
r.DetailMode=0
r.LensFlareQuality=0
r.MaxAnisotropy=0
r.oneframethreadlag=1
r.simpledynamiclighting=1
r.LightShaftQuality=0
r.RefractionQuality=0
r.ExposureOffset=0.3
r.ReflectionEnvironment=0
r.EarlyZPass=0
r.Atmosphere=0
r.Shadow.MaxResolution=2
r.Shadow.MinResolution=2
ShowFlag.DepthOfField=0
ShowFlag.AntiAliasing=0
ShowFlag.LensFlares=0
ShowFlag.Bloom=0
ShowFlag.AmbientOcclusion=0
ShowFlag.TemporalAA=0
ShowFlag.DynamicShadows=0
ShowFlag.MotionBlur=0
ShowFlag.fog=0
ShowFlag.Tessellation=0
ShowFlag.LightComplexity=0
TEXTUREGROUP_World=(MinLODSize=1,MaxLODSize=2,LODBias=0,MinMagFilter=aniso,MipFilter=point)
TEXTUREGROUP_WorldNormalMap=(MinLODSize=1,MaxLODSize=2,LODBias=0,MinMagFilter=aniso,MipFilter=point)
TEXTUREGROUP_WorldSpecular=(MinLODSize=1,MaxLODSize=2,LODBias=0,MinMagFilter=aniso,MipFilter=point)
TEXTUREGROUP_Character=(MinLODSize=1,MaxLODSize=4,LODBias=0,MinMagFilter=aniso,MipFilter=point)
TEXTUREGROUP_CharacterNormalMap=(MinLODSize=1,MaxLODSize=4,LODBias=0,MinMagFilter=aniso,MipFilter=point)
TEXTUREGROUP_CharacterSpecular=(MinLODSize=1,MaxLODSize=4,LODBias=0,MinMagFilter=aniso,MipFilter=point)
TEXTUREGROUP_Weapon=(MinLODSize=1,MaxLODSize=64,LODBias=0,MinMagFilter=aniso,MipFilter=point)
TEXTUREGROUP_WeaponNormalMap=(MinLODSize=1,MaxLODSize=64,LODBias=0,MinMagFilter=aniso,MipFilter=point)
TEXTUREGROUP_WeaponSpecular=(MinLODSize=1,MaxLODSize=64,LODBias=0,MinMagFilter=aniso,MipFilter=point)
TEXTUREGROUP_Vehicle=(MinLODSize=1,MaxLODSize=256,LODBias=0,MinMagFilter=aniso,MipFilter=point)
TEXTUREGROUP_VehicleNormalMap=(MinLODSize=1,MaxLODSize=256,LODBias=0,MinMagFilter=aniso,MipFilter=point)
TEXTUREGROUP_VehicleSpecular=(MinLODSize=1,MaxLODSize=256,LODBias=0,MinMagFilter=aniso,MipFilter=point)
TEXTUREGROUP_Cinematic=(MinLODSize=1,MaxLODSize=128,LODBias=0,MinMagFilter=aniso,MipFilter=point)
TEXTUREGROUP_Effects=(MinLODSize=1,MaxLODSize=128,LODBias=0,MinMagFilter=linear,MipFilter=point)
TEXTUREGROUP_EffectsNotFiltered=(MinLODSize=1,MaxLODSize=128,LODBias=0,MinMagFilter=aniso,MipFilter=point)
TEXTUREGROUP_Skybox=(MinLODSize=1,MaxLODSize=256,LODBias=0,MinMagFilter=aniso,MipFilter=point)
TEXTUREGROUP_UI=(MinLODSize=1,MaxLODSize=256,LODBias=0,MinMagFilter=aniso,MipFilter=point)
TEXTUREGROUP_Lightmap=(MinLODSize=1,MaxLODSize=8,LODBias=0,MinMagFilter=aniso,MipFilter=point)
TEXTUREGROUP_Shadowmap=(MinLODSize=1,MaxLODSize=2,LODBias=0,MinMagFilter=aniso,MipFilter=point,NumStreamedMips=3)
TEXTUREGROUP_RenderTarget=(MinLODSize=1,MaxLODSize=128,LODBias=0,MinMagFilter=aniso,MipFilter=point)
TEXTUREGROUP_MobileFlattened=(MinLODSize=1,MaxLODSize=2,LODBias=0,MinMagFilter=aniso,MipFilter=point)
TEXTUREGROUP_Terrain_Heightmap=(MinLODSize=1,MaxLODSize=2,LODBias=0,MinMagFilter=aniso,MipFilter=point)
TEXTUREGROUP_Terrain_Weightmap=(MinLODSize=1,MaxLODSize=2,LODBias=0,MinMagFilter=aniso,MipFilter=point)

[/Script/Engine.Engine]
DisplayGamma=4
MinDesiredFrameRate=999

[TextureStreaming]
UseDynamicStreaming=false


\UnrealTournament\Saved\Config\WindowsNoEditor\GameUserSettings.ini:

[ScalabilityGroups]
sg.ResolutionQuality=100
sg.ViewDistanceQuality=0
sg.AntiAliasingQuality=0
sg.ShadowQuality=0
sg.PostProcessQuality=0
sg.TextureQuality=0
sg.EffectsQuality=0

1 comment: