Enhancement Patches for Wing Commander III and IV

WC4 now has an enhancement patch and my WC3 patch has also been updated. The first post has been updated with links. Enjoy:)

@sleeper: the cockpit mode seems quite stable for me, once saved. If anyone else is having this issue let me know.
 
Hey Mash, cockpit mode saving works now.
Unfortunatly i have a repeatable crash after asking for landing permission in mission 9 or 10 (the one with the capmis attack in locanda). The game crashes with the following Error: "Sample does not have tail info: 0xcd0c0014"

never had this issue before
error.jpg
 
@sleeper: Damn, I must have messed up something in the inflight movie playback. I'll look into it.

@Quien: There are a lot of similarities between both games, so I could reuse a lot of code from the WC3 patch. Most of the differences were in Movie playback and the 16/24 bit colour options. I also had to make it work with the DVD version which doesn't include the original movies in their data files.
 
Well it’s always nice when you can use a lot of your older work. At least the engine hadn’t changed too much!
 
So I thought that the use of libvlc would fix all the issues with the DVD movie playback on Linux, so I gave the WC4 enhancement patch a quick test. I installed the game from GOG with Heroic Games Launcher, and I installed the patch following the instructions on the GitHub page, and changed a few settings in the wc4w_en.ini file. However, I didn't install the ODVS HD video pack.

As soon as I tried to launch the game, I got "VirtualProtect() failed".
 
So I thought that the use of libvlc would fix all the issues with the DVD movie playback on Linux, so I gave the WC4 enhancement patch a quick test. I installed the game from GOG with Heroic Games Launcher, and I installed the patch following the instructions on the GitHub page, and changed a few settings in the wc4w_en.ini file. However, I didn't install the ODVS HD video pack.

As soon as I tried to launch the game, I got "VirtualProtect() failed".

I don't know much about how Linux emulates a windows environment to run the game, but typically if you get the virtualprotect error running WC4 GOG version in windows it's solved by changing the compatibility mode to a different win version. Maybe see if there's some options to tweak Heroic launcher in a similar fashion.
 
@Kevin Caccamo: I'm not a Linux user, so my help here is a bit limited.
The VirtualProtect bug is actually fixed within the patch so the fact that your seeing it probably means the patch isn't being loaded.
From what I've heard, in Linux you have to enable the usage of local dll's to get the patch working.

@sleeper: I've run through the mission several times but as yet haven't been able to replicate your bug. Even tried sabotaging my code to induce it, but no joy. It turns out the code I thought might be the cause has been present since before the v0.3.0. release. So I'm not sure what the problem could be.
Just to confirm I have the right mission - You have to destroy 3 torpedoes filled with some kind of biological weapon headed for the planet. Then upon returning Rollins passes you on to Eisen , who asks you to go after Flint who has gone rogue.
Could you reinstall the previous version 0.3.0. and confirm that the bug is not present? Also if you could upload a save game preceding the mission, that might be helpful.
 
@Kevin Caccamo: I'm not a Linux user, so my help here is a bit limited.
The VirtualProtect bug is actually fixed within the patch so the fact that your seeing it probably means the patch isn't being loaded.
From what I've heard, in Linux you have to enable the usage of local dll's to get the patch working.
I added the dll override for ddraw.dll, and I'm not getting the VirtualProtect() issue any more. However, the game shows up with a black screen, and unfortunately crashes at the very start.

Note that, under a Linux/Heroic WINE prefix, there is a Vulkan-based Direct3D11 implementation provided by the DXVK project.


Never mind, I seem to have fixed that by switching to Proton-GE-9.27 instead of plain WINE. But how do I turn on the subtitles for the movies? Never mind, the option is in the "Control Parameters" screen available from the Lexington/Intrepid computer terminals.

I must say, though, one thing that would be nice to have is linear upscaling for the movies and HUD elements. I'm running the game in a 720p WINE/Proton virtual desktop, and the nearest upscaling looks ugly in some places.
 

Attachments

Last edited:
@Kevin Caccamo: I'm not a Linux user, so my help here is a bit limited.
The VirtualProtect bug is actually fixed within the patch so the fact that your seeing it probably means the patch isn't being loaded.
From what I've heard, in Linux you have to enable the usage of local dll's to get the patch working.

@sleeper: I've run through the mission several times but as yet haven't been able to replicate your bug. Even tried sabotaging my code to induce it, but no joy. It turns out the code I thought might be the cause has been present since before the v0.3.0. release. So I'm not sure what the problem could be.
Just to confirm I have the right mission - You have to destroy 3 torpedoes filled with some kind of biological weapon headed for the planet. Then upon returning Rollins passes you on to Eisen , who asks you to go after Flint who has gone rogue.
Could you reinstall the previous version 0.3.0. and confirm that the bug is not present? Also if you could upload a save game preceding the mission, that might be helpful.
hey Mash, yes its the right mission and i tried v 0.3.0 and it's the same issue.
it has nothing to do with your enhancement patch. i did a fresh install and i always run in this crash when i merge Kilrathi Sagas wc3w.exe with my native language video files (german).
very strange, i'm pretty sure i played a german windows wing commander 3 before... :(
 
I must say, though, one thing that would be nice to have is linear upscaling for the movies and HUD elements. I'm running the game in a 720p WINE/Proton virtual desktop, and the nearest upscaling looks ugly in some places.
Yep, I'll put that on my list.

@sleeper: I was curious so I found a copy of the German wc3 disk1. Strangely the file "VICD2.iff" which is causing the problem, has sounds stored in wav format instead of the acm format that the KS exe uses. None of the other iff's on the disk seem to be like this. So a simple work around would be to replace that particular "iff" with the one from the English version. I've attached the file in question, you just need to extract it to "your game folder\DATA\PROFILE\VICD2.IFF". Rollins will speek in English for that encounter, but you should then be able to carry on in German provided there arn't any other iff's formated that way.
 

Attachments

thank you for this workaround. i will share more crashes if i find any. keep up the good work. love playing in high res and widescreen :)
 
Finally found time to give these new patches a try on my linux machine. Unfortunately while everything else runs great, the configuration applet doesn't seem to detect my usb joystick which is utterly odd. Like Kevin, I generally have to use a proton build for it to work. The joystick on the old one use to work :( Has anyone had this issue?
 
Finally found time to give these new patches a try on my linux machine. Unfortunately while everything else runs great, the configuration applet doesn't seem to detect my usb joystick which is utterly odd. Like Kevin, I generally have to use a proton build for it to work. The joystick on the old one use to work :( Has anyone had this issue?
The new joystick/controller stuff uses Windows.Gaming.Input, if that helps. Not sure if that's been implemented in wine.
I'll make it optional in the next release, so you can fall back to the original joystick functions. In that case, you would loose the new configuration options but everything else should work as expected.
 
Thank you for the info! Just a guess, but I'm starting to think it's because proton detects my joystick under dinput but not xinput. Trying to figure out what I can do to get that to work.

[EDIT]

No it's not that :( Did some trickery with dumbxinputmeu and wine now recognizes the joystick as xinput but no such luck.
 
Last edited:
New updates for both patches, version 0.5.0 for wc3 and version 0.2.0 for wc4. Both can be downloaded by following the links in the first post.

Details:
I've added linear filtering when scaling GUI and Cockpit/Hud elements to make things look a bit smoother especially a lower resolutions. If you hate the look you can always disable it in the ini.

I've also made the joystick/controller stuff optional in the ini. So it can be disabled if it's not working for you.

For wc3 I've added a fix for playing sounds from some iff's within the German data files. @sleeper: you should be able to play through that Locanda mission now with out the workaround I posted earlier.
 
If you're digging into joystick, do you want to try adding Force Feedback support? I'm happy to organise remote access to a computer with a Sidewinder FF2 stick, might even donate a stick if I can get one reasonably priced.
 
Back
Top