Horizon: Zero Dawn

This fixed all the problems I had before, so thanks for making this :wink:

when i launc the game after injection, crashes with a message to send info to guerrila

It does that with or without Special K =P

Game crashes more than anything I’ve ever encountered for sale on PC before.

Hey!

I have edited the INI file with the code Kaldaien pasted here:

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

[Window.System]
Borderless=true
Center=true
RenderInBackground=true
Fullscreen=true
OverrideRes=3840x2160

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

[SpecialK.System]
EnableCEGUI=false
ShowEULA=false

[Display.Output]
ForceWindowed=true

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

It seems to be working since the framecap is active and its rendering at the correct resolution, but whenever I try to alt tab I get a crash. This does not happen without SK. MSI afterburner is running in the background, but closing it doesnt change anything.

Do I have to have the ingame option as borderless too for this to work? or the config file is forcing it.

Omg its like Magic!

Since Release my only Problem was That the Game was Stuttering like hell

I tried your mod (fullscreen Version)
But it was all the Same

Now ive tried the borderless Settings

And the stuttering is almost no more!

A few frame drops here and there

But its for sure better than vanilla settings

Thanks!

Any idea yet what’s causing the crashes? Some parts of the Steam Community is sure there’s a memory leak in play, but there’s basically nothing concretely seen yet as users are reporting widely different results.

Half the reports also seem to suggest the crashes are related to D3D12 in one fashion or another.

Set in game Borderlessalso. You should be able to alt+tab easily in Borderless.

1 Like

It’s all the worker threads. 100% game-specific logic, not a single system API shows up in the call stack. If I could scale back the number of worker threads, it would reduce the crashing by virtue of the fact that there would be less thread-unsafe code running :stuck_out_tongue:

Setting it to borderless ingame fixed the crashing. Thanks!

And thank you for the fix

This will disable the game’s built-in crash handler, BTW:

SpecialK64.7z (7.5 MB)

Run the game through WinDbg or whatever tool floats your boat if you want to do a deep dive.


What you will find is a lot of this:
08/12/2020 19:13:16.976: DebugHelper Symbol Search Path......: 
08/12/2020 19:13:16.977: Special K Debug Symbols Loaded From.: C:\Program Files (x86)\Steam\steamapps\common\Special K\SpecialK64.pdb
08/12/2020 19:50:49.268: 
	Unhandled Top-Level Exception (c0000005):

08/12/2020 19:50:49.268: 
	Unhandled Top-Level Exception (c0000005):

-----------------------------------------------------------
[! Except !] 	<< EXCEPTION_ACCESS_VIOLATION >>
-----------------------------------------------------------
[  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
-----------------------------------------------------------

-----------------------------------------------------------
[! Except !] 	<< EXCEPTION_ACCESS_VIOLATION >>
-----------------------------------------------------------
[  Thread  ]  ~ Name.....: "Background 7"
[ FaultMod ]  # File.....: 'C:\Program Files (x86)\Steam\steamapps\common\Batman Arkham Knight\HorizonZeroDawn.exe'
[ FaultMod ]  * RIP Addr.: HorizonZeroDawn.exe+000000000023B1C2h
[StackFrame] <-> Rip=7ff78c2fb1c2h, Rsp=00001a06f950h, Rbp=00001a06fd90h
[StackFrame] >-< Rsi=000010000000h, Rdi=000672355460h
[  GP Reg  ]   rax:    0x000000000002    rbx:    0x0000887a0005
[  GP Reg  ]   rcx:    0x00001a06f970    rdx:    0x7ffc12f5f4e8
[  GP Reg  ]   r8:     0x000000002052    r9:     0x00000000000a
[  GP Reg  ]   r10:    0x7ffc12f5fc20    r11:    0x00001a06f010
[  GP Reg  ]   r12:    0x000000000000    r13:    0x000000000000
[  GP Reg  ]   r14:    0x000000000000    r15:    0x000000000001
[ GP Flags ]   EFlags: 0x00010206
-----------------------------------------------------------
 KERNEL32.DLL >  BaseThreadInitThunk
    ntdll.dll >   RtlUserThreadStart
-----------------------------------------------------------

lol, I just realized Steam installed my game to Arkham Knight's directory because I was meddling with the application manifest to debug stuff. Wonder if the NVIDIA driver is confused by this?
1 Like

I have no clue how this mess even got released. Its a joke. Nier Automata had less problems on release and thats just sad lmao

NieR: Automata has relatively few issues, realistically. I have worked on far worse ports – Arkham Knight, Yakuza Kiwami 2, this game…

It crashed way too much for me. Thats why I made the connection. Somehow this is worse. Like in game functions not working worse. Slow mo, hair physics, snow for example.

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 ?