narzoul / DDrawCompat

DirectDraw and Direct3D 1-7 compatibility, performance and visual enhancements for Windows Vista, 7, 8, 10 and 11
BSD Zero Clause License
878 stars 67 forks source link

Nocturne is broken again on Intel HD #299

Open Zerodarkage opened 2 months ago

Zerodarkage commented 2 months ago

I had a similar problem with 0.50 now on 0.52 the game just crashes. Same thing with Darkstone and possible others.

Here is the debug log of Nocturne: DDrawCompat-nocturne.log

Here is the debug log of Darkstone: DDrawCompat-Darkstone.log

P.S. Remember that 0.5.1 works!

narzoul commented 2 months ago

Based on your logs, pfnCreateDevice returns an error, which is not supposed to happen. My best guess is, it was broken by https://github.com/narzoul/DDrawCompat/commit/7f7cfcf9bd307ffea4519cf8cd8309e4c512cdd4, which overrides the DX interface version number from 7 to 9 in OpenAdapter, but I didn't realize there is also a version number in pfnCreateDevice. Your driver might be allergic to that difference.

Here's hoping this will fix it: ddraw.zip (diff.txt compared to v0.5.2)

Zerodarkage commented 2 months ago

Based on your logs, pfnCreateDevice returns an error, which is not supposed to happen. My best guess is, it was broken by 7f7cfcf, which overrides the DX interface version number from 7 to 9 in OpenAdapter, but I didn't realize there is also a version number in pfnCreateDevice. Your driver might be allergic to that difference.

Here's hoping this will fix it: ddraw.zip (diff.txt compared to v0.5.2)

Yes! It's fixed! Did a quick test on Nocturne, Darkstone and Z (with Antares patch version 1.7b3) Amazing job! Thanks! :D

narzoul commented 2 months ago

Nice, thanks for the report!

Zerodarkage commented 2 months ago

After many tests with Ultima IX: Ascension using 0.52 and changing options.ini fixed most of the problems! The only problem I cant fix is the "FMV cutscenes" (Intro etc) has only audio.

Here is my options.ini (game) Options.ini.txt

Here is the debug log of Ultima 9: DDrawCompat-u9.log

P.S. With dgVoodoo2 the "FMV cutscenes" works but the game crashes.

bassprayer commented 2 months ago

After many tests with Ultima IX: Ascension using 0.52 and changing options.ini fixed most of the problems! The only problem I cant fix is the "FMV cutscenes" (Intro etc) has only audio.

Do you have K-Lite Codec Pack installed? If so, it may be the problem. This is a known issue and you can learn more about it here.

Zerodarkage commented 2 months ago

After many tests with Ultima IX: Ascension using 0.52 and changing options.ini fixed most of the problems! The only problem I cant fix is the "FMV cutscenes" (Intro etc) has only audio.

Do you have K-Lite Codec Pack installed? If so, it may be the problem. This is a known issue and you can learn more about it here.

I do have K-Lite installed but like I said: With dgVoodoo2 the "FMV cutscenes" works but the game crashes. Plus with GOG original solution "FMV cutscenes" works but the game crashes. (just like dgVoodoo2).

With DDrawCompat the game works and the "FMV cutscenes" has only audio.

P.S. I just tested without K-Lite Codec Pack and nothing changed! bassprayer thanks for trying to help solve the issue!

narzoul commented 1 month ago

With dgVoodoo2 the "FMV cutscenes" works but the game crashes. Plus with GOG original solution "FMV cutscenes" works but the game crashes. (just like dgVoodoo2).

With DDrawCompat the game works and the "FMV cutscenes" has only audio.

I have the GOG version, but the videos play just fine with DDrawCompat v0.5.2, on all 3 GPUs I could test. I never had any codec packs installed though.

Comparing your debug logs with mine, it looks like nothing is being rendered at all in your case, at least not via DirectDraw or GDI. In my case, the video is rendered via GDI, specifically with BitBlt. There is also a strange loop of reading the same registry keys over and over again while the video is supposed to be playing, e.g. search for "MPEG" in your logs. I don't have such a loop, and this does make it more likely that it's a codec issue. But then I don't understand how removing DDrawCompat would fix it.

I don't want to compare the behavior with dgVoodoo, because it has some DirectShow hooks according to its changelogs, but I have no idea what they do.

Anyway, my only guess for now is that maybe the video is being rendered by some other API which is not supported by DDrawCompat, like Direct3D 9. To check that, try this version: ddraw.zip (diff.txt compared to v0.5.2)

It removes DDrawCompat's presentation windows, which normally cover the game's own windows. This breaks fullscreen mode and all rendering, except that the intro video itself should be visible, if it's actually rendered by some unsupported API. If it's still not rendered, then it points towards some codec issue after all, which I have no idea how DDrawCompat could cause (assuming that simply removing ddraw.dll really fixes it).

Zerodarkage commented 1 month ago

With dgVoodoo2 the "FMV cutscenes" works but the game crashes. Plus with GOG original solution "FMV cutscenes" works but the game crashes. (just like dgVoodoo2). With DDrawCompat the game works and the "FMV cutscenes" has only audio.

I have the GOG version, but the videos play just fine with DDrawCompat v0.5.2, on all 3 GPUs I could test. I never had any codec packs installed though.

Comparing your debug logs with mine, it looks like nothing is being rendered at all in your case, at least not via DirectDraw or GDI. In my case, the video is rendered via GDI, specifically with BitBlt. There is also a strange loop of reading the same registry keys over and over again while the video is supposed to be playing, e.g. search for "MPEG" in your logs. I don't have such a loop, and this does make it more likely that it's a codec issue. But then I don't understand how removing DDrawCompat would fix it.

I don't want to compare the behavior with dgVoodoo, because it has some DirectShow hooks according to its changelogs, but I have no idea what they do.

Anyway, my only guess for now is that maybe the video is being rendered by some other API which is not supported by DDrawCompat, like Direct3D 9. To check that, try this version: ddraw.zip (diff.txt compared to v0.5.2)

It removes DDrawCompat's presentation windows, which normally cover the game's own windows. This breaks fullscreen mode and all rendering, except that the intro video itself should be visible, if it's actually rendered by some unsupported API. If it's still not rendered, then it points towards some codec issue after all, which I have no idea how DDrawCompat could cause (assuming that simply removing ddraw.dll really fixes it).

With this version the FMV works!!! As expected, everything else is broken (you can only hear the audio xD)

Here is the debug log of Ultima 9: DDrawCompat-u9.log

narzoul commented 1 month ago

Please do the following:

  1. Download and run graphstudionext.exe from here: https://github.com/cplussharp/graph-studio-next/releases
  2. Select File -> Render Media File... from the menu
  3. Navigate to the Movies directory of your Ultima 9 install directory, change the file type to All Files in the bottom right corner, and open the column.dat file
  4. Select File -> Save Graph Information... from the menu, and attach the saved text file here

Thanks!

Zerodarkage commented 1 month ago

Here is the file: column.txt

narzoul commented 1 month ago

Ok, so it does use Video Mixing Renderer 9, which is not supposed to happen, because its default Merit value is MERIT_DO_NOT_USE. Something on your system must have modified it. I tried installing K-Lite Codec Pack in a VM, even the Mega version, but it doesn't do this. Maybe it's one of the many installation settings, or some other software caused this, or you modified the Merit value manually?

Anyway, you can find out the current Merit values on your system by using GraphStudioNext again. No need to load any videos this time, just go to Graph -> Insert Filter..., select "Video Mixing Renderer 9" on the left-side pane, and copy the Merit value from the right-side pane. Repeat this for both of the "Video Renderer" filters too, and let me know the results.

Zerodarkage commented 1 month ago

Video Mixing Renderer 9 MERIT_PREFERRED + 1 (0x00800001)

Video Renderer (1st) MERIT_PREFERRED + 1 (0x00800001)

Video Renderer (2nd) MERIT_UNLIKELY (0x00400000)

Should I change all 3 to MERIT_DO_NOT_USE and restart the computer???

Zerodarkage commented 1 month ago

I changed Video Mixing Renderer 9 from "MERIT_PREFERRED + 1 (0x00800001)" to "MERIT_DO_NOT_USE (0x00200000)" Did a log off/on and now it works! I don't have any idea what changed this configuration. Thank you so much!

Here is the debug log of Ultima 9: DDrawCompat-u9.log

P.S. There is only one strange thing now. All the DDrawCompat commands sometimes completely stop working. This game is cursed xD

narzoul commented 1 month ago

Should I change all 3 to MERIT_DO_NOT_USE and restart the computer???

No, only the first one. The other 2 are already at their proper defaults.

I found a way to block the VMR-9 filter with a registry hook, so you shouldn't have to change the merits anymore: ddraw.zip (diff.txt compared to v0.5.2)

There is only one strange thing now. All the DDrawCompat commands sometimes completely stop working.

What do you mean by "DDrawCompat commands"?

Zerodarkage commented 1 month ago

What do you mean by "DDrawCompat commands"?

Shift+F11, CTRL+Alt+End and Shift+F12 ("DDrawCompat keyboard commands", my bad.)

P.S. I reverted the MERIT change. Did another log off/on and it works! Nice!

narzoul commented 1 month ago

Does it work initially when starting the game, but stops later in the same session? If yes, maybe it can be fixed by setting CpuAffinity=all, but I don't know if that causes other problems in this game.

If it stops working altogether, even after restarting the game, then it's a known issue with the low level mouse/keyboard hooks in Windows. It can happen if you've launched a lot of different applications with DDrawCompat without restarting your PC.

Zerodarkage commented 1 month ago

Does it work initially when starting the game, but stops later in the same session?

Yes. Let me try the "CpuAffinity=all"

Results: After running the game 3 times. The hotkeys works all the time. This option fixed the game stuttering! Yes! :D

Results 2: After restarting the computer, the stuttering returns and hotkeys sometimes don't work (unlike before, they don't work after starting the game, restarting the game every time this happens fixes this issue) Plus sometimes they stop working later in the session...

P.S. This game definitely is cursed xD

Zerodarkage commented 1 month ago

The problem of the hotkeys only happens with Ultima 9

narzoul commented 1 month ago

Did you turn off the debug LogLevel?

Zerodarkage commented 1 month ago

Did you turn off the debug LogLevel?

Yes!

Experiment results: With the CpuAffinity=all disabled the game overall runs better... Now there is a new problem. Sometimes the game crashes. (with or without the CpuAffinity=all)

Crash error: Ultima9_Crash_error

Experiment 2 results: Deleted my save. Started a new game played for a while and works fine! I'm currently using a backup of my save and no more crashes! (I believe the other save was corrupted) Everything is fine for now!