Deadly Premonition: The Director's Cut

Deadly Premonition: The Director's Cut

29 个评价
How to use DPfix and DXVK at the SAME TIME on Windows! [2024]
由 Fumikage141 制作
Did you hear that, Zack? DPfix AND DXVK at the same time? It's double the performance!
3
   
奖励
收藏
已收藏
取消收藏
Preface
DXVK is a translation layer for Direct3D 8-11 games that converts all DirectX instructions/functions to equivalent Vulkan ones. Basically, it runs them entirely in Vulkan. Originally intended for Linux machines to open DirectX games and applications at all, Windows users have since been using it to improve performance on old broken games and just old games in general, including (but absolutely not limited to) Bethesda games, GTA IV, The Sims 3, Saints Row 2, Final Fantasy 13, etc since they just seem to (on average) run insanely better on Vulkan ((because of their ♥♥♥♥♥♥♥ spaghetti code)). Unfortunately, in Deadly Premonition's case, DXVK hasn't been able to mix with DPfix AT ALL due to them both using the same dll file name (d3d9) that the game searches for in its launch folder, and only one can be there at a time after all, forcing you to choose one or the other and stick with it.

...Well, until now. After a bit of digging around, a random DXVK github issue reply[github.com] by adolfintel popped into my view and changed it all.

This process involves an incredibly tiny bit of hex editing and placing a file in an important system directory, just a heads-up in case either of those things scare you off.
Starting Off
First things first, download DPfix[www.pcgamingwiki.com] and get everything setup to your liking.

Then, download the latest version of DXVK[github.com] (at the time of writing, it's dxvk-2.4.tar.gz ). Windows' file explorer can't natively extract tar files, so you'll need to download something like 7zip[www.7-zip.org] (what I use) to extract it instead.

Finally, you should absolutely download the 4gb/Large Address Aware patch[ntcore.com] and use it on DP.exe to let the game use more than 2Gbs of RAM and remedy its memory leaks.
The Good Stuff
Now that that's done, it's time to get on with what you're here for. Once you've extracted DXVK, you should see two folders inside, "x32" and "x64". The dlls inside each are for 32-bit (limited to 4GB of RAM usage with the 4GB patch) applications and 64-bit (can use infinitely more) applications, respectively.

Since Deadly Premonition is 32-bit, open up the x32 folder. Make a copy of the "d3d9.dll" inside and rename it to something with the SAME LENGTH (important!) like "d9vk.dll". Take this d9vk.dll and copy it to "C:\Windows\SysWOW64" (not any of the folders inside SysWOW64, just SysWOW64 itself). You'll most likely get an administrator pop-up since you're placing a random file in an important system directory (as stated earlier), but just click through it and paste the file in.

Next, the hex editing part. Download a hex editor app of your choice (this guide will be using HxD[mh-nexus.de], which automatically makes a backup of whatever file you edit) and open up DPfix's "d3d9.dll" present in the game's folder. Then, navigate to "Search" at the top left and then "Replace".



After that, input d3d9.dll in the "search for" field and d9vk.dll (or whatever else you may have named it) in the "replace with" field. Make extra sure you don't put any accidental spaces at the end of either.



Then, hit "replace all". You should see a pop-up saying that d3d9.dll has been replaced two times. If you somehow have one or none replaced, scroll all the way back up to the top, click on the "4D" hex (to change your text position) and try again.



This process just made it so that those d3d9 (Direct X) calls will instead be routed to the d9vk.dll (DXVK/Vulkan) in your system files.
Testing and Checking to see if it even worked
Try to run the game. If you get an error message like this before even getting to a menu:



you either messed up the hex editing process or didn't put the d9vk.dll file in the SysWOW64 folder exactly. First search in SysWOW64 to see if it's there (and place it in if it isn't), and if that isn't the problem then delete the d3d9.dll present in the game folder and try the hex editing process again with the generated backup file or a fresh one from the DPfix zip.

If you get something like this:



you accidentally copied the 64-bit DXVK dll instead of the 32-bit one. Go back over that part of the guide and make sure you grab the x32 d3d9.dll and not the x64 one.

Next, this might be a problem only on my end/AMD GPUs, but if the game opens but just leaves a black box on your screen that doesn't do anything else or doesn't load the intro movie past the logos, try going into DPfix.ini and disabling windowed and borderless windowed mode and try again. If the game actually works but only in a mid-sized window, then my hypothesis that DXVK breaks the DPfix implementations of windowed and borderless is correct, and you'll have to use something like Borderless Gaming[github.com] (what I'm currently using) if you want it borderless instead.
[UPDATE August 5 2024] My computer must not have been working right when I wrote this part since native DPfix windowed and borderless is working just fine now, whoops.

If the game actually gets to the main menu and you can load in to a 3D scene, then...
Congrats!
You should now be running Deadly Premonition with DPfix AND DXVK at the same time. To double-check this, there should be a "DP_d3d9.log" file generated next to the game's .exe, which is DXVK's log file. To triple-check just in case, you can use something like MSI Afterburner[www.guru3d.com] to display the API being used or just check your GPU software's metrics. In AMD Radeon, you can find this out in the Performance tab.



DXVK allows for tuning of several variables, such as forcing triple-buffer vsync, limiting FPS, shader compilation settings, and more. Check out this config[github.com] file to look for anything you'd like to adjust, and then create your own "dxvk.conf" file in the game's folder with your chosen settings if so.

[August 5 2024] Aside from stuttering with shader compliation whenever new objects/areas load in for the first time (normal behavior), the game currently runs buttery smooth for me (I hope it does for you as well!) with only one crash in the Chapter 5 dungeon and none else.

Of course, be sure tocheck out Nightbreed's amazing guide to know about various crash points throughout the game and what to do if DXVK doesn't mitigate them.
5 条留言
psychoapeguy 9 月 12 日 下午 4:06 
Just posting this here in case it helps anybody. I was stuck on Episode 3, chapter 15 - the second statue puzzle. Every time that the video was supposed to play to show a statue activating, the game would freeze up. Using this allowed me to get through that area without any issues.

It's also worth noting that I did get an error after attempting to load the game for the first time after doing this. Simply rebooting my PC fixed that. I haven't had an issue (or any crashing/freezing) since.

Thanks for sharing this trick with everyone.
Greggs Sausage roll 2 月 28 日 上午 11:20 
So sad this doesn't work, the game isn't able to start :(
Midnight Rhodes 2024 年 8 月 8 日 下午 8:02 
Thanks for posting this OP, it's well-written and I'm glad to see there are still people trying to improve this game.

Sadly it isn't quite working for me... the process was fine, but when I booted up the game I got weirdly long loading times (even for the inventory) and then it crashed to desktop after about a minute. Might play around more when I've got the time.

I went down the rabbit hole last year trying to mash together DPfix and ReShade (which also uses a d3d9.dll), and I eventually managed using Xenos Injector -- something else to check out for anyone interested in this kind of thing. Might also work with DXVK too?
Fumikage141  [作者] 2024 年 8 月 4 日 下午 2:56 
@Eli Parker only one single crash so far in Chapter 5, didn't happen again after a re-launch and nothing after that so far
Eli Parker 2024 年 8 月 3 日 下午 7:13 
Any updates about crashes so far?