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

[Error] Corsairs Gold #331

Closed SilentMRG closed 3 days ago

SilentMRG commented 4 days ago

Hello...

I did what is mentioned on the wiki, "renaming ddraw.dll to adraw.dll". And all I get when I start is this:

0

I tried every possible way... The only way to start the game is with the GOG adraw, but the resolution is a crap.

FunkyFr3sh commented 4 days ago

I had that error once too, but it happend for me because i moved the game folder around.

~~Try it with this .ini file here: CORSAIRS.zip~~

Edit: nope, that .ini doesn't work... Tried to fix it with relative paths. I guess you have to adjust the paths in theere manually or reinstall the game

SilentMRG commented 4 days ago

So, I'm using the GOG version, and I installed it through the offline installer, but I never moved the folder to another place. Maybe this is one of those games that requires to be installed on drive C, and I installed it on drive D, anyway, if that's the case, I'm going to give up on this game,because I don't install any game on drive C, only on D. Thank you for the help! =)

SilentMRG commented 4 days ago

I just reinstalled, and I looked at the root folder and no .ini file was present, so I started with GOG's adraw, and then I closed it, looked again at the root folder and there was a .ini file with various information... And the paths they were correct, nothing unusual, so I deleted adraw from GOG and threw cnc in, renaming ddraw to adraw, I started it and received the aforementioned error again, finally, I looked again at the root folder and the "corsairs" .ini file was gone, and in its place was another "CORSAIRS" .ini file with just this content:

[PATHS] PATHCDROM=C:\

I renamed this to D, and even pasted the root directory path, but it simply won't accept changes and always goes back to the same drive. The curious thing is that this content was not, at least I didn't see, in the other .ini file.

FunkyFr3sh commented 4 days ago

That's weird, for me it works fine with cnc-ddraw. IT doesn't modify the .ini

SilentMRG commented 4 days ago

If you want, you can close it. I just asked for a refund, this simply won't work and this error will join the "hall of bizarre errors I've seen". I have to start reading the negative reviews on the GOG page, hehe. Thanks again for the help my man!

FunkyFr3sh commented 4 days ago

Just had a look at the code, looks like a CD check is broken, it looks for a file on the CD if it doesn't exist it would overwrite some values in the .ini

Here's the exe with the check removed: corsairs.zip

Edit: Instead of using a patched exe you can also try to make your corsairs.ini read-only

You need a working ini for it though, once it's broken you can't return to a working game

SilentMRG commented 4 days ago

My man, you are a friend, not even GOG support solved the problem, I asked for a refund, but I still have the offline installer, so I will test that tomorrow. About the .ini file, could it be the one that is created when I start the game for the first time using GOG's adraw?

FunkyFr3sh commented 4 days ago

I didn't test much with the adraw from gog because the game doesn'T start for me with it. But now I just had a look and it seems like it contains code to write the corsairs.ini to the disk. That would explain why you're not supposed to replace their adraw.dll with another ddraw.dll.

GOG done a mistake here, placing game patches into a ddraw.dll proxy is not a good idea. They've done the same mistake with other games too like diablo 1.

I still don't know why it would delte the .ini for you and doesn't delete it for me

elishacloud commented 4 days ago

About the .ini file, could it be the one that is created when I start the game for the first time using GOG's adraw?

I remember having a similar problem with the GOG version of this game. I had to get the game working first with the GOG version of adraw.dll before replacing it with another wrapper.

SilentMRG commented 3 days ago

Well, I took the test...

But this time something strange happened... when restarting with your No-CD, the .ini file created by GOG's adraw was simply deleted and no other was created in its place. WTF... GOG must have put some kind of DRM on that adraw, to prevent modifications to the game. It's the only thing I can think of, and maybe their adraw forces some kind of "administrator privileges" for these changes to be made.

You mentioned "proxy patch", and I saw that some games require this to work with cnc-ddraw, so perhaps it is necessary to create a "proxy.dll" for that game. Maybe that code you saw on GOG's adraw will be useful for creation. Anyway, just a suggestion from an amateur on the subject.

FunkyFr3sh commented 3 days ago

Well, I took the test...

  • I reinstalled the game;
  • I started with GOG adraw;
  • The ".ini" file was generated;
  • I deleted the adraw from GOG;
  • I applied cnc-ddraw;
  • I renamed the cnc ddraw to adraw;
  • I applied No-CD and restarted;
  • And unfortunately, I received the same error mentioned above.

But this time something strange happened... when restarting with your No-CD, the .ini file created by GOG's adraw was simply deleted and no other was created in its place. WTF... GOG must have put some kind of DRM on that adraw, to prevent modifications to the game. It's the only thing I can think of, and maybe their adraw forces some kind of "administrator privileges" for these changes to be made.

You mentioned "proxy patch", and I saw that some games require this to work with cnc-ddraw, so perhaps it is necessary to create a "proxy.dll" for that game. Maybe that code you saw on GOG's adraw will be useful for creation. Anyway, just a suggestion from an amateur on the subject.

Ah damn... For me it never deletes the file, so I can't reproduce that bug

But what also worked for me: Run the game once with the original adraw to let it generate a valid corsairs.ini, now make the corsairs.ini read-only via windows explorer/properties. Replace adraw with cnc-ddraw

elishacloud commented 3 days ago

Here is a stub you can use for adraw.dll. You need both the dll and ini files in here. But you can put this in place of the GOG adraw. Then you can use the normal ddraw.dll from cnc-ddraw or any other wrapper.

Note: this is just the stub from dxwrapper with the option set to NOT load dxwrapper.

Here is the download: adraw.zip

SilentMRG commented 3 days ago

Ah damn... For me it never deletes the file, so I can't reproduce that bug

But what also worked for me: Run the game once with the original adraw to let it generate a valid corsairs.ini, now make the corsairs.ini read-only via windows explorer/properties. Replace adraw with cnc-ddraw

So, I did this yesterday, I marked the file as read-only, but even that didn't help. This really is a pirate game, even the files disappear. XD

Here is a stub you can use for adraw.dll. You need both the dll and ini files in here. But you can put this in place of the GOG adraw. Then you can use the normal ddraw.dll from cnc-ddraw or any other wrapper.

Note: this is just the stub from dxwrapper with the option set to NOT load dxwrapper.

Here is the download: adraw.zip

Thank you for your help, but unfortunately it didn't work. I made a point of reinstalling the game once again, I started the game with GOG's adraw, so that the ini file was created, then I deleted GOG's adraw and threw its files into the root directory, I also played cnc-ddraw there, and I got the same error. As previously mentioned, starting the game without GOG's adraw deletes the "corsairs" ini file and creates another ini file called "CORSAIRS" in its place (yes, written in capital letters and with the aforementioned content).

SilentMRG commented 3 days ago

Just for the record, this is the content of the ini file created by GOG's adraw:

; CORSAIRS.INI ;Fichier d'initialisation

[FILE] PLAYER_NATION=BLUE MISSION_NUMBER=1 NATIONNUMBER=4 BOARDINGTYPE=2

; Chemins d'accès... [PATHS] PATHROOT=D:\CORSAI~1\ PATHDATA=D:\CORSAI~1\DATA\ PATHSAVE=C:\Users\DOCUME~1\ PATHCDROM=D:\CORSAI~1\ PATHBOOK=D:\CORSAI~1\BOOK\ PATHSOUND=D:\CORSAI~1\SOUND\

[AUDIOTRACK] OFFSETTRACK=0

[GENERAL] LANGUAGE=PORTUGUESE

; Valeurs de Test: [TEST] MAP=MAP\ANTILLES.PRM OLDMAP=MAP\VANTILLE.PRM WINDDIR=0 WINDFORCE=100 TREASURE=10000 MUSIC=1 LENGTHBETWEENBOATS=60 GAMEOVER=YES [SOUND] CD_VOLUME=32767 SFX_VOLUME=200 VOICE_VOLUME=200

And just out of curiosity, when I start the game with GOG's adraw, I get a terrible slowdown (this was reported in the reviews on the GOG page) and I also get warnings about something like "MCI is not installed", there are several warnings in the main menu and throughout the other menus, it says things like "MCI driver not found", I have never seen these errors in any other game.

Edit: There is a "~" in between "CORSAI" and "1". Github crossed out the paths, hehe.

elishacloud commented 3 days ago

I had the same issue as you. This worked for me:

  1. Make sure the game is working correctly, as installed by GOG.
  2. Once the game is working delete adraw.dll and winmm.dll (if exists).
  3. Unzip these files into the game folder: dxwrapper.zip
  4. Start the game.

BTW: I think this is an issue with the game. I think the game opens the corsairs.ini file on startup and if it runs into an issue it exits and deletes the file so that it can reset it to a new file later. But some how the code to reset it no longer exists. Maybe it was moved into the adraw.dll file?

SilentMRG commented 3 days ago

I had the same issue as you. This worked for me:

1. Make sure the game is working correctly, as installed by GOG.

2. Once the game is working delete `adraw.dll` and `winmm.dll` (if exists).

3. Unzip these files into the game folder:  [dxwrapper.zip](https://github.com/user-attachments/files/16090698/dxwrapper.zip)

4. Start the game.

BTW: I think this is an issue with the game. I think the game opens the corsairs.ini file on startup and if it runs into an issue it exits and deletes the file so that it can reset it to a new file later. But some how the code to reset it no longer exists. Maybe it was moved into the adraw.dll file?

I followed your entire step by step, and this time I received a black screen for a few seconds, only to receive the damn error later. Funky mentioned that GOG made a mistake with these and other games, Diablo to name one, the GOG team added a proxy patch to their adraw dll, and it looks like that's what's shitting on top of every other fix, I mean, deleting the adraw from GOG causes the aforementioned error due to the game not finding the "blessed" proxy patch. That's what I understood.

This error is definitely not caused by cnc-ddraw nor its dxwrapper wrapper. This is all the fault of GOG, who did a terrible job with this version of the game, and messed up the files. They usually do this with some games, one that comes to mind now is Revenant, completely mess. I think you must remember the tests I did with this game using its wrapper. =)

And again thank you for your help!

elishacloud commented 3 days ago

Ok, try these files: corsairs.zip

Steps:

  1. Unzip it to your game folder, overwriting any files in your folder.
  2. Open the corsairs.ini and change the path to the correct path. Make sure all the paths in the file are correct.
  3. Backup the corsairs.ini file in case you need it later.
  4. Use either cnc-ddraw or dxwrapper to replace the adraw.dll file.
  5. Start the game.
SilentMRG commented 3 days ago

That worked! =D And it seems that what was preventing it were the incorrect paths. I modified the paths and marked the .ini file as "read only" and it was not overwritten or deleted. However, when I select any option in the main menu, I get this warning that prevents me from clicking anything in the menu (this warning appears in the background, and alt+tab can't get it):

0

Translating the warning: "There are no drivers installed on the system". WTF... This also appears if I start with the ".exe" and adraw from GOG. So it's not a cnc-ddraw problem. I'm on Windows 7, just for the record.

elishacloud commented 3 days ago

Do you have the Interop.QuartzTypeLib.dll file? I assume you need to register some codex. It looks like you don't have an MCI video codex.

SilentMRG commented 3 days ago

Well, I have the K-Lite Codec Pack installed, I think it's supposed to have this codec and this other dll. It has many codecs.

elishacloud commented 3 days ago

Maybe you need to put your old exe file back and just make sure to update the ini file with the correct paths?

SilentMRG commented 3 days ago

I just did this, reinstalled the game completely and it fixed the paths. One thing I noticed is that when I start the game with GOG's adraw, I have music in the main menu and when I'm going to play, and when I start the game with cnc, there is no music.

Remembering that if I start with GOG's adraw or cnc-ddraw, I will receive these same "MCI" warnings, using the GOG "exe" or any other makes no difference either. I said "warnings" because there are several... Each one saying something... Damn... This game is very moody! XD

SilentMRG commented 3 days ago

But I think the problems are the codecs that the game can't "see". Well, I'll close this, the core problem has been resolved, the rest is codec issues on my side. Thank you from the bottom of my heart for all your help and patience, guys!

FunkyFr3sh commented 3 days ago

This game is using cinepak codec just like commandos (which also didn't work for you!)

SilentMRG commented 3 days ago

This game is using cinepak codec just like commandos (which also didn't work for you!)

Don't even remind me of Commandos, I was angry with that game for days. But there was a person who posted a solution, after a while, and the problem was solved, so it's strange that that solution doesn't work with this game.

SilentMRG commented 3 days ago

The fix I'm talking about is this: https://github.com/FunkyFr3sh/cnc-ddraw/issues/241#issuecomment-2124243280

I did this and the Commandos videos started working.