Quick caveat - if you're hoping for a simple, easy explanation on how to get this one video game working in whatever flavor of LINUX you happen to be running, think again. I hate Windows, I prefer to not have Windows running on my computer, not even in a virtual machine, but in this particular case, for most other people, I'd actually suggest trying to get this game working in Windows first before going down this particular rabbit hole.
That being said, unless you are using a computer that is more than two years old with Windows XP, you will probably have a really hard time getting this game to run correctly, especially if you are using an HD series ATI video card or any GeForce video card newer than the 8000 series. Therefore (ironically) trying to get the game running correctly in LINUX actually makes a certain amount of sense, even with the complexity involved.
"What's with the whole 'while Rome burns' comment, Valkyri9?"
Oh that? I'm just remarking on how silly this article seems when compared to things like Occupy Wall Street causing protests to spawn in other major metropolitan areas across America, when we still have over 9% unemployment and the economy has been officially declared as in ANOTHER recession, as food prices skyrocket and incidents of crime increase and prisons are releasing their "less dangerous" prisoners due to insufficient funding and chaos is everywhere while the rest of the country is fast asleep. Or the lesser issue where WineHQ itself was hacked. It's all about perspective. Getting an old video game to run in LINUX is not a challenge compared to these issues, and could quite seriously be called a complete waste of time. But it does pose some interesting questions, so in my mind it's still a worthwhile pursuit.
Of course all of this pales when compared to the Universe, as pointed out by my friend Hardgeus. So again, perspective.
"Why are you even bothering with Star Wars: X-Wing Alliance? This game is over twelve years old!"
This is true, however, it is also the last complete space-flight simulator released by LucasArts. There have been other simulators since, but because they were designed for console systems such as the Sony Playstation or the Nintendo Gamecube they did not grant the player full control over their craft. This level of control enhances the immersive qualities of this game, much like it did in its predecessors (Star Wars: X-Wing, Star Wars: TIE Fighter and Star Wars: X-Wing vs. TIE Fighter).
In other words, it's the last Star Wars themed video game out there that lets you do things like match the speed of your target, divert power from engines toward shields or lasers, or transfer power in quick bursts from shields to lasers or vice versa. It's the last Star Wars themed video game out there that will allow you to quickly slow down to 1/3 your maximum speed so that you can perform a quick turn in order to get a bead on your opponent, and then quickly switch back to max speed in order to stay on their tail. It's the only one set up so that you can map out the buttons on your flight stick in order to be able to easily look around in your cockpit, switch weapons from lasers to missiles, throttle up/down, perform rolls and other evade maneuvers, and so forth. That makes it relevant. It also makes it a goddamned shame that the developers decided to rely as heavily on DirectX 6.0 as they did during development, because now it's come back to bite those of us who still love this game in the ass. Thank you Microsoft, for yet again finding another way to piss me off. While I'm at it, hey LucasArts, stop recycling those pieces of fecal matter you call The Force Unleashed and start making some good games again. Is that too much to ask?
So to get to the nitty gritty - I received an email from a gentleman asking if I had run into an issue where the entire background of the game goes blue - or black after running Reiman's patch, and could not get in-game sound effects or voices to work. I had not attempted to get the game working for quite some time; after my last aborted attempt I decided I'd wait for Wine to mature some more before I gave it another shot. So I let him know I'd try again now that PlayOnLinux had made some great strides and we are now up to version 1.3.30 in Wine. Current documentation at WineHQ is old and out of date, but indicative of the problems I had previously run into when trying to get this game working.
PlayOnLinux is an amazing tool. Go to the website and install a copy on your LINUX system if you haven't already. Wine is an awesome tool but it comes at the price of complication when dealing with these kinds of games. My success rate in getting a game to work in Wine has been improved dramatically when using PlayOnLinux because I don't have to spend as much time fighting with the software, trying (begging and pleading) to get it to work. The biggest benefit of PlayOnLinux is that it encapsulates each of your software installations, so that when you make a change to try to get one game working, you don't inadvertently break all of the other games that used to work just fine. It also makes it very easy to use different versions of Wine - sometimes regressions occur with new Wine releases, and this tool makes it incredibly simple to specify the version you want with the game in question. I can't praise it enough.
I also used to use something called POL Helper so that I could easily take advantage of winetricks. This is no longer necessary as the primary functions of winetricks are now built into PlayOnLinux and done in a significantly more user friendly way.
You must have a copy (legitimate copy is strongly recommended here) of Star Wars: X-Wing Alliance, which I have. However, because the CD copy protection does not play well in Wine, I also obtained a utility to strip this copy protection from the main X-Wing Alliance executable. As far as I'm concerned I am well within my rights to take whatever steps necessary to get a twelve year old copy of software that I purchased through legitimate means in working order, especially when the developer or publisher has pretty much washed their hands of any responsibility beyond hosting a patch update (and many don't even do that for more than a few years). However, explaining how to accomplish this is not within the scope of this post (you're on your own).
PlayOnLinux does not at this time have an automated installation option for Star Wars: X-Wing Alliance, but it is perfectly fine to select "Install a non-listed program" in order to install it. I chose "Install a program in a new virtual drive", created a wineprefix with the name XWingAlliance (no spaces) and then selected "Configure Wine" and "Install some libraries".
In winecfg I changed the OS version to Windows 98 since that was the latest Windows version available when the game shipped, and I selected ALSA as the default audio option and applied my changes. I did not change the Wine version to 1.3.30 at this time because it resulted in an incomplete install - I left it at the default "System" version of Wine, the 1.2 release that shipped with Ubuntu Natty Narwhal. I also installed the d3dx9 and directplay libraries in the next menu since these areas have not yet been fully addressed in Wine for many games.
I then installed the game from the CD-ROM, which was pretty much identical to a Windows install, and was sure to select Full Install (275MB) in order to get the majority of the files copied over from the disk. I elected to not select Alliance.exe as the icon launcher because I knew it also made checks to verify the game disk was present in the drive. I also knew that if I needed to create or select a new pilot I could access the launcher from within its installed folder, or from Applications > Wine > Programs > LucasArts > X-Wing Alliance > Play X-Wing Alliance in the Ubuntu menu, and I prefer to not have multiple entries for the same program within PlayOnLinux. I instead browsed for and selected xwingalliance.exe as the launcher.
Because my laptop has a built-in Radeon HD 5850, I had already installed AMD's latest proprietary drivers for the best possible 3d rendering support as documented on the unofficial AMD LINUX driver wiki. I also selected X-Wing Alliance from the PlayOnLinux menu and clicked the Configure button. I selected 1.3.30 in the Wine Version menu, then switched to the Display tab and left everything at default except for "Video memory size", which I changed to 2048 to reflect the 2GB memory dedicated to my graphics card. I finished up my PlayOnLinux setup by selecting the Wine tab so I could click the "Windows reboot" button in order to refresh the system with these changes.
For (hopefully) obvious reasons, X-Wing Alliance does not support widescreen resolutions. To address this, I visited WSGF (Widescreen Gaming Forum) and found their article for this game. I downloaded and installed ghex from the Ubuntu repositories and followed their instructions on modifying the entry in xwingalliance.exe for 1280x1024 to display at 1920x1080. I also applied the NOCD patch on xwingalliance.exe to remove its CD checks at this time.
At this point the game failed to launch, so I accessed winecfg from the PlayOnLinux config window under the Wine tab, and changed DirectPlay from (Native) to (Native, then Built-In) and tried again. The game now launched correctly, running movies and the main screens at 800x600 stretched across the widescreen. Starting a new mission and entering the hangar rendered correctly at 1920x1080, but the mission could not begin because no keyboard inputs were recognized within the hangar. Consequently the game was unplayable from this perspective. It was possible to start a new game in the simulator environment in single player mode because no launch from a hangar was necessary. I did not bother testing multiplayer mode because I fully expected it to fail due to the lack of support for DirectPlay, and that really wasn't within the scope of my expectations at this time anyway.
Reimar Döffinger, author of the XWA Hacker tools on Sourceforge that will help get this game and other X-Wing themed games running on new hardware and new Windows systems, mentioned in a Wine bug report that I can no longer find that he had been successful at correcting this input bug in X-Wing Alliance with Wine 1.2.0 by replacing dinput.dll.so with the same file from Wine 0.9.15 - and he had uploaded the file so that others might be able to use it in their version of Wine. Much to my disappointment, by the time I found this, both his hosted file and someone else's had already been taken offline.
I was not able to find a copy of Wine 0.9.15 on WineHQ, but I was able to download a copy of Wine 0.9.19 and compile it. I copied my new version of dinput.dll.so from Wine version 0.9.19 into my Wine 1.3.30 installation under my .PlayOnLinux folder and tried again. The input bug in the hangar was eradicated. I had one last thing to address - the game played music but there were no voices or sound effects.
I accessed my CD-ROMs and copied the "wave" folder from each disk into my PlayOnLinux prefix XwingAlliance folder. I also did the same with the "movies" folder from each disk.
I now have a fully playable (at least single player anyway) Star Wars: X-Wing Alliance running on Wine in Ubuntu!
For my next trick, I will be repairing my Moon Patrol arcade cabinet that no longer boots up properly.
Thank you, Reimar!