Saturday, April 14, 2018

Devil May Cry 4 Special Edition


3D Vision fix for Devil May Cry 4 Special Edition.


Update (2018-04-14): fix updated with a better fix for water. Unfortunately, the nature of this experimental wrapper causes it to have different color or properties in missions 2 (exterior) and 3 (cave). The old fix is here just in case. If you want to restore the original water fix you have to delete all pixel shaders (files in "ShaderFixes" with filename ending with "-ps_replace.txt") beginning with "//Water". This update also adds extra features like disabling black bars, all bloom / tone mapping / HDR effects, motion blur, and also gives some real time HUD depth options (see the hotkeys and features section).


Fixed
- Fake lighting that was at screen depth now is at depth.
- Moon and sun lighting at correct depth.
- Fixed water reflections, but now water edges are broken (I couldn't fix that for now).
- HUD at fixed depth.

Special notes
- This fix uses an old and experimental 3Dmigoto build made for DX10 games. As such, some features aren't working, like the usual hotkeys I make for HUD depth or to disable some effects. I made a workaround for HUD depth, but other effects have to be disabled or not before booting the game.
- Also, the fix has to remain with hunting mode enabled (don't worry, it doesn't display any unwanted OSD). Don't touch the numpad number keys unless you know what you're doing.
- Every time you boot the game, the fix will add two bars ("//") at the end of every shader. If you boot the game one million times, that's two million of bars. Replace the shaders manually from the original fix to start over.
- If the game crashes for you (even without the fix), try this to modify the game exe with a Hex editor: http://steamcommunity.com/app/329050/discussions/0/1291816880499283959/
- The pcgamingwiki explains how to disable DoF and motion blur if you want. This fix offers the option to do that in "d3dx.ini". I prefer them disabled.


Installation
- Download this file and extract its contents in the "Special Edition" folder, where "DevilMayCry4SpecialEdition.exe" is.
- DON'T RENAME THE GAME EXE. It has to be "DevilMayCry4SpecialEdition.exe".
- To launch the game, you will always have to do it through "DMC4SE_fix.bat". Don't touch any key or button until you hear a "beep" sound. If you don't hear it after 25-30 seconds, reboot the game, because it didn't boot fast enough. All of this is necessary because this version of 3Dmigoto doesn't load modified shaders unless they are edited and reloaded while the game is running (the fix includes some bat and vbs scripts to make it as easy as just waiting for a "beep").

Hotkeys and features
- F1: convergence presets with HUD at screen depth.
- F2: convergence presets with HUD at 37.5% depth.
- F3: convergence presets with HUD at 75% depth.
- Non real time options can be configured in "d3dx.ini", after line 417 ("Graphics mods section"). To disable the mentioned effects described above each block, remove the ";" at the start of each line (except for text descriptions). This has options to disable motion blur and DoF, black bars, bloom, and one distortion effect. So you don't need to modify the game exe to disable motion blur anymore.
- Different HUD depth: search the string "hudmult=" in "56069ecccbba0250-vs_replace.txt", "71677acc263d29ef-vs_replace.txt", "8b057b487ccd6e5d-vs_replace.txt" and "e5b51c3e0ec0c0a9-vs_replace.txt". Change it to any value between 0 (screen depth) and 1 (full depth).
- Fake lighting stretching. Without this, which is enabled by default, fake lighting doesn't cover the whole image in the X axis. So I stretched it by 1/8 to fill that space. Search the string "float stretchmult = 1.125;" in "e805181ea59d3b36-vs_replace.txt". 1 is the default value to not stretch it.


If you liked the fix and want to contribute for more future fixes, you can donate to this PayPal account: masterotakusuko@gmail.com

8 comments:

  1. This is pretty cool, thanks for the extra fix. I'm happy you could get the DX10 variant working well enough to make it useful.

    Based on a quick look of the code, you should be able to run hunting=0, but you might need to ship the cached .bin shaders. The F10 is in the code, but probably doesn't follow our current rules. There is no hunting=2 for this version.

    ReplyDelete
    Replies
    1. Would the ".bin" shaders be compatible for everyone? I thought it would depend on each one's hardware, so if not, it's nice to know.

      "The F10 is in the code, but probably doesn't follow our current rules." <-- What rules do you mean?

      Oh, well. I'll have to test if cached shaders actually work (I don't remember if I did already). At least when non cached, I ran into the problem of them needing to be edited and reloaded while the game was running, and that's why I made those scripts.


      Another problematic thing was that shaders seemingly can't load in ASM form, right? In general I had compilation problems with HLSL pixel shaders (".Sample()" operations to be precise), which in some cases I could fix with a bit of editing (the bloom pixel shader), but there were missing effects in the water PS after I tried to fix the errors (that's why the fix is half-done in the VS).

      Are there any hopes about seeing an updated 3Dmigoto for DX10 someday? :p I can understand if not, because there are very few DX10 games, and most have a DX9 option.

      Delete
    2. We changed the folder precedence, so anything in ShaderCache will be loaded before ShaderFixes, IIRC. Might be some other things. That code has changed a lot. Probably best to not reload the .ini file itself (also set to F10, just disable it). That might be on by default, and that was sketchy for awhile, and not useful here.

      No ASM support at all in this old version. You can probably dump the files, but I don't think it will read them or use them.

      Cached .bin shaders are the same for all setups. Should work to have those in the fix, and will load first. If any of those are out of date, F10 won't replace them. Old bugs with date stamps, so it would skip recompile if a .bin exists.

      For specific files, I can hand edit them to generate the same code. This old version will be missing a lot of code improvements. You can also take a .bin file generated by the game, and run it through the offline cmd_decompiler to get a new version.

      No plans (or time) to update DX10 variant. This is the first time anyone has used it.

      Delete
    3. "anything in ShaderCache will be loaded before ShaderFixes, IIRC."

      Oh, shit. That must be why I thought my shaders weren't loading. I'll have to test that at home. If it works, I won't need the stupid scripts workaround I made.

      "Cached .bin shaders are the same for all setups. Should work to have those in the fix, and will load first."

      OK. Haha, so maybe I should have provided my ".bin" files in the Tekken 7 fix, being more than 1500 shaders that take a while to compile the first time.

      "No plans (or time) to update DX10 variant. This is the first time anyone has used it."

      No problem. This is the only DX10 game that I wanted to see fixed, other than maybe Crysis (I know there is a DX9 fix, but graphics are a bit better in DX10), if I replay it someday.


      tl;dr: I have to test all of this when I get home, in around 6 hours. Then I'll update the fix and this page.

      Delete
    4. Nope, nothing worked. Deleting/renaming the ShaderCache folder didn't help (I'm not creating more of those shaders, of course), and compiling shaders into ".bin" files didn't help.

      So I need to keep doing what I've been doing all this time. No compiled shaders, hunting mode enabled (otherwise I can't reload shaders), and scripts to modify and reload shaders.

      I wish it could work the proper way, but it doesn't.

      Delete
    5. This game really comes alive with this fix. Proper or not it is a showcase for 3DVision. Thanks!

      Delete
  2. This comment has been removed by the author.

    ReplyDelete
  3. Not sure if it'll help here or not but I found commenting out the ShaderCache location in the D3DX.INI eliminated the need to run a script(move/rewrite files) with Oceanhorn entirely. You still have to press F10 at the title screen to load the Shaders but that was it...

    ; Automatically patched shaders will be written here if caching is enabled.
    ; cache_directory=ShaderCache

    ReplyDelete