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.13k stars 143 forks source link

RA2 game locking up #232

Closed MrBadfinger closed 10 months ago

MrBadfinger commented 11 months ago

RA2/Yuri randomly freezes up in Skirmish mode but music still plays. Log attached. cnc-ddraw.log

FunkyFr3sh commented 11 months ago

Your log file is somehow corrupted, not sure how that could happen (haven't seen something like this before...)

Could you disable the "Windows XP Service Pack 2" compatibility mode for all game executables and check if it still freezing? If it does, also try it with the renderer set to opengl in cnc-ddraw config.

Did you change any of the cnc-ddraw settings? If so, could you also upload your ddraw.ini?

MrBadfinger commented 11 months ago

I thought I had removed the compatibility mode from all of the .exe files already but missed one.

I went in the cnc-ddraw config utility and set everything back to default. I then set the Presentation to Fullscreen Upscaled (I usually have other problems with the game starting when set to Fullscreen), renderer to opengl, and ticked all of the Compatibility settings (Broken Alt+Tab, etc) in the cnc-ddraw config. It would not let me attach an .ini file so I put a .txt extension at the end (ddraw.ini.txt).

The next time I ran a Skirmish in Yuri, it went about 30 minutes without locking up. The cnc-draw.log was 1.6GB. I zipped and attached the cnc-draw-log-big.zip file.

I have been saving frequently and this time I tried the mini-log version. I restored from my last Save and the game ran about 5-6 minutes before the lockup. Per instructions in another thread, I waited about a minute from the crash before I closed the Yuri app. It only captured about 15KB (attached cnc-ddraw-mini.log).

I copied the original logging ddraw.dll file back, opened the game, and restored back to the previous save. Again it only ran a few minutes before locking up (attached zipped cnc-ddraw-log.zip).

Before the music would keep playing, but now the game locks up, the music continues for a few more seconds, then the screen whites out. After that, a Windows box pops up with the message to Close the program or wait for the program to respond.

cnc-ddraw-mini.log ddraw.ini.txt cnc-ddraw-log-big.zip cnc-ddraw-log.zip

FunkyFr3sh commented 11 months ago

Nice, thanks!

BTW, you should NOT enable any of the compatibility settings in cnc-ddraw config. Each one of them may be able to solve a problem in some games but may cause a new problem in other games (That's why I had to make all these settings optional rather than just having them enabled all the time)

"Fix bad performance and sound issues" (AKA "singlecpu=false") is known to cause freezing and crashes in cnc games, make sure you got that one disabled.

Retry once more without "Windows XP Service Pack 2" compatibility mode and also without the cnc-ddraw compatibility settings. If it's still crashing, let me know (I'll have to think about better logging, these kind of random crashes/freezing are tricky to debug)

MrBadfinger commented 11 months ago

Not running in compatibility mode and turned off all the optional cnc-draw settings. I may overwhelm you with logs a bit but it is just to see if there is a common thread you can see somewhere.

I used the same restore point that I used last night. I tried Upscaled, Fullscreen, Borderless, and Windowed. The first 5 attempts lasted about 4-minutes each before the game locked up. On the 6th attempt, I changed it back to Upscaled, took it easy with moving around and minimized the activity (building, new units, battles, etc). I waited about 10 minutes and became active again and it locked up minutes later.

I have attached the log files for each attempt. The ddraw.ini is also included for each attempt.

The Event Viewer ("08202023 - Event Viewer.png") and Reliability monitor ("08202023 - Reliability Monitor Summary.png" and "08202023 - Reliability Monitor Details.png") in Windows was not helpful either. Event viewer referred me to WER folders, but I cannot get access to the folder so that was a dead end.

I had originally installed the 1.001 game with Origin and DeeZire some time ago. I had some of the same lock up issues and started launching the game using the Marshall.cannis.net Unofficial 1.002 Minipatch. That worked great until EA went away from Origin (and permanently stopped the workaround) and I could no longer use the mini patch. The lockup issues have started back since having to launch from the EA App. I have tried a lot of different things (compatibility mode, ddwrapper, cnd-ddraw, etc) in the last month to the point that I don't remember everything I have tried.

[Uploading cnc cnc-ddraw - 08202023-3 Fullscreen.zip -ddraw-08202023-1 and 2 Upscaled.zip…]()

cnc-ddraw - 08202023 - 4 Borderless.zip cnc-ddraw - 08202023 - 5 Windowed.zip cnc-ddraw - 08202023 - 6 Upscaled less activity.zip ![08202023 - Event Viewer](https://github.com/FunkyFr3sh/cnc-ddraw/assets/142686905/8fc30e50-e425-480a-bbcf-16e462c 08202023 - Reliability Monitor 
![08202023 - Reliability Monitor Details](https://github.com/FunkyFr3sh/cnc-ddraw/assets/142686905/b2bae6b0-0804-4849-ba47-cfe81cef49b1)
Summary 40785)

FunkyFr3sh commented 11 months ago

All logs are looking the same, the main thread of the game stops refreshing the screen but the secondary thread that handles the mouse cursor is still running just fine. Doesn't look like it's a problem with cnc-ddraw.

The game has 2 different ways to update the screen, one is "Blt" and one is via "lock/unlock", I made a custom build that disables the "Blt" code, maybe you got some more luck with that one:

cnc-ddraw_RedAlert2_NoBlt.zip

MrBadfinger commented 11 months ago

No luck. I had to change to Fullscreen Upscaled because the default Full Screen opened minimized and would not maximize. Other than that, it locked up in the same place.

LuKeSt0rm commented 10 months ago

I have the feeling that it is specifically related to the Origin version.

For testing purposes: 1.copy the complete RA2 folder e.g. to the desktop 2.replace the game exe files with the ones from the attachment (Origin stub removed, allows starting without Origin/EA App) 3.start the game and report if it changes anything RA2_NoOrig.zip

FunkyFr3sh commented 10 months ago

So you said it used to work with the "Marshall.cannis.net Unofficial 1.002 Minipatch", do you still have these files? I'd like to have a look into them, maybe I can figure out what changes they've done in that patch

MrBadfinger commented 10 months ago

Responding to the last 2 posts, I made a copy of the RA2 folder and copied the .exe files to it - this still has the cnc-draw-NoBLT files. I ran the RA2Launcher.exe and Yuri.exe and neither opened EA. Both games still ends up locking up after that same 4 minutes :-(

The mini-patch is just an exe to execute the program. Copy it to the RA2 folder. There is a "Mini-Patch Information" button although all the cannis.net links are dead.

YR Unofficial 1.002 Mini-Patch.exe.zip

FunkyFr3sh commented 10 months ago

When ran via the mini patch the game is ran with a "VistaSetup" compat mode, maybe that does some magic? Not sure what this compat mode is about, never heard of it.

Here's a bat file to try it out without the launcher (should work in the copied game folder you made) YR.zip

Can be confirmed via cnc-ddraw.log if it's working, should have the "VistaSetup" showing up at the __COMPAT_LAYER line [1876] 19:27:06.774 __COMPAT_LAYER = VistaSetup

You can also get your mini patch launcher working again now in the copied game folder, but you need to fix some registry keys first. Should be these here:

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Westwood\Red Alert 2] "InstallPath"="C:\Path to your copied game folder\Command and Conquer Red Alert II\RA2MD.EXE"

MrBadfinger commented 10 months ago

I got the mini-patch working. Along with a lot of "missing cameos" in the buildings and units, the game I was playing still locks up around the same spot.

Unless there is anything else you want me to try, I may delete and reinstall. It may take some work to get back to where it was before EA and the other changes were made but I will keep the standalone files to use later.

I really, really appreciate the time you have spent helping with this. Hopefully, the info in this thread helps someone else down the road.

FunkyFr3sh commented 10 months ago

Yeah, good idea, maybe it helps to reinstall. I have no idea what else to try

MrBadfinger commented 10 months ago

Thank you again for your help and persistence. Also, thank you to LuKeSt0rm's for your suggestion. It's not easy troubleshooting someone else's issue with the uncountable number of variables and on your own time.

I'll update you whether the reinstall fixes the issue or not but might take me some time to get to it.