FunkyFr3sh / cnc-ddraw

GDI, OpenGL and Direct3D 9 re-implementation of the DirectDraw API for classic 2D games for better compatibility with Windows 2000, XP, Vista, 7, 8, 10, 11, Wine (Linux/macOS/Android) and Virtual Machines
https://discord.gg/afWXJNDDF5
MIT License
2.12k stars 143 forks source link

Ra2 steam version is not working with renderer=direct3d9 #295

Closed 411752230 closed 3 months ago

411752230 commented 4 months ago

I found Ra2 steam version is not working and crash at startup with renderer=direct3d9 direct3d9 now is the best renderer in CnCNet ddraw gdi and opengl are both working for Ra2 steam version, but with flaws like flashing screen in the main menu.

Any fix for Ra2 Steam edition?

These are the crash log and dmp. cnc-ddraw-1.dmp cnc-ddraw-1.log

FunkyFr3sh commented 4 months ago

Hm, the dmp file is 0 byte and the log also doesn't show anything.

You have the "Windows 7" compatibility mode enabled on the game .exe, can you try to disable it and create a new log without it?

411752230 commented 4 months ago

Hm, the dmp file is 0 byte and the log also doesn't show anything.

You have the "Windows 7" compatibility mode enabled on the game .exe, can you try to disable it and create a new log without it?

Oh. I have tried to to disable the win7 compatibility mode but not work. Everytime I disable it, it will restore and enabled by the steam client again and again. I can only start Ra2 steam version via steam which means it is not drm-free I think.

SnuggleBucketsNathan commented 4 months ago

RA2 Steam version for me worked with the OpenGL renderer, don't know if there was some combination of other settings too required (have: Fullscreen, VsyncON, adjustedMousesensitivity, lockCursortoScreen, OpenGL-xbrc-freescale shader, limitFPS, enableWindowboxing, remember-win-position&size, emulate60Hz, fixBrokenALTTAB, UnlockAdditionalResolutions, ForceHighFPS, FixBadPerformance, FixInvisibleVids&UI) I have no compatibility settings on the RA2 or game executables. (Windows11, 3050RTX) It didn't seem to like any of the other renderers or seemingly combinations, some launched but crashed in menu or during loading screens, others didn't launch at all-- Game technically launched & played with vanilla ddrawcompat that came with steam, as long as you didn't try custom resolutions and mess with the ini files-- So I wanted to test this. But works so not complaining now, figured I'd throw this out, OpenGL seems to work the best (I don't think I encountered a ton of flashing on my successful combo?) Haven't tested a ton though, like launched, started a campaign, watched cutscene, sat through loading screen, played a bit of intro, messed around a bit in options menu, advanced a bit in mission but didn't finish one, so I don't know if any potential problems might lurk somewhere later in the game.

(Tiberian Sun worked kind of flawlessly with your cnc-ddraw)

411752230 commented 4 months ago

I found the game.exe and gamemd.exe were updated from ra2 1.0006 and yuri 1.0001 to 1.0006TUC and 1.0001TUC. When I replace those latest version .exe with the classic 1.0006 game.exe and 1.0001 gamemd.exe, the unstoppable win7 compability mode problem persists. But the games run fluently with cnc-ddraw configured with renderer=auto or renderer=direct3d9.

I think EA has modified game.exe and gamemd.exe, which making them incompatible with cnc-ddraw configured with renderer=direct3d9. The solutions may be either to update cnc-ddraw or to do something to the latest version of game.exe and gamemd.exe.

411752230 commented 4 months ago

I solved the probem just now, by setting ra2.exe and ra2md.exe run as admin. Just ignore game.exe and gamemd.exe.

LuKeSt0rm commented 4 months ago

Issue has to do with the automatically set Win 7 compatibility mode for "game" and "gamemd" exe file by the "installScript.vdf" file when starting the game via Steam.

Exe files are protected with the SteamStub (DRM) and the version string is appended with "TUC" to reflect the "Ultimate version". In addition, the icon of both game exe files has been changed. Otherwise, both exe files are identical in function to the classic one.

It works with the cnc-ddraw wrapper without issues, if you remove the compatibility crap that is automatically set by the "installScript.vdf" file and ideally also the SteamStub (DRM) from the exe files.

Solution Delete the "installScript.vdf" file in the game folder (after you have run the game once with it) Compatibility mode will no longer be set automaticall. Now remove the created Win 7 compat values for "game" and "gamemd" exe file:

"HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers"
<gamepath>\game.exe
<gamepath>\gamemd.exe

UPDATE https://steamdb.info/patchnotes/13686334 With today's update the SteamStub (DRM) protection was officially removed from the "game" and "gamemd" exe files, finally.

FunkyFr3sh commented 3 months ago

@411752230 Could you do me another test run with this build here and upload the log?

DebugLog.zip

Renderer must be "auto"

411752230 commented 3 months ago

@411752230 Could you do me another test run with this build here and upload the log?

DebugLog.zip

Renderer must be "auto"

This is the log run with win7 compability mode disabled. (Fluently) cnc-ddraw-1.log

This is the log and dmp run with win7 compability mode enabled. (Instant crash) cnc-ddraw-1.log cnc-ddraw-1.dmp

FunkyFr3sh commented 3 months ago

@411752230 Could you do me another test run with this build here and upload the log? DebugLog.zip Renderer must be "auto"

This is the log run with win7 compability mode disabled. (Fluently) cnc-ddraw-1.log

This is the log and dmp run with win7 compability mode enabled. (Instant crash) cnc-ddraw-1.log cnc-ddraw-1.dmp

Nice, thanks! It's crashing very early in a test (Direct3DCreate9). Not sure if I can do anything about it, I may just have to detect the win7 compatibility mode and either switch to Direct3d9on12 or opengl.

Can you do one more test? Does it work when you set direct3d9on12 as rendere in ddraw.ini?

renderer=direct3d9on12

And what about "renderer=direct3d9" instead of "renderer=auto", does that work?

411752230 commented 3 months ago

renderer=auto

  1. instant crash after launched by steam (with win7 compability mode) cnc-ddraw-1.dmp cnc-ddraw-1.log
  2. working fluently launched by running ra2.exe directly (with win7 compability mode) cnc-ddraw-1.log
  3. working fluently launched by steam or running ra2.exe (without win7 compability mode) cnc-ddraw-1.log cnc-ddraw-1.log

renderer=direct3d9on12

  1. working fluently launched by steam or running ra2.exe (with ot without win7 compability mode) cnc-ddraw-1.log cnc-ddraw-1.log
GrantBartlett commented 3 months ago

Just a general heads up, as there was useful info in here that helped us update our installer. I have updated the CnCNet installer for RA2/YR so it:

By doing this cnc-ddraw now works again with singleplayer.

FunkyFr3sh commented 3 months ago

Just a general heads up, as there was useful info in here that helped us update our installer. I have updated the CnCNet installer for RA2/YR so it:

  • Moves installScript.vdf to Backup\installScript.vdf. - This prevents steam from keep re-applying the compatiblity settings.
  • Removes the compatability settings on game.exe and gamemd.exe

By doing this cnc-ddraw now works again with singleplayer.

Yeah that should work fine

renderer=auto

  1. instant crash after launched by steam (with win7 compability mode) cnc-ddraw-1.dmp cnc-ddraw-1.log
  2. working fluently launched by running ra2.exe directly (with win7 compability mode) cnc-ddraw-1.log
  3. working fluently launched by steam or running ra2.exe (without win7 compability mode) cnc-ddraw-1.log cnc-ddraw-1.log

renderer=direct3d9on12

  1. working fluently launched by steam or running ra2.exe (with ot without win7 compability mode) cnc-ddraw-1.log cnc-ddraw-1.log

Nice, thanks for testing! Interesting results... Looks like microsoft will have to fix this, not much I can do. I'll just enable direct3d9on12 for now until they've fixed the bug

FunkyFr3sh commented 3 months ago

added a workaround (direct3d9on12 ) now with release 6.3

FunkyFr3sh commented 3 months ago

@411752230 If you're still in mood to do some tests, could you try to disable the steam overlay? I'm wondering if that's what's causing the bug. Maybe the overlay doesn't play nice with the Win7 compat mode? It's not that important, but would be interesting to know (We could report the issue to valve then?)