Tuesday, May 13, 2014

Assassins Creed 4 Black Flag (DirectX 11) - 3D Vision Fix (UPDATE)

3DMigoto DX11 3D Vision Fix by mike_ar69 and bo3b

Acknowledgements
We are delighted to publish this game fix on the helixmod site, thank you to Helix and Eqzitara for supporting our work on the 3DMigoto DX11 Wrapper!


Fixed
1. Shadows
2. Lights
3. Double Imaging (fog and smoke)
4. Skybox elements
5. HUD
6. Water caustics
**UPDATE
7. Fixed Lights and shadows for all AA options
8. Fix for night stars and moon and clouds

Disabled 
1. Screen stuff like smudges and raindrops
2. Decals like blood etc (for now)

Game Settings
1. Shadows: Shadows must be "very high" or lower, 'soft shadows' have not been fixed (not even looked at yet). For performance reasons turning off soft shadows is a must anyway (the shader is 10000 lines long, compared to most of the others which are all < 600, this explains the processing hog)
2. Ambient Occlusion: SSAO has not been fixed (or looked at) yet. Use "Off", or HBAO+(low).
3. World Detail: Setting to low gives a good FPS boost, but removes gameplay elements, so really needs to be on medium/high
4. Motion Blur: Must be set to OFF


Known Issues
0. Must change profile from AC4 to either no profile, or AC2 (or something else that works).
1. Rain splashes are 2d.
2. Sun Rays: appear 2D, but I can't seem to do anything about this.
3. Shadows from smoke are 2d (minor effect)
4. Text on in-game screens is too deep. This can be adjusted as part of varying the overall HUD depth using new settings in the d3dx.ini file:
  [Constants]
  x=0.8 <-- Change this one e.g. 0.4 is less depth, -0.2 will pop out the screen etc
  y=0.8
  z=1.2
  w=2.0
5. Bloom from some Lights sometimes shines through objects. This might be an SLI issue, not sure
6. Reflections were fixed in the Animus place, but the fix is only approximate, and there is. some residual 'haloing'. This also affects puddles in Havana. Reflections in 3D are messed up bad actually, and we will continue working on it.
7. For some reason, when the game is started, you may need to change the depth setting a fraction (and then back to what ever it was) for the fix to kick in. Switching profile does not have this problem, but it's a minor annoyance, and has only recently been happening.


Installation
1. This fix requires that you either remove the AC4 profile using Nvidia Inspector, or set it to AC2, else the fix for reflections does not work.  If you use the AC2 profile then you will be able to save settings, set SLI bits etc, but this might interfere with playing AC2...

2. Run the game once to make sure it's installed, resolution and refresh are like you want.
Make sure 3D kicks in.

3. If you are running recent drivers, and Compatibility Mode is kicking in, do Ctrl-Alt-F11 to disable it.
We've tested it on older drivers like 320.49 and the most recent Beta 337.50, and think it should work in all cases.
We've tested it with SLI and single GPU.

4. Get the fix as a zip file from here: 3Dmigoto-AC4-0.98.zip

And unzip all of the files and ShaderFixes folder into the Assassin's Creed 4 exe folder.
e.g. "C:\Program Files (x86)\Ubisoft\Ubisoft Game Launcher\games\Assassin's Creed IV Black Flag"
It's a lot of files, 400 or so shader files, and 4 dlls, an uninstall, and the .ini file.
If you need to uninstall, there is an uninstall.bat that will delete the dlls.

5) With all that installed, run AC4.
You should be able to see everything in 3D, and be able to change depth and convergence.
Performance should be good, very close to what you normally get with AC4 in 3D. You should expect to see only 2 cores active.
First launch will be slow, like a minute, as it caches shaders.


Update 10-25-14: Switched to latest code base, which uses fewer dlls, and does not require the Microsoft platform update.  It includes the bug fix that PirateGuyBrush found in the 3Dmigoto runtime.  Dramatically improves the minimum frame rates.  Big thanks to PirateGuyBrush for the persistence in nailing that down.

50 comments:

  1. Thanks again for posting the fix for the game. I updated from the previous version with no issues. I do want to confirm that the nightsky - stars and such, render at the wrong depth. Unfortunately there is no way to load up the game at night. The best thing to do to notice this is to stand in the middle of Havana for a while and check back once it cycles to night.

    ReplyDelete
    Replies
    1. Thanks for the update. I knew about the night sky cloud deck, but thought the stars and moon should be OK. The nights are spectacular, and far too short in this game. I'll take another look because I'm curious now.

      Delete
    2. Hi Arioch. We will have another look at this for sure. We did update a shader specific for stars that seemed to look OK in our testing. There are two main issues with the skybox:
      (a) Most elements of the skybox in this game are on different shader, and require a different correction, so lining them all up for any convergence value is quite tricky, so our approach is to remove convergence dependency if we can and set a common (empirical) depth after that.
      (b) some elements are on the same shader but require a different correction, and it is this one that is hard to get right since the 3DMigoto wrapper does not allow the same separation by texture that the helixmod dll does.

      Anyway, we will keep tweaking :-)

      Delete
    3. I wish it was easier to get to the night but if I recall the moon looked ok but the stars were at the wrong depth. There were clouds in the sky at the times I got to the night but I can check again. Regardless, the game looks great so far in 3D.

      Delete
    4. I put a screenshot of the stars at night on the AC4 thread in the 3D Vision forum.

      Delete
  2. Was this not fixed by Nvidia in one of the recent drivers? Or did that fix suck?

    ReplyDelete
    Replies
    1. The NVidia fix is usable depending upon your view of fake-3D/depth buffer 3D. They are calling it Compatibility Mode, and it doesn't do true 3D, it does the type of 3D seen in Crysis2 and 3. You get a halo around your character, and lower depth and typically not much convergence. Some people cannot stand it, some people are willing to use it if nothing else is available. I think that nearly everyone agrees that if you have a true 3D fix like this, that there is no value in the Compatibility Mode version.

      Delete
    2. I think the depth buffer solution for AC4 is quite bad, and I say this as someone who defends the depth buffer solution for AC3 which is not bad at all, just very low depth. The AC4 depth buffer solution goes haywire if you increase convergence to try and get any sense of separation between objects (because by default its a flat image about 10" behind the screen) - things like objects stuttering in and out of depth (which is unbearable), the "wall" for high convergence being hit almost immediately leading to the completely 'flat' view about 0.5" in front of the screen. It's all just a bit terrible.
      Our fix for AC4 posted above requires that you remove the default AC4 profile - it seems (from our experience with this and a few other games) that Nvidia are setting certain things up in the games profile to support the depth buffer (like how different things are stereoized or otherwise) that screws up 'normal' stereo rendering as well - so it's doubly bad.

      Delete
  3. Hi
    maybe, try the "AC Révélation profile" because it does not BUG (star, sky)
    Good Game

    ReplyDelete
  4. Sorry for bad english, I just want to say thank you, the game looks fantastic in REAL 3D. You're the best !!! merci, merci, merci.

    ReplyDelete
  5. Agreed

    Another thanks to Helix and Eqzitara for hosting this.

    What an amazing community.

    ReplyDelete
  6. Collaboration between the premier forces working on DX11 fixes, to deliver us from tedious 2D or broken 3D? I am a happy happy man!

    Thank you so much to everyone working on making 3D gaming better. Your efforts are tremendously appreciated!

    ReplyDelete
  7. Whoa! This is all 'you got your peanut butter on my chocolate'!? :D
    http://www.youtube.com/watch?v=DJLDF6qZUX0
    ... am I going to have to make a new banner(logo) now? :)

    ReplyDelete
  8. You guys ROCK! I was so sad to play in boring 2D since the fake 3D is unbearable. Now this looks fantastic!!! Much respect for keeping 3D alive.

    ReplyDelete
  9. The updated fixes, including the stars at night, looks great. Thanks again for keeping true 3D gaming alive!

    ReplyDelete
  10. Awesome job! Many thanks, works like a joy, a huge accomplishment!

    ReplyDelete
  11. This comment has been removed by the author.

    ReplyDelete
  12. This is amazing! Absolutely destroys Nvidia's pathetic attempt at a fix :) Related note, Txaa looks great in 3d.

    ReplyDelete
  13. Very nice..!
    Everything looks brilliant !

    ReplyDelete
  14. Hi,
    first ,thanks for your amazing job.

    For me this fix crash on win 8.1 update 1 and drivers 340.43 (doesnt tested early drivers) with no profil or ac2, ac4 profil.

    ReplyDelete
    Replies
    1. "8. For Windows 8.1 64 Bit Update 1 you need to delete the dxgi.dll file that gets installed with the fix."

      Delete
    2. Update on this for 10-25-14 version- uses new code base, and so there is no longer a dxgi.dll. Should work fine on 8.1 now.

      Delete
  15. The Nvidia patch fixed shadows while still using compatibility mode with halo, so I installed your fix and now the shadows are 2D again. I followed the installation instructions but for some reasons it's not working (running Win 8.1 Nvidia SLI here)

    ReplyDelete
    Replies
    1. I am not sure I understand?
      1. With CM mode on but no patch installed, pressing Ctrl-Alt-F11 will toggle CM off and on. When on, it fixes everything, shadows, halos etc. The problem that most don't like is that the depth is really low.
      2. When you install the 3DMigoto patch, you need to make sure CM is OFF, by pressing Ctrl-Alt-F11. When you do that the Migoto fix will kick in. If, when the Migoto patch is installed, you turn on CM, the shadows will be wrong because both the nvidia driver AND the Migoto patch are trying to fix them - you must have CM mode OFF if you are using the Migoto patch. If you want to use CM, you need to uninstall the Migoto patch.

      Noting that you are running Win 8.1, did you follow step 8 under ' known issues': "8. For Windows 8.1 64 Bit Update 1 you need to delete the dxgi.dll file that gets installed with the fix." ?

      Delete
    2. Wow, in hindsight my post was really terrible. Even I am having problems understanding myself, I'm sorry about that.
      Right now I am running a fresh installation of AC BF with the NVidia profile deleted (using NVidia inspector), the dxgi deleted and the settings recommended in the instruction. I can correctly adjust depth and convergence and I clearly have a lot more depth than I used to, so I guess migoto is working as intended in that regard.
      Pressing ctr alt f11 doesn't do anything right now though. The shadows, for example the protagonists shadow, are 2D and pop out just like they used to way back when the game came out.

      Do I really have to start the game once and disable CM mode before I apply the patch by the way?

      Delete
    3. No need to do ctrl-alt-f11 after you've set the profile to AC2. Not sure null profile (deleted) works, I don't think we tried that. The ctrl-alt-f11 and CM only work on certain profiles, which is why we move to AC2 so there is no conflict.

      For shadows are you running them at Very High (or lower)? Soft shadows don't work and would give you this effect because there is no fix for them.

      Delete
    4. Shadows are at Very High. After choosing the AC II profile the shadows are working as intended. I have problems with convergence in cutscenes and indoors but that's really just a minor issue, apart from that it looks pretty good. Cranking up the depth will sometimes lead to strange shadows showing up too far away from the object to which they belong but I guess that's something I'm just going to have to live with. At 50% depth it's really not an issue. Thanks for the replies and the great work!

      Delete
    5. Shadows should be perfect so something is still not right. Can you list all your settings and perhaps provide a 100% depth screenshot? AO causes issues as well. Thanks.

      Delete
  16. Hello,

    J'ai un PC avec Windows 8.1, un ecran Asus VG278HR 3D Nivision 2 et une carte GTX 770DX 11.1 avec les derniers drivers Nvidia 340.52.
    Pas mal de jeux donnent un excellent rendu 3D : Batman, Splinter Cell, Tomb Raider, Far Cry 3 Max Payne 3, Metro, ....
    Par contre, pour Assassin Creed IV, j'avais espoir en lisant votre mise à jour.
    J'ai bien installé le "3DMigoto DX11 3D Vision Fix " Hélix Mod Fix en supprimant le fichier dxgi.dll .
    J'ai configuré les paramètres comme recommandé (shadows, motion blur, ...), mais j'ai encore des soucis : tremblement de l'image, lignes coupant l'image, surtout lors des videos et sur le bateau, ....Bref, le résultat n'est pas à la hauteur.
    J'ai bcp lu sur les forums et on conseille de lancer AC4 avec un profil AC2 via Nvidia Inspector, mais comment faire, créer un nouveau profil ?
    Pour info, j'ai la licence AC4 avec Uplay.
    Pourriez-vous m'aider, je suis un peu désespéré .... ? Que faire et quels paramètres régler dans les options du jeu (avec précision).
    Grand merci,

    D.

    ReplyDelete
  17. This comment has been removed by a blog administrator.

    ReplyDelete
  18. Hello!

    Thanx for this great patch, because now game looks amazing in real 3D.

    ReplyDelete
  19. Hey, thanks for all your hard work. I followed your instructions, setting app profile to AC2 in Inspector. The only additional steps I took were to change
    the SLI compatibility bit and for good measure, the settings in the SLI section of Inspector to match those in the original ACIV profile.

    Assuming I haven't messed up in some way, what kind of FPS should I be hoping for?

    I am currently getting around 27-32 in general but with stutter and frequent sharp fluctuations 21 - 40 fps. This is with texture quality set to high, environmental quality high or very high, MSAA 2x, HBAO+ low, Shadows high / very high, God Rays medium / High, Phys X Low, reflections medium, motion blur off, Vsync On. Dialing back the setttings improves the average FPS somewhat but doesn't stop the stuttering / sharp fluctuations. In 2D I was generally running stable at 1080p / 60fps with everything maxed out except Phys X (set to low) and AA (MSAA 4x or TXAA 4x). I expected the drop in average FPS as I understand 3D is twice the amount of work for one's rig but am wondering if the stability is normal, particularly given that dialing down settings doesn't seem to help much in that respect.

    Many thanks

    My specs:

    i5 3570k @ 3.8Ghz
    2 x 2gb Gtx 680 OC in SLI
    Maximus V Gene Mobo
    System running off 120gb Intel 330 ssd, AC4 running off secondary (mechanical) harddrive 7200rpm
    16GB ram
    Asus VG278h 120hz monitor

    ReplyDelete
    Replies
    1. What you are seeing is consistent with many people. There was some discussion about the stuttering on the nVidia forums, but I can't remember all the details. Turning off Phys-x is one thing, as it only seems to be used for some smoke effects that are hardly noticeable anyway. Not having environmental quality on the highest is another help. The nvidia control panel also has a chache shaders option now, which I think they introduced for this game because of stuttering - try that. Ultimately though, when a game is running around 30FPs, stutter of any kind is really noticeable. My setup is similar to yours (i5-3570k @4.5GHz, 2x770SLI) but I don't see massive swings in FPS anymore, only some low FPS when looking at big vistas or something, or when a scene has 10s of people in it. I'm not sure what happens if you run the game in 3D without the 3Dmigoto wrapper - it will look like crap of course so you can turn the separation down to almost zero so its still rendering in 3D, but see if the stuttering still occurs?

      Delete
    2. It's possible that me and PirateGuyBrush fixed this with the last update. Try the 0.98 version, and let us know if that fixes the fluctuations. We fixed a bug that had the same basic symptoms. You want PhysX *off*. It adds nothing to the game, and hammers your performance.

      Delete
  20. Many thanks for the swift reply. Shader cache option was already on by defrault. TBH it was more the FPS drops than the odd frame hitch or short stutter that was bothering me (took me back to my SNES bullet hell shooter slowdown days!).

    I'll give it another try tonight, at least it's good to hear it's likely not my system. When you say test it without the wrapper, I gather you mean uninstall it and run in standard Nvidia compatibility mode?

    Incidentally, do the 3DMigoto changes affect the game when played in 2D? i.e. Does one have to uninstall Migoto in order to play the game in 2D without gfx issues caused by the changes?

    ReplyDelete
    Replies
    1. I am not referring to compatibility mode, I am referring to normal 3D mode just without the 3Dmigoto fix (yes uninstall it), which will look all messed up, that's why I say reduce the separation. The only reason for doing this is to see if you get the same slow down without the wrapper installed (and I am sure you will).

      3Dmigoto does not affect 2D gameplay, though we did disable decals, which would remain disabled. It is easy to put checks into all fixes to see if stereo is active and then "not do" the fix (basically put and "if" statement in the code), but I did not do that. So if you do want to play the game in 2D, uninstall the fix. Also, disable 3DVision altogether using the short cuts in the start menu, as you lose about 8% FPS just having the 3D driver running even if stereo is turned off.

      Delete
    2. Ah, I see, understood. Thanks for all the info. Will give it a try.

      Delete
  21. Hey guys,

    Just reporting that I might have found a reproduceable issue where 3dmigoto makes framerate dips worse.

    In the very first island after the shipwreck, cross the bridge and find the small cave on the left with some bottles scattered around. Running around these bottles with the camera pointed out of the cave causes dips into the low 30s on SLI 970s with 3Dmigoto installed. Without 3dmigoto, the dip is present but to mid 40s. This seems to happen on all graphics settings (to varying degrees), with or without 3d or 3dmigoto. But 3dmigoto does seem to make it noticeably worse. Would this just be the expected framerate-related price to pay, or is there a way to reduce the hit? I'm seeing a number of similar areas with hits like this. There's one while running over the forked tree slightly before this, and another while crossing the bridge. The cave is just the easiest to repeatedly trigger.

    I've tested with the original AC4 profile, and the AC2 profile. I'm running it off an SSD, and I've tried after removing the shaders folder. Tried with and without SLI. None of this seems to affect it (though no SLI makes it worse).

    It's not a major issue, I just thought it might be useful information if you're trying to optimise it further.

    ReplyDelete
    Replies

    1. Whereas it does not explain a difference between having Migoto on or off, do you have Phys-X turned on or off? In the area you describe there is a little fire with a small bit of smoke that is rendered using Phys-X and that causes slow downs - turning it off is not even noticeable visually but removes the slow down. The issue occurs if you are looking in a direction that is rendering something with physX, even if you can't see it (and it does not need to be close).

      We all brainstormed this issue when we released the fix earlier this year, but I don't think any of us has an answer. If shader caching is turned on the overhead should be much less than a 40FPS->30FPS drop. I don't have the will to look at this again, since I am totally out of ideas.

      Delete
    2. Hey Mike,

      I've tried with maximum and minimum settings, and different resolutions. The issue appears every time. Most of my testing has been with physx off though. My uneducated guess would be that 3dmigoto isn't causing the issue, but is constantly using just that little bit of extra power, which causes the drops (when they do happen) to become more obvious. The fundamental issue seems to be that the game is poorly optimised, given the drops happen (to a lesser extent) without 3dmigoto. If there are now newer wrapper versions that might be more optimised, maybe that would help? It's still playable, it's just annoying to have the drops, especially on these new SLI 970s. My CPU is a little on the weaker side (i5 @ 3.2ghz), but I'm watching the usage and it doesn't break 50%.

      Delete
    3. Thanks for the detailed location, I know where that is. When I get a chance I will take a look with the Visual Studio profiler, which will let me know if there is anything in 3Dmigoto that is causing the performance problem.

      As Mike notes, the PhysX causes this problem everywhere, any smoke or fires hammers the performance.

      With PhysX off as you note, the next likely suspect is your CPU. The 50% usage indicates that 2 of your four cores are maxed out. The game is not really multi-threaded, so it can only use 2 cores, and when they max out they can become the bottleneck. In fact, that would be worth an experiment- try turning PhysX On instead. That might use your graphics card for PhysX which might offload some tasks from your CPU. Anything you can do to lower the load on the CPU will help this game.

      Delete
    4. I've borrowed an i7 3.4ghz for testing, and I'm seeing pretty much identical performance. On the i5, CPU usage was around 45%. It's around 40% on the i7. Though I did notice disk IO was through the roof. In my SSD experiments, I've been using a symbolic link from my main Steam drive (mechanical) to the SSD. Disk IO was high on the main drive, leading me to suspect that the SSD symbolic link might not be delivering it's full speed benefit potential. I'm reinstalling a fresh copy directly to the SSD to test this out, but my internet has been particularly slow lately. Might be a couple days before it's ready to test again.

      In the meantime, I did find this - which seems to have improved things for some people.
      https://forums.geforce.com/default/topic/714270/pc-games/-finally-assassins-creed-4-physx-performance-fix-/

      I also found a forum thread that suggested driver 332.21 performs well, but I don't think I can run that with my 970s.

      Delete
    5. General notes first:

      -Moving to an SSD had no impact
      -CPU usage is around 30% for the AC4 exe, 50% for the system
      -Changing affinity does nothing, providing AC4 is given at least (any) two cores.
      -GPU usage is between 60%-90% on both GPUs
      -PhysX kills the framerate in 2d and 3d, even if one card is set as a dedicated physx card
      -There are no significant CPU or GPU usage spikes during the slowdowns

      I've run a large batch of tests. The test procedure is to stand just inside the cave facing outwards, and record the

      framerate while standing still (first number). Then run anticlockwise around the bottles a few times (keeping the

      camera pointed out), and record the lowest framerate seen. Tests were run on driver 344.16, with moderately high

      graphics settings (no physx, vsync on, most settings on high), using the AC4 nVidia profile. I'll put the numbers at

      the bottom, but first a few observations:

      -There seems to be absolutely no SLI scaling in 3D. Hard to tell in 2D, as there's a 60fps cap.
      -Setting SLI mode to AFR, AFR2, or SFI doesn't change this
      -This area reliably produces framerate drops under all circumstances
      -3d Migoto makes these drops significantly worse
      -It's not related to a shader, as removing all shader fixes doesn't change the drop
      -It happens regardless of the graphics settings

      3D
      38-35 - one card, no migoto
      38-28 - one card, migoto
      38-35 - two cards, no migoto
      38-28 - two cards, migoto

      52-32 - two cards, migoto, deleted all shader folders, all graphics settings on minimum


      2D
      60-58 - one card, no migoto
      60-47 - one card, migoto
      60-59 - two cards, no migoto
      60-47 - two cards, migoto

      60-48 - two cards, migoto, deleted all shader folders

      Delete
    6. Apologies for the weird formatting in the middle of that comment, seems it got mangled after copying from notepad (which I did because blogger ate my first attempt)

      Delete
    7. And it's up! Sorry for the delay in publishing the fix.

      The 0.98 version fixes this problem, and dramatically improves the minimum frame rate. CPU usage of 3Dmigoto is now at 0.8%.

      Delete
  22. Thanks bo3b, was ac3 affected by this performance bug? Im diving into it soon and black flag after it.

    ReplyDelete
    Replies
    1. I'm not sure, but it wouldn't be a surprise if AC3 was affected. Wouldn't hurt to use this AC4 update on AC3. In any case, it will definitely help performance and so is probably worth using.

      The only thing AC3 specific is the ShaderFixes folder. Rename that folder, run the uninstall.bat, then drop the AC4 dll files in, then rename folder back to ShaderFixes.

      Delete
    2. Thanks, ill do that.

      Delete
  23. Kudos to PirateGuyBrush!

    ReplyDelete