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

Medieval Total War 1 works on DDrawCompat only #305

Closed BEENNath58 closed 1 month ago

BEENNath58 commented 2 months ago

I had met such an issue only once prior, that games would quit and fail probably at a CreateDevice error like this:

IDirect3D3::CreateDevice: lpd3d=0x6b75208 lpd3dd=0xb0585ec

The last time I saw this reported was an user using a GeForce5 card from 2003 in Windows 7, where probably DDrawCompat can''t help until...

An user got the same exact error for the game in the title, when running the game in AMD Radeon 5700XT. My Nvidia doesn't have any issues with it. I tried to track the solution using logs, but that seemed too dense for me.

Could you help loacte what DDrawCompat fixed?

For reference, I am attaching the AMD log and my Nvidia log nvidia.zip amd.zip

Thank you

narzoul commented 2 months ago

I had met such an issue only once prior, that games would quit and fail probably at a CreateDevice error like this:

IDirect3D3::CreateDevice: lpd3d=0x6b75208 lpd3dd=0xb0585ec

That's not an error?

For reference, I am attaching the AMD log and my Nvidia log nvidia.zip amd.zip

If I understand correctly, both of these are logs from a working case. So how am I supposed to find any errors in them?

What is the problem exactly? Does the game crash? At what point? Is there an error message? Which is the first DDrawCompat version that fixes it?

I can't get the Gold version to launch at all, and the base game crashes after the intro videos, right before entering the main menu. It works with DDrawCompat v0.2.1, but not sure if that's what really fixed it, because with the earlier versions it hangs on a black screen even before the videos, so it's worse than native ddraw. But first I want to understand if we're even talking about the same problem.

BEENNath58 commented 2 months ago

I had met such an issue only once prior, that games would quit and fail probably at a CreateDevice error like this: IDirect3D3::CreateDevice: lpd3d=0x6b75208 lpd3dd=0xb0585ec

That's not an error?

Sorry I meant to say a generic error: IDirect3D3::CreateDevice: ERROR ret=0x80004005(DDERR_GENERIC) @2310

For reference, I am attaching the AMD log and my Nvidia log nvidia.zip amd.zip

If I understand correctly, both of these are logs from a working case. So how am I supposed to find any errors in them?

Okay I assumed DDrawCompat logs if it finds an error in the driver, nvm

Which is the first DDrawCompat version that fixes it?

OP seems to be using 0.5.2. He didn't test older versions.

What is the problem exactly? Does the game crash? At what point? Is there an error message?

There were two problems. The first one is the game can't find DirectX9. dgVoodoo2 didn't help, so he forced DxWnd to hook DirectX9 API directly (the game uses DirectDraw too)

Later the game crashes with a DDERR_SURFACELOST when a battle is won.

BEENNath58 commented 1 month ago

Anything on it?

narzoul commented 1 month ago

Not really. DDERR_GENERIC is well, too generic of an error, and I've never seen CreateDevice return with it.

DDERR_SURFACELOST is not necessarily an error that would cause a crash either. It can happen normally e.g. after a display mode change, probably that's what happens at the end of a battle (I don't have time to play the game to test it now). Games have to be able to handle that, except if surfaces are lost due to WM_ACTIVATEAPP.

DDrawCompat doesn't do anything specific to avoid either of those errors (except for the WM_ACTIVATEAPP case, if AltTabFix is used). So most likely the issue is something else. I assume the logs were taken with DxWnd, isn't it some setting there that causes problems? If it can't be reproduced with DDrawCompat, then I don't know how to investigate it.

BEENNath58 commented 1 month ago

The problem occurs with dgVoodoo2 alone too, so it is unlikely DxWnd caused it, considering the issue happened to him with almost all settings turned on as well.

The DirectX9 setting he chose, would enforce a DX9 hook, the hook isn't always guaranteed to happen automatically, but why it brings the game to work is something I still don't know.

I will try to reconnect with him, if I have something from DDC again