Horizon: Zero Dawn

Altho i never joined discussions i have used your stuff for years and it was always easy to use and working great. I wanted to thank you for your work.

Off to sleep. Gn

Great to hear.

I am almost sorry my fixes are needed, but guilty pleasure – I enjoy fixing problems other people created and would be bored without problematic PC ports :stuck_out_tongue:

I did some more analysis of the CPU registers during crashes in the worker threads, and curiously…

[  Thread  ]  ~ Name.....: "Worker 6"
[ FaultMod ]  # File.....: 'C:\Program Files (x86)\Steam\steamapps\common\Batman Arkham Knight\HorizonZeroDawn.exe'
[ FaultMod ]  * RIP Addr.: HorizonZeroDawn.exe+000000000023B1C2h
[StackFrame] <-> Rip=7ff78c2fb1c2h, Rsp=00001946f8e0h, Rbp=000000000001h
[StackFrame] >-< Rsi=0006d73e9800h, Rdi=00001946fdd0h
[  GP Reg  ]   rax:    0x000000000002    rbx:    0x0000887a0005
[  GP Reg  ]   rcx:    0x00001946f900    rdx:    0x7ffc12f5f4e8
[  GP Reg  ]   r8:     0x000000002052    r9:     0x00000000000a
[  GP Reg  ]   r10:    0x7ffc12f5fc20    r11:    0x00001946efa0
[  GP Reg  ]   r12:    0x000000000002    r13:    0x0000ffffffff
[  GP Reg  ]   r14:    0x000000000200    r15:    0x000000000078
[ GP Flags ]   EFlags: 0x00010206
-----------------------------------------------------------
 KERNEL32.DLL >  BaseThreadInitThunk
    ntdll.dll >   RtlUserThreadStart
-----------------------------------------------------------

0x887a0005 is the HRESULT for DXGI_DEVICE_REMOVED.

I have no idea how that gets loaded into the rbx register with nothing on the callstack beneath it that should have put it there, but I do not think it is a coincidence. Maybe some kind of thread context switch done wrong?

This is consistent across all of the threads that crash. rbx always has that HRESULT. It’s definitely a D3D12 problem, but I cannot trace D3D12 API calls with the current design of Special K :frowning:

Can’t figure out all of what’s wrong with HZD, but on the bright side … I have patched SK’s Flip Model / Waitable Swapchain overrides so they can now work with fullscreen exclusive and waitable swapchains can be resized.

That should open up a lot more software compatibility for my advanced framepacing tweaks.

4 Likes

Between the beta nvidia driver mentioned upthread, and SpecialK with the INI settings for borderless windowed, I was able to play for about 45 minutes before crashing. Is there anything I can find for more information that might help your investigation?

The only thing I know so far is what I see in Event Viewer, some kind of D3D12 failure I’m guessing based on the D3DDRED2 name (seems to refer to some debug API?)

Fault bucket 1990830021780410275, type 5
Event Name: D3DDRED2
Response: Not available
Cab Id: 0

Problem signature:
P1: VEN_10DE
P2: 27.21.14.5185
P3: 0x887A0006
P4: 3
P5: HorizonZeroDawn.exe
P6: Unknown
P7: 
P8: 
P9: 
P10:

Some other adjacent events too, but none specifically mention HZD

This version is compatible with Fullscreen Exclusive:

SpecialK64.7z (7.5 MB)

[API.Hook]
LastKnown=64
d3d11=false
d3d12=true
d3d9=false
d3d9ex=false
OpenGL=false
Vulkan=false

[Render.FrameRate]
TargetFPS=50.0
SleeplessRenderThread=true
SleeplessWindowThread=true
PreRenderLimit=3
BackBufferCount=2
PresentationInterval=-1
LimiterTolerance=1.5

[SpecialK.System]
EnableCEGUI=false

[Render.DXGI]
UseFlipDiscard=true
AllowTearingInDWM=true
SwapChainWait=66

[Window.System]
Borderless=true
Center=true
RenderInBackground=true
Fullscreen=true

Same story as before, set TargetFPS to your refresh rate (ideally). No resolution overrides are needed any longer and you can switch between fullscreen / borderless in-game. The game tends to not make the initial transition into Fullscreen Exclusive unless you alt-tab in/out. It behaves that way with or without SK.

2 Likes

Lets start fresh, I’ve enabled the global injection and started the game, the SKIF shows me a config file: N/A, I have the steam version of the game and installed at the default game folder.

What should be the next step ?

So this fixed the issues I was having with the game. Fixed the crashes and the performance stuttering. Now the issue I have is whenever I go into the settings menu in game and then exit it, my camera completely stops working. I have to exit the game to fix it.

Wonder if that’s part of the mouse issues Kaldaien mentioned at some point earlier in the discussion, grabbing input the wrong way and some compatibility with that which was resolved but maybe it came back?

That only applies to the mouse input though if you are using a gamepad it’s something else acting up here.

I am using mouse and keyboard. Like I said it’s completely random. I was able to play for like 2 hours (until my game crashed) and didn’t have a single issue with the camera not working the second time.

Does that mean there is a new SK version out?

@Kaldaien, but which one do you recommend now? FullScreen or Borderless for this game?

That Would be good to know

Since switching to this build the game crashes when trying to do a manual save at campfires, quicksave still works. I think this didn’t happen with the normal build and the config from Horizon: Zero Dawn - #36 by Kaldaien, not 100% sure though.

I tried to manually save on my end as well but didn’t experience the issue. Can you confirm by renaming dxgi.dll that it’s actually Special K that is causing it?

And what anti-virus protection are you using? Some (such as BitDefender) have an “active threat component” that basically gets injected into all processes and then scans reads/writes from within the process and can cause weird issues at times, and is known to conflict with Special K.

The game tends to not make the initial transition into Fullscreen Exclusive unless you alt-tab in/out. It behaves that way with or without SK.

I am sorry but that’s not true; I only experience this behavior with SK.
When I run the game Fullscreen Exclusive WITHOUT SK, it launches in Fullscreen Exclusive right away.
When I run the game Fullscreen Exclusive WITH SK, it first starts bordered windowed and then i alt-tab out/in and it goes Fullscreen Exclusive.
It’s fully reproduce-able, I can maybe record this evening.

I’ve been using the SKIM 0.7.0.3 Global Injection with the config and SpecialK64.dll replaced with the ones from Kaldaiens Post instead of the dxgi.dll injection method - maybe that’s the problem?

I can manual save without issues with the Global Injection Service stopped.

No anti-virus except for Windows Defender.

Edit: can confirm manual saving does not crash with the default SpecialK64.dll and the older config from here: Horizon: Zero Dawn - #36 by Kaldaien.

I haven’t tried the previous version so it might be that all versions of Special K are affected, but with this latest version I noticed that the game leaks handles when Special K is injected as dxgi.dll. Not having Special K injected has the game use about ~950 handles after I’ve loaded into the game. Having Special K injected has it grown to 4,000 and keeps growing constantly.

This by itself does not seem to be much of an issue though as I was able to play 1-2 hours just now with a handle count of upwards of 240k without any noticeable issues.

1 Like

Do I replace the while config files with just those lines you quoted and change the target fps,as I see a lot of config lines not present on your post vs the default config.

Hi, so i managed to get it working on EGS version, but everytime i changed my display mode to exclusive fullscreen or borderless it immediately crashes. Any idea?