Wing Commander IV DVD edition on Linux

Darkmage

Vice Admiral
Hi guys,

I've been doing some work on getting Wing Commander IV DVD edition (GOG) tested for WINE under Linux. I run Debian 12 Bookworm with WINE-7.21 and the game is basically fully working. I have the GOG DVD edition, it runs, joystick/keyboard/mouse all work. Cutscenes work correctly. I have wine set to run wc4dvd.exe in Windows 98 mode. I have unchecked the option to allow the window manager to control the windows in winecfg. I also run regsvr32 ac3filter.ax and regsvr32 Mpeg2DecFilter.ax to install the codecs. The game then runs perfectly.
 
I use an application called Bottles to manage Wine prefixes. I set up one for all the Windows WC games. It's nice because you can extract a bottle as a backup and import it to any computer and it works exactly the same. Basically, set up the games once and you're done forever! There's also an import from Lutris in case you used that application to set the games up. It translates it all to Bottles configurations with ease.

1668449573328.png
 
Hi, I have been trying to get WC4 working on my SteamDeck using Lutris, Wine, Proton and also Bottles for the last few days.
Sadly without success.
  • I ran regsvr32 Mpeg2DecFilter.ax and regsvr32 ac3filter.ax to make sure the codecs were installed.
  • I disabled "Allow the windows manager to control the windows" in Wine.
  • I tried LAVFilters and K-Lite_Codec_Pack as alternatives.
  • I tried wc4dvdwin2kfix.zip and also wc4dvdwin2kfixalt.zip.
  • I also tried all files 1:1 from the WC4CDtoDVD.exe patch (extracted via 7zip).
  • I tried dxmci15.zip, dxmci13.zip, dxmci12.zip and dxmci10.zip plus all combinations of settings from configure dxmci.
So many combinations I lost track :(

The worst I got was direct crashes of the game when cutscenes would start.
In other combinations black screens when movies would start (I could still quit the game via Alt-F4).
The closest I got was getting a rainbow bars substitute for the movies, when they were supposed to be displayed.

Very frustrating...

I own both the original DVD version as well as the original CD version of the game.

@Darkmage and @ZFGokuSSJ1 - would you be willing to provide your wine/bottles config files and tell me the exact combination of patches you used?

Thanks a lot in advance!
 
@PWC Looks to be quite a few issues for WC4 DVD on Linux. DXVK cutscene problem, Wine screen offset problem. I tried it now on Lutris & Bottles and sure enough I am having these issues. Game plays fine, it's just those issues and what looks to be a GStreamer plugin issue that doesn't play the cutscenes:

Code:
winegstreamer error: decodebin2: Your GStreamer installation is missing a plug-in.
winegstreamer error: decodebin2: ../src-gst_base/gst/playback/gstdecodebin2.c(4719): gst_decode_bin_expose (): /GstBin:bin2/GstDecodeBin:decodebin2:
no suitable plugins found:
Missing decoder: DVD AC-3 (ATSC A/52) (audio/x-private1-ac3)
Couldn't set protonvideoconverter4 to READY

winegstreamer error: decodebin3: Your GStreamer installation is missing a plug-in.
winegstreamer error: decodebin3: ../src-gst_base/gst/playback/gstdecodebin2.c(4719): gst_decode_bin_expose (): /GstBin:bin3/GstDecodeBin:decodebin3:
no suitable plugins found:
Missing decoder: AC-3 (ATSC A/52) (audio/x-ac3, framed=(boolean)true, rate=(int)48000, channels=(int)6, alignment=(string)frame)
Couldn't set protonvideoconverter7 to READY

Experiencing similar errors between Lutris & Bottles. Looks like Bottles is addressing a general issue with GStreamer. I also loaded up distrobox to set up a test environment to bypass Flatpak restrictions and had the same problems there.

Basically, it's all over the place and I'm not really sure what is at fault. Based on the error, it's GStreamer itself, which would explain why it's broken for all those programs you installed from.

You could try old versions of Wine to see if one of them works. Unsure what else you can do aside from loading Windows or resigning to the DOS version, which will play flawlessly. Unfortunately I am not knowledgeable enough to track down how to get this fixed permanently. You'd think since WC4 DVD is so old it'd be working already.
 
Hello ZFGokuSSJ1, thanks a lot for trying. It's very sad that WC4 is not working, it's a great classic game worth re-playing...
 
Hello ZFGokuSSJ1, thanks a lot for trying. It's very sad that WC4 is not working, it's a great classic game worth re-playing...
Got it working (mostly) using Bottles. Everything works except the cutscenes have no sound. Here are the steps I had to do:

1. Create a 'custom' bottle with these parameters: sys-wine and architecture 32-bit
2. Install GOG WC4 in that bottle
3. Click Settings --> Environment Variables --> add one called 'BOTTLES_USE_SYSTEM_GSTREAMER' with value of '1'
4. Go back to the WC4 bottle screen. Click Legacy Wine Tools --> Configuration. Click Graphics tab, uncheck 'Allow the window manager to control the windows'
5. Click Command Line on WC4 bottle screen. Navigate to the WC4 install directory and run 'regsvr32 ac3filter.ax' and 'regsvr32 Mpeg2DecFilter.ax'
6. Launch wc4dvd.exe.

Should play movies and game, but again, no cutscene sound. Not sure how to fix this yet. It's weird because I run GStreamer directly to playback the file, it plays fine:
Code:
gst-launch-1.0 playbin uri=file://var/home/keenan/.var/app/com.usebottles.bottles/data/bottles/bottles/wc4/drive_c/GOG\ Games/Wing\ Commander\ IV/vob/SC_0010B.vob

Every Proton-based Wine runner I've tried just can't play the cutscenes. If I use a vanilla Wine one, they do work. I may open an issue in Valve's Proton Github to see if maybe they could address.
 
Last edited:
Hello @ZFGokuSSJ1, I spent another day trying to get it working...
But I haven't had as much success as you have, even using the identical steps. :(

What I have been getting to work is video playback via command line
gst-launch-1.0 playbin uri=file://the/location/of/my/testfile/SC_0010A.vob
as you have - including sound.

First, it wouldn't do that on the Steam Deck (with the default installation of gstreamer).
After the following commands it would play the video file via gst-launch-1.0 command....
Bash:
passwd
sudo pacman-key --init
sudo pacman-key --populate archlinux
sudo pacman-key --refresh-keys
sudo steamos-readonly disable
sudo pacman -S gst-plugins-base gst-plugins-base-libs gst-plugins-good gst-plugins-bad gst-plugins-ugly gst-libav libde265 lib32-gst-plugins-base lib32-gst-plugins-base-libs lib32-gst-plugins-good
sudo steamos-readonly enable

As for video inside Bottles/the game, I followed your steps to the letter, including BOTTLES_USE_SYSTEM_GSTREAMER as described in step 3. But it still doesn't play back the video. All I get is "No combination of filters could be found to render the stream." followed by "DX MCI Error - Error loading video!" and
"Missing movie c:\vob\sc_0010a.vob" (with the default GOG exe).
Or "Error Rendering file! (0x80070003)".

Bottles has the following variables set up via Flatseal
Code:
PATH=/app/bin:/app/utils/bin:/usr/bin:/usr/lib/extensions/vulkan/MangoHud/bin/:/usr/bin:/usr/lib/extensions/vulkan/OBSVkCapture/bin/
GST_PLUGIN_SYSTEM_PATH=/usr/lib/gstreamer-1.0:/usr/lib32/gstreamer-1.0
LD_LIBRARY_PATH=/app/lib:/usr/lib:/app/lib32:/usr/lib32

I even allowed Bottles access to all files (system, shared libs, execs, configs, other files) - just for a test run. That didn't help either.

I started Bottles from the command line to get its direct log outputs in the console:
Code:
> /usr/bin/flatpak run --branch=stable --arch=x86_64 --command=bottles --file-forwarding com.usebottles.bottles

(bottles:2): Gtk-CRITICAL **: 18:07:52.465: gtk_widget_set_parent: assertion '_gtk_widget_get_parent (widget) == NULL' failed
18:07:52 (INFO) Library saved
18:07:54 (INFO) Setting Key use_steam_runtime=True for bottle wine-x86…
(bottles:2): Gtk-CRITICAL **: 18:07:54.589: gtk_box_append: assertion 'gtk_widget_get_parent (child) == NULL' failed
18:07:57 (INFO) Launching an executable…
18:07:57 (WARNING) Windows path detected. Avoiding validation.
18:07:57 (INFO) Using Wine Starter -- run
18:07:57 (INFO) Using Steam runtime scout
18:07:57 (INFO) Using EasyAntiCheat runtime
18:07:57 (INFO) Using BattlEye runtime
002c:err:wineboot:process_run_key Error running cmd L"C:\\windows\\system32\\winemenubuilder.exe -r" (126).
winegstreamer: failed to create decodebin, are 32-bit GStreamer "base" plugins installed?

(wine:194): GStreamer-CRITICAL **: 18:08:00.561: gst_element_set_state: assertion 'GST_IS_ELEMENT (element)' failed
(wine:194): GStreamer-CRITICAL **: 18:08:00.561: gst_pad_unlink: assertion 'GST_IS_PAD (sinkpad)' failed
(wine:194): GStreamer-CRITICAL **: 18:08:00.561: gst_object_unref: assertion 'object != NULL' failed
(wine:194): GStreamer-CRITICAL **: 18:08:00.561: gst_element_set_bus: assertion 'GST_IS_ELEMENT (element)' failed

Very strange, as all 32-bit base plugins are installed, as I've re-checked here:
Code:
>pacman -Qs gstreamer
local/gstreamer 1.20.4-1
    Multimedia graph framework - core
local/lib32-gstreamer 1.20.3-2
    Multimedia graph framework (32-bit) - core
local/phonon-qt5-gstreamer 4.10.0-3
    Phonon GStreamer backend for Qt5

>pacman -Qs gst-plugins
local/gst-plugins-bad 1.20.4-1
    Multimedia graph framework - bad plugins
local/gst-plugins-bad-libs 1.20.4-1
    Multimedia graph framework - bad
local/gst-plugins-base 1.20.4-1
    Multimedia graph framework - base plugins
local/gst-plugins-base-libs 1.20.4-1
    Multimedia graph framework - base
local/gst-plugins-good 1.20.4-1
    Multimedia graph framework - good plugins
local/gst-plugins-ugly 1.20.4-1
    Multimedia graph framework - ugly plugins
local/lib32-gst-plugins-base 1.20.3-2
    Multimedia graph framework (32-bit) - base
local/lib32-gst-plugins-base-libs 1.20.3-2
    Multimedia graph framework (32-bit) - base
local/lib32-gst-plugins-good 1.20.3-2
    Multimedia graph framework (32-bit) - good plugins

I have not been able to install the "bad" and "ugly" plugins for win32, as they are not installable via pacman (not in repro any more, it would seem).

What also fails on my machine is playing the file with the 32bit version ov gst-launch.
Code:
> gst-launch-1.0-32 playbin uri=file://the/location/of/my/testfile/SC_0010A.vob
ERROR: pipeline could not be constructed: no element "playbin".

Maybe you have better luck with the 32bit gst-launch, pointing towards an actually usable warning or error...
 
@PWC I'm on Fedora Kinoite, so there's probably some GStreamer differences between that and SteamOS/Arch.

Here are my environment variables for Bottles in Flatseal:

Code:
PATH=/app/bin:/app/utils/bin:/usr/bin:/usr/lib/extensions/vulkan/MangoHud/bin/:/usr/bin:/usr/lib/extensions/vulkan/OBSVkCapture/bin/
GST_PLUGIN_SYSTEM_PATH=/app/lib/gstreamer-1.0:/usr/lib/x86_64-linux-gnu/gstreamer-1.0:/app/lib32/gstreamer-1.0:/usr/lib/i386-linux-gnu/gstreamer-1.0
LD_LIBRARY_PATH=/app/lib:/app/lib32

Doesn't appear to be modified by me, so they are stock. Are you on the latest version?
 
@ZFGokuSSJ1 - I am on GSteamer 1.20.4 (the latest version available via pacman).
The 32bit version shows 1.20.3 when typing gst-launch-1.0-32 --gst-version

Did you try starting bottles from command line to get all outputs? Maybe there is a specific warning/error when it starts playing videos).

And did playback via 32bit gst-launch-1.0 from command line work for you? (not the x64 version)
 
@PWC I don't have the 32-bit executable of gst-launch-1.0 on my system.

Looks like Bottles' gstreamer got some fixes in the latest version released yesterday.

Tried again, this time without the environment variable as that is no longer needed. Same issue as before with no sound during cutscenes.

Code:
08:54:51 (INFO) Launching an executable… 
08:54:51 (WARNING) Windows path detected. Avoiding validation. 
08:54:51 (INFO) Using Wine Starter -- run 
08:54:51 (INFO) Using EasyAntiCheat runtime 
08:54:51 (INFO) Using BattlEye runtime 
002c:err:wineboot:process_run_key Error running cmd L"C:\\windows\\system32\\winemenubuilder.exe -a
-r" (126).


(wine:1247): GStreamer-WARNING **: 08:54:52.534: Failed to load plugin '/usr/lib/x86_64-linux-gnu/g
streamer-1.0/libgstaccurip.so': /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstaccurip.so: wrong ELF
class: ELFCLASS64


(wine:1247): GStreamer-WARNING **: 08:54:52.535: Failed to load plugin '/usr/lib/x86_64-linux-gnu/g
streamer-1.0/libgstadder.so': /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstadder.so: wrong ELF cla
ss: ELFCLASS64


(wine:1247): GStreamer-WARNING **: 08:54:52.535: Failed to load plugin '/usr/lib/x86_64-linux-gnu/g
streamer-1.0/libgstadpcmdec.so': /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstadpcmdec.so: wrong E
LF class: ELFCLASS64


(wine:1247): GStreamer-WARNING **: 08:54:52.536: Failed to load plugin '/usr/lib/x86_64-linux-gnu/g
streamer-1.0/libgstadpcmenc.so': /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstadpcmenc.so: wrong E
LF class: ELFCLASS64


(wine:1247): GStreamer-WARNING **: 08:54:52.536: Failed to load plugin '/usr/lib/x86_64-linux-gnu/g
streamer-1.0/libgstaes.so': /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstaes.so: wrong ELF class:
ELFCLASS64


(wine:1247): GStreamer-WARNING **: 08:54:52.537: Failed to load plugin '/usr/lib/x86_64-linux-gnu/g
streamer-1.0/libgstaiff.so': /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstaiff.so: wrong ELF class
: ELFCLASS64


(wine:1247): GStreamer-WARNING **: 08:54:52.537: Failed to load plugin '/usr/lib/x86_64-linux-gnu/g
streamer-1.0/libgstalaw.so': /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstalaw.so: wrong ELF class
: ELFCLASS

It goes on and on for all the gstreamer components. It makes sense as it is a 32-bit bottle, so these components aren't used.

You haven't modified the base system in any way, have you? AKA, disabling the read-only FS and installing/changing stuff.
 
Hello,
I just updated bottles, still no luck on my end. "No combination of filters could be found to render the stream"

As for your question: I first tried it with an unmodified filesystem (readonly), but since not even gst-launch-1.0 playbin would play back the videos in the default installation (missing good, bad and ugly gstreamer plugins) , I installed these packages using pacman and also updated all components installed on the system with pacman. No manual changes to configs.
In the end I was able to at least playback the videos using gst-launch-1.0 playbin (64bit version) with video and sound from the command line. But nothing further (nothing inside any of bottles, wine, proton, lutris). Looks like WC4 just does't want to be played :(

Anyway, thanks for trying...
 
I'm going to ask around the various developers / issue trackers because WC4 really should be working flawlessly at this point. As I said before, I'm not really sure what is at fault here, but hopefully someone does.
 
Used ZFGokuSSJ1's method and the game runs fine, but for some reason the options menu just gives me a black screen, and without it, I can't set my controls. And for some reason the keyboard keys aren't moving my ship, save rolling.

Edit: It's actually all gameflow screens that don't work.

The problem persists when installing the GOG version through Lutris. Movies play fine if I use a virtual desktop. disable window manager controlling windows, and install K-lite int he wine prefix, but none of the gameflow screens work.

Cruel irony that I have movies and no game and y'all have game and no movies.
 
Last edited:
Was someone ever be able to get WC IV running on the steam deck.
I managed to get it installed via lutris. It more or less works on Destopmode.
As LividLiquid statet. I had to disable window manager controlling windows in the wine config. Pretty every version of proton runs the game (by now I use GE-Proton 8-23). The game starts plays the movies and I played the first mission.
I installed the HD movie pack and the game runs (the aspect ratio seems to be messed but hey...)
I even managed to change the inflight language by installing the dos version and copy the files from this installation to the dvd installation.

Two questions someone of you may be able to answer.

  1. I cannot get it running in gamemode. When starting the game from gamemode, I can hear the sound of the game (a long introvideo .vob is played) but the valve logo circles and I can only press steam menu or "B" to leave. The game (.vob file) is running in the background. Is there some setting I miss. The problem with Desktopmode is, that my controller scheme includes some radial- and touchmenus on the right stick and the left pad and these menus work, but were not visualized. Both is really needed to play WC games without a keyboard.
  2. I was able to install the DOS Version too. This plays quite fine in Gamemode (with low-res video - but in the end better than nothing). Problem is, that - as soon as I am ingame - the game won't recognize the joystick. Even it recognizes it well as long as it is in "dosmode" (before the game starts it asks you to calibrate the joystick and there I can see, that moving the stick is recognized). This may be a question for dosbox...but maybe someone of you has encountered such a problem and can help.

If I enable "disable window manager controlling windows" the game runs even in gamemode. But unfortunately then the game is displayed only in the lower half of the screen, so that you can only see the upper half of the game picture and even if it works well it is unplayable.


Is there someone out there who can help. I play WC 1, 2 and 3 on the deck. And it is absolute fantastic (I use xreal air and have such a huge screen).
 
Last edited:
Great thread guys. I am a Linux and steam deck noob. @Knobi Wan Penobi please explain your success with WC1,2&3 on Steam Deck game mode. I am using GOG versions with limited success. Had to use keyboard as input for WC3 and remap the Steam Input to joysticks and triggers to get good controls. I also cant get the general midi sound on WC3 to work using Qsynth.
 
Great thread guys. I am a Linux and steam deck noob. @Knobi Wan Penobi please explain your success with WC1,2&3 on Steam Deck game mode. I am using GOG versions with limited success. Had to use keyboard as input for WC3 and remap the Steam Input to joysticks and triggers to get good controls. I also cant get the general midi sound on WC3 to work using Qsynth.

Hi @kingjoma I am currently in the process of setting up my Wing Commander collection on Steam Deck. Dos Versions of the games where available can be run quite well through the Emudeck framework. Specifically I use Emulation Station to Start and configure the games. That in turn uses retroarch for emulation.

I have Wing Commander 1 almost perfectly configured (still fiddling with controller setup as sadly the L45 and R45 buttons are not supported in emulation station yet) I have started 2 and privateer to verify they run. But I do not see why they should not.

If you are interested I can make a thread on here on how to get it running, in case there is no such thread yet.

As for the original topic of this thread: If anyoone finds a workable solution that does not require me to relearn linux (I have not really used linux in at least 10 years and forgot all that knowledge) I would be greatful if it is shared in this thread.
 
Last edited:
Another question regarding this topic: Has any one of you guys with access to the original CDs/DVD tried installing Windows 98 in a dosbox then installing WC 4 on there and running it that way?
 
Back
Top