[Guide/Research] XWAUP/DSUCP v1.6 on Linux

Want to edit the game, build your own craft and missions? Here you'll find help, tools, guides and people to discuss with.

[Guide/Research] XWAUP/DSUCP v1.6 on Linux

Maywind
Recruit
Posts: 3
Joined: Sun Mar 31, 2019 1:48 pm

Post by Maywind » Mon Apr 01, 2019 5:41 pm

Dear pilots,
This thread is meant to be, on the one hand, a guide for Linux users as to how to get X-Wing Alliance XWAUP/DSUCP v1.6 installed (and to get the gaming experience as close to native Windows as possible), on the other hand, a research report on some of the issues I have come across, which may potentially be of some interest to people working on the XWAUP project and its components.

Please note that if you are a Linux user and you're willing to try this guide to get XWAUP/DSUCP v1.6 installed, you need to be fluent enough in Linux in general and in using Wine in particular. You should know how to set up a custom Wine prefix with a specific Wine build, whether manually or by using tools like PlayOnLinux or Lutris.

As a person with no Windows machine (by choice), I've been playing the X-Wing series games (all of them, starting with the DOS games and up to and including XvT:BoP and XWA) on Linux for many years. I have installed and tried every single major patch and mod on these games, most of them successfully (the only mod I couldn't get running under Linux is Reshade).

As for XWAUP/DSUCP, I've played every release of the mod starting with v1.2 and up to and including the (currently most recent) v1.6. Most older versions (v1.5 and below) were easy enough to install and worked very well practically out of the box, while v1.6 needed some manual tweaking to get it working without crashing on startup.

So, first things first, how I got XWAUP/DSUCP v1.6 running on Linux.
Note: this was tried on an Intel Core i7-4770 machine with 16 GB RAM and a NVIDIA GTX 960 video card with 4 GB VRAM running Linux Mint 18.3 Cinnamon edition. Your mileage may vary on different hardware and software configurations.

1. You will need a custom Wine prefix for this installation, so please create one. I used a 64-bit Wine prefix, but possibly a 32-bit may suffice. You can use PlayOnLinux/Lutris to manage your custom Wine prefix, or you can make one manually.
2. You will need a recent enough Wine version. Any current Staging version of Wine will do (e.g. 4.4-Staging).
4. If you're planning to use Justagai's 60 fps hook in this Wine prefix, or if you're planning to use tools such as YOGEME, or if you're planning to use anything else that requires .NET Framework, or you'd like to play other games (e.g. XvT:BoP) with that 60 fps patch mentioned before, make sure you get a recent version of Winetricks and use it to install .NET Framework v4.6.1 inside this Wine prefix (use ./winetricks dotnet461 to accomplish that, and make sure you fully go through all the installation procedures - 4.0, 4.5, and 4.6.1 will be installed in succession). Note that this is recommended (check out step 10 for the reason why).
5. Since XWA with XWAUP/DSUCP uses hooks called from dinput.dll, and the DirectDraw patch which we are going to use overrides ddraw.dll, you need to set your Wine prefix up to allow the use of native versions of these libraries. Launch Wine configuration on your custom prefix (winecfg) and add dinput.dll and ddraw.dll to the list of DLL overrides (they should be set to "native,builtin") - you will be warned that it's not recommended to override these libraries, but you can and indeed should ignore this warning in this specific case.
6. Time to get XWA installed inside your custom Wine prefix. Personally I installed the GOG version of the game (I prefer GOG over Steam), but you should in theory be able to install other versions of the game as well, even the CD versions (that's what I used to do before I bought the GOG version). GOG version is probably the easiest to install though since it involves just running and completing the installation procedure from a single .exe file.
7. Once XWA is installed, install XWAUP v1.6 or DSUCP v1.6 (your choice). You can choose any options you prefer, I mostly stuck with the defaults. I also chose the resolution of my monitor (1920x1080) when prompted. Let the installation finish, it should complete without errors and warnings.
8. Now, if this were XWAUP/DSUCP v1.5 or earlier, the game would have worked at this point as is. However, in XWAUP/DSUCP v1.6, a recent change in one of the hooks (Hook_Opt_Limit.dll) currently prevents the game from working on Wine/DXVK without crashing (with the included DDraw.dll that makes the game run on D3D11), and the game would most likely crash with a memory allocation error as soon as you go into the flight engine (interestingly, it can randomly succeed in launching, but very rarely). I have come to a conclusion that it's due to the way DXVK's memory allocator is implemented, and there's little that can be done at this point with that. I tried a few workarounds, but they tend to lead to crashes in missions with many different objects. Therefore, we'll resort to using a different custom DDraw which will work just fine. We'll use a modified Aqrit's DLL, which personally I grabbed from here: https://workupload.com/file/fXsasZps
Download and install it by extracting it into the XWA+XWAUP/DSUCP folder. Overwrite the ddraw.dll which is already there.
9. Check out the settings in aqrit.cfg. I did not change any of them, but your mileage may vary. Note that it's not possible to set the single processor affinity in aqrit.cfg, since it'll slow down the game massively. We'll have to use a different approach to restrict the game to a single CPU core (check out below).
10. At this point, the game should work. However, the way Hook_Time.dll unlocks the FPS in the briefing room seems to not play ball with Aqrit's DDraw.dll - the briefings will be blazing fast and you'll barely be able to understand what's going on. If you're unhappy with that (probably), you can delete Hook_Time.dll from your XWAUP/DSUCP installation folder, then download Justagai's 60 FPS hook from here and put it in the game folder instead: https://onedrive.live.com/?authkey=!ANV ... 981!219391
Note that if you do this, you'll need .NET Framework v4.6.1 installed for this hook to work (check out step 4)
11. Now we need to restrict the game's affinity to a single CPU core. We can accomplish this by making a startup script. For example, create a file called Start_XWingAlliance.sh in your XWAUP/DSUCP folder, with these contents:

wine xwingalliance.exe &
sleep 1
taskset -cp 0 $!

(modify the path to wine as necessary if using a custom prefix, e.g.: WINEPREFIX=<path_to_wineprefix> /path/to/custom_wine/bin/wine xwingalliance.exe &
Once that is done, change its permissions to allow execution (e.g. chmod +x ./Start_XwingAlliance.sh)

12. You're now ready to play the game. Use the script we created in step 11 to play the game with XWAUP/DSUCP 1.6. :) Enjoy!

------
Thanks a lot for your attention, fellow pilots! :)
Hopefully this guide/info will be of use to some of you who are using alternative operating systems and are trying to get the modded game to work using Wine.
Last edited by Maywind on Sun Apr 07, 2019 5:07 am, edited 3 times in total.

Maywind
Recruit
Posts: 3
Joined: Sun Mar 31, 2019 1:48 pm

Post by Maywind » Sat Apr 06, 2019 4:44 pm

I updated the guide to offer a simpler and less crashy option for playing XWAUP 1.6 on Linux using Aqrit's DDraw.dll (without resorting to D3D11 and, thus, DXVK, which currently doesn't work well with Hook_Opt_Limit and causes the game to crash due to the way the memory allocator is implemented in DXVK).

Hope this helps.

User avatar
JeremyaFr
XWAU Member
Posts: 3922
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sat Apr 06, 2019 4:51 pm

Thanks for the guide.

User avatar
ual002
XWAU Member
Posts: 983
Joined: Wed Sep 24, 2008 2:23 am

Post by ual002 » Sat Apr 06, 2019 8:57 pm

Reminds me of when I build out a Linux install for x64 bit kerbal space program before it hit win.
Image Image Image Image Image

Maywind
Recruit
Posts: 3
Joined: Sun Mar 31, 2019 1:48 pm

Post by Maywind » Sun Apr 07, 2019 4:59 am

I figured out what exactly is causing Hook_Time.dll not to work correctly with other variants of DDraw.dll other than the D3D11 one (on Linux), causing incredibly high speed in the hangar (and thus, incredibly fast briefings). Looks like this change:

{ 0x13E328, "99F7FE", "33C040" }

is what's causing it. Thus, patching Hook_Time.dll not to change this offset also seems to do the trick (instead of removing Hook_Time.dll entirely and replacing it with Justagai's 60 FPS patch which requires .NET Framework). Here's a hex patch that I applied, which now works without making the hangar go crazy:

0000E651 33 39
0000E652 33 39
0000E653 43 46
0000E654 30 37
0000E655 34 46
0000E656 30 45

Not sure why exactly it is so, it's actually a part of the CPU usage patch, not a part of the FPS patch as I initially assumed. I'm testing this change to ensure that it doesn't cause any side effects or crashes. Will keep you updated. If this proves to work, I'll add this info to the first post.

Tryphon
Cadet 4th Class
Posts: 11
Joined: Mon Nov 21, 2011 1:44 pm

Post by Tryphon » Fri Apr 19, 2019 5:51 pm

Hello,

Thank for this guide. It works ... except I cannot use other resolution than 640x480. For other resolutions, the Hangar is displayed partially in a kind of picture in picture (PiP) mode smaller than the monitor screen.

Any idea to solve this?

This is what I did under Ubuntu 18.04 :

1) Wine (https://wiki.winehq.org/Ubuntu)

Code: Select all

sudo dpkg --add-architecture i386
wget -nc https://dl.winehq.org/wine-builds/winehq.key
sudo apt-key add winehq.key
sudo apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ bionic main'
sudo apt update
sudo apt install --install-recommends winehq-stable
sudo apt install cabextract
2) Winetricks

Code: Select all

cd /opt
sudo wget  https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks
sudo chmod +x winetricks
Accept Mono installation (and Gecko if you want)

Code: Select all

./winetricks
I report some error messages I got but not all (too many). They seem to not have incidence on the XWA execution.
Msg : This package may not fully work on a 64 bit installation.
Validate
Install the dotnet40 component
Msg : dotnet40 does not yet fully work or install on wine. Caveat emptor
Msg : Working around wine bug 42701, 34803
Msg : Running /usr/bin/wineserver -w. This will hang until all wine processes in prefix=/home/ludwig/.wine terminate
Accept installation of dotnet 4.0
Install the dotnet45 component and uncheck dotnet40
Accept installation of dotnet 4.5
Install the dotnet461 component and uncheck dotnet40, dotnet45
Accept installation of dotnet 4.6.1
Under Winetricks, Run winecfg
Go to tab libraries
In the first field enter dinput.dll and press Add button
enter ddraw.dll and press Add button
Check that they are native builtin

To allow the game playing in full screen during the missions, go to display tab :
Check Emulate virtual desktop
Specify 1920x1200 (or you max screen resolution)

Press OK
Quit Wintetricks

3) XWA installation

Code: Select all

cd /media/<yourusername>
Insert XWA disk 1

Code: Select all

cd 'XWA Disk 1'
wine setup.exe (ignore error)
Ask a complete installation in C:\Program Files (x86)\XWingAlliance
If XWA installation is not complete, install again
Go to the wine XWAUCP 1.6 location

Code: Select all

wine XWAUCPv1.6.exe
Accept 2.02 patch install if required and do again wine XWAUCPv1.6.exe
Repeat when it tells CD disk not found
Delete or rename DDraw.dll and Hook_Time.dll
Download https://workupload.com/file/fXsasZps
Extract files in ~/.wine/drive_c/Program Files (x86)/XWingAlliance
Download https://onedrive.live.com/?authkey=!ANV ... 981!219391
Extract Hook_60FPS.dll in files in ~/.wine/drive_c/Program Files (x86)/XWingAlliance
Rename it in Hook_Time.dll
Edit/create XWA.sh file and write

Code: Select all

#!/bin/bash
cd "/home/<yourusername>/.wine/drive_c/Program Files (x86)/XWingAlliance"
wine alliance.exe &
sleep 1
taskset -cp 0 $!
Save

Code: Select all

sudo chmod +x XWA.sh
Non english XWA version

Code: Select all

mv LauncherOrig.tab Launcher.tab
mv XwaOrig.tab Xwa.tab
Download Xwahacker (easy to find) and copy xwahacker.exe in ~/.wine/drive_c/Program Files (x86)/XWingAlliance
Add a specific screen resolution according to your monitor capability

Code: Select all

wine xwahacker.exe XWINGALLIANCE.EXE -r 1 1920 1200
4) Execution

Code: Select all

./XWA.sh
to start the game
Go to Video options and choose the resolution 1920x1200

Config:
Asus P7P55D EVO
quadcore i7 2,8 GHz
Gainward Radeon HD4870
Samsung T240HD monitor on DisplayPort
Last edited by Tryphon on Sat May 04, 2019 1:27 am, edited 2 times in total.

Reimar
Cadet 1st Class
Posts: 239
Joined: Mon Jan 19, 2009 11:45 am

Post by Reimar » Sat Apr 20, 2019 8:20 am

Are the issues with hook_opt_limit documented somewhere? I would kind of think that the issue should be quite possible to avoid, as the code does nothing particularly weird.

Tryphon
Cadet 4th Class
Posts: 11
Joined: Mon Nov 21, 2011 1:44 pm

Post by Tryphon » Mon Apr 22, 2019 2:42 pm

I do not know so much about new technologies coded here on XWA.

What I tried to overcome partially the problem :
Run Wincfg under Winetricks
To allow the game playing in full screen during the missions, go to display tab :
Check Emulate virtual desktop
Specify 1920x1200 (or you max screen resolution)

I can play full screen during the missions but anywhere else the game shrinks to its native resolution at 640x480 in a small window (Briefing, settings, movies, ...). This breaks the immersive game experience.

Justagai
Cadet 1st Class
Posts: 218
Joined: Mon Dec 08, 2014 10:59 pm

Post by Justagai » Tue Apr 23, 2019 8:35 am

Isn't the concourse only rendered in 640x480? Not sure why its minimizing though.

Tryphon
Cadet 4th Class
Posts: 11
Joined: Mon Nov 21, 2011 1:44 pm

Post by Tryphon » Sat Apr 27, 2019 3:00 pm

Concourse too was minimized to 640x480.
I did some basic manipulations of XWINGALLIANCE.EXE with the xwahacker linux code compiled under Ubuntu. I put xwahacker binary into XwingAlliance folder.
First : ./xwahacker.exe XWINGALLIANCE.EXE -f 30
Second : ./xwahacker.exe XWINGALLIANCE.EXE -r 0 1920 1200 (This slot 0 was at 640x480 and in my guide I put slot 1 to 1920x1200)
During the game I tried the slot 0. With "Emulated virtual desktop" checked (winecfg) as I did from my guide, nothing changed ...
I decided to uncheck this option again and all the game is now at full screen!! But I do not know what precisely solved the screen issue.
I tried back 60 FPS, 640x480 in slot 0 and different combinations and the issue persists to be solved! I cannot reproduce the screen issue!

I played many missions and I never experienced crashes. I am not obliged to keep a Windows OS, the main security breach in my home network, and I can deploy connected linux OSes with fast startup, without the need of antiviruses that break the computer ressources, without the need to update the machine hardware every year (less $$ for both hardware / software and more available machine power). :P

Now I can tell X-Wing Alliance under linux (Ubuntu+wine) is fully working except minor things I can deal with elsewhere.
Based on this guide I suggest a specific forum branch for X-Wing Alliance game installation under linux to discuss about user experience.

Thank you all for making this real under linux.

User avatar
JeremyaFr
XWAU Member
Posts: 3922
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Tue Jul 09, 2019 4:57 pm

Hello,
I've updated the opt limit hook to disable the last change.
Let me know if this updated version works.

darknils
Recruit
Posts: 6
Joined: Thu May 07, 2020 8:43 pm

Post by darknils » Thu May 07, 2020 8:45 pm

has anyone ever tried this with the steam version using protontricks?

okay i just did it. works fine :D

at least the 1.6. package. i did not try to get the additional download stuff running.

dhollinger3
Cadet 4th Class
Posts: 20
Joined: Sat May 09, 2020 3:47 am

Post by dhollinger3 » Sat May 09, 2020 3:16 pm

JeremyaFr - Have you tried to get the newer standalone packs working with this game on GOG or Steam Proton? I can get them installed on both, but the Steam version seems to crash regularly and the GOG version will install the new packs, but then never use them

darknils
Recruit
Posts: 6
Joined: Thu May 07, 2020 8:43 pm

Post by darknils » Sun May 10, 2020 2:37 pm

I just tried to run the game with xwaup 1.6 installed on steam proton. i just installed the Effects by Blue Max's Version 1.1.3 on top of it.
wenn lunching the game there is an error with xwa_hook_mai(DInput.dll): "To call the hook that sets full FPS" is not correctly initialzed.
The Game Starts and i can also run a mission but i just have around 10fps. i am not sure what caused this. maybe the error or my notebooks dedicated gpu Radeon R7 M260X or Intel HD Graphics 5500 (can't tell you wich one is used actualy) does not have the power :D

User avatar
JeremyaFr
XWAU Member
Posts: 3922
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sun May 10, 2020 6:07 pm

This is caused by "hook_time.dll".
You can try to remove it.

darknils
Recruit
Posts: 6
Joined: Thu May 07, 2020 8:43 pm

Post by darknils » Fri May 15, 2020 2:34 pm

dhollinger3 wrote:
Sat May 09, 2020 3:16 pm
JeremyaFr - Have you tried to get the newer standalone packs working with this game on GOG or Steam Proton? I can get them installed on both, but the Steam version seems to crash regularly and the GOG version will install the new packs, but then never use them
same for me with steam proton after i switched from radeon driver to amdgpu.

darknils
Recruit
Posts: 6
Joined: Thu May 07, 2020 8:43 pm

Post by darknils » Sat May 16, 2020 10:23 am

I reinstalled XWA again after i deleted all files in the install folder and its working:

That is how I i installed xwa proton steam with xwaup 1.6, bluemax effects 1.1.3 and rebel dynamic cockpits 2.0 it on my machine:

System: Host: <filter>-hpelitebook840g2 Kernel: 5.6.11-1-MANJARO x86_64 bits: 64 compiler: gcc v: 9.3.0 Desktop: Xfce 4.14.2
Distro: Manjaro Linux
Machine: Type: Laptop System: Hewlett-Packard product: HP EliteBook 840 G2 v: A3009D510303 serial: <filter>
Mobo: Hewlett-Packard model: 2216 v: KBC Version 96.5B serial: <filter> UEFI: Hewlett-Packard v: M71 Ver. 01.31
date: 02/24/2020
CPU: Topology: Dual Core model: Intel Core i7-5600U bits: 64 type: MT MCP arch: Broadwell rev: 4 L2 cache: 4096 KiB
flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 bogomips: 20761
Speed: 799 MHz min/max: 500/3200 MHz Core speeds (MHz): 1: 798 2: 798 3: 799 4: 798
Graphics: Device-1: Intel HD Graphics 5500 vendor: Hewlett-Packard ZBook 15u G2 Mobile Workstation driver: i915 v: kernel
bus ID: 00:02.0
Device-2: Advanced Micro Devices [AMD/ATI] Opal PRO [Radeon R7 M260X] vendor: Hewlett-Packard driver: amdgpu
v: kernel bus ID: 04:00.0
Display: x11 server: X.Org 1.20.8 driver: amdgpu,ati,intel unloaded: modesetting resolution: 1920x1080~60Hz
OpenGL: renderer: Mesa Intel HD Graphics 5500 (BDW GT2) v: 4.6 Mesa 20.0.6 direct render: Yes

First i enabled proton 5.0 for all games in steam and installed xwa and run it once.
Afterwrads i used

Code: Select all

protontricks --gui
(just choose x-wing alliance, ignore the 32bit/64bit warning, enable silent installation and choose the default wineprefix) to install xwau 1.6 via "Run uninstaller".
Afterwards i followed some of maywind steps (the .net framework installation you find in "windows dll and components"):
Maywind wrote:
Mon Apr 01, 2019 5:41 pm
4. If you're planning to use Justagai's 60 fps hook in this Wine prefix, or if you're planning to use tools such as YOGEME, or if you're planning to use anything else that requires .NET Framework, or you'd like to play other games (e.g. XvT:BoP) with that 60 fps patch mentioned before, make sure you get a recent version of Winetricks and use it to install .NET Framework v4.6.1 inside this Wine prefix (use ./winetricks dotnet461 to accomplish that, and make sure you fully go through all the installation procedures - 4.0, 4.5, and 4.6.1 will be installed in succession). Note that this is recommended (check out step 10 for the reason why).
5. Since XWA with XWAUP/DSUCP uses hooks called from dinput.dll, and the DirectDraw patch which we are going to use overrides ddraw.dll, you need to set your Wine prefix up to allow the use of native versions of these libraries. Launch Wine configuration on your custom prefix (winecfg) and add dinput.dll and ddraw.dll to the list of DLL overrides (they should be set to "native,builtin") - you will be warned that it's not recommended to override these libraries, but you can and indeed should ignore this warning in this specific case.
[...]
7. Once XWA is installed, install XWAUP v1.6 or DSUCP v1.6 (your choice). You can choose any options you prefer, I mostly stuck with the defaults. I also chose the resolution of my monitor (1920x1080) when prompted. Let the installation finish, it should complete without errors and warnings.
8. Now, if this were XWAUP/DSUCP v1.5 or earlier, the game would have worked at this point as is. However, in XWAUP/DSUCP v1.6, a recent change in one of the hooks (Hook_Opt_Limit.dll) currently prevents the game from working on Wine/DXVK without crashing (with the included DDraw.dll that makes the game run on D3D11), and the game would most likely crash with a memory allocation error as soon as you go into the flight engine (interestingly, it can randomly succeed in launching, but very rarely). I have come to a conclusion that it's due to the way DXVK's memory allocator is implemented, and there's little that can be done at this point with that. I tried a few workarounds, but they tend to lead to crashes in missions with many different objects. Therefore, we'll resort to using a different custom DDraw which will work just fine. We'll use a modified Aqrit's DLL, which personally I grabbed from here: https://workupload.com/file/fXsasZps
Download and install it by extracting it into the XWA+XWAUP/DSUCP folder. Overwrite the ddraw.dll which is already there.
[...]
12. You're now ready to play the game. Use the script we created in step 11 to play the game with XWAUP/DSUCP 1.6. :) Enjoy!
------
Thanks a lot for your attention, fellow pilots! :)
Hopefully this guide/info will be of use to some of you who are using alternative operating systems and are trying to get the modded game to work using Wine.
XWA with xwau 1.6 is running wihout any problems now. I do not experience any issues in the briefings, either i need to speficly force the game to just run on one core.

Afterwards i just installed the effects by bluemax 1.1.3 and afterwards the dynamic rebel cockpits 2.0 via the "run uninstaller" option in

Code: Select all

protontricks --gui
.
Ther is a minor issue:
I think due to my limited hardware i just have around 10fps when running it in 1980*1080.
It keeps crashing when try to run with discrete graphics instead of integrated Intel HD.
Last edited by darknils on Wed May 20, 2020 1:04 pm, edited 1 time in total.

dhollinger3
Cadet 4th Class
Posts: 20
Joined: Sat May 09, 2020 3:47 am

Post by dhollinger3 » Tue May 19, 2020 3:32 am

darknils wrote:
Sat May 16, 2020 10:23 am
Afterwards i just installed the effects by bluemax 1.1.3 and afterwards the dynamic rebel cockpits 2.0 via the "run uninstaller" option in

Code: Select all

protontricks --gui
.
Ther is a minor issue:
I think due to my limited hardware i just have around 10fps when running it in 1980*1080.
I've been working on a Lutris installer for this. A couple of notes from my work:
  • The WINECFG MUST BE SET TO Windows 10 otherwise you'll run into potential crashes and/or performance issues
  • I had to downgrade Blue Max's Effects pack from 1.1.3 to 1.1.2, otherwise FPS was between 10 and 20
For reference, here's my hardware:

OS: Pop!_OS 20.04 64-bit
CPU: Intel i7-9750H 6-core, dual-threaded CPU with burst to 4.5 GHz
RAM: 32GB DDR4
Dedicated GPU: Nvidia GeForce RTX 2060 Mobile w/ 6GB VRAM
Storage: Samsung 860 Evo 500GB SSD

Lutris installer for testing (Haven't uploaded it to Lutris yet as I want to get signoff from the XWA Upgrade project leads to point the installer at the download links).

Code: Select all

name: "STAR WARS: X-Wing Alliance"
game_slug: star-wars-x-wing-alliance
version: GOG-XWAUP_beta
slug: star-wars-x-wing-alliance-gog-xwaup
runner: wine
gogid: 1421404763
gogslug: "star_wars_xwing_alliance"

script:
  files:
  - install: N/A:Select the installer provided by GOG.
  - xwaupgrade: https://www.xwaupgrade.com/download/installers/XWAUCP_v1.6.exe
  - xwa60fps: https://github.com/dhollinger/xwalutrisfiles/releases/download/v1.0.0/xw_series_60FPS.zip
  - effects: https://www.xwaupgrade.com/download/installers/EffectsByBlueMax_v1.1.2.exe
  - rebelcockpits: https://www.xwaupgrade.com/download/installers/RebelDynamicCockpits_v2.0.exe
  - tiecockpits: https://www.xwaupgrade.com/download/installers/TieDynamicCockpits_v1.0.exe
  - superbackdrops: https://www.xwaupgrade.com/download/installers/SuperBackdropsPatch_v2.1.exe
  - z95: https://www.xwaupgrade.com/download/models/Z-95Headhunter_v5.0.exe
  - IRS: https://www.xwaupgrade.com/download/models/ImperialResearchShip_v1.1.exe
  - vsd: https://www.xwaupgrade.com/download/models/VictoryStarDestroyer_v2.0.exe
  - BC: https://www.xwaupgrade.com/download/models/BulkCruiser_v1.1.exe
  - NB2: https://www.xwaupgrade.com/download/models/ModFrigate_v2.1.exe
  - DR: https://www.xwaupgrade.com/download/models/Casino_v2.0.exe
  - repair: https://www.xwaupgrade.com/download/models/RepairYard_v1.1.exe
  - trans: https://www.xwaupgrade.com/download/models/StormTransport_v2.1.exe
  - containers: https://www.xwaupgrade.com/download/models/ContainerPack_v4.1.exe
  - accel: https://www.xwaupgrade.com/download/models/AccelRing_v1.1.exe
  - guns: https://www.xwaupgrade.com/download/models/GunPads_v1.1.exe
  game:
    arch: win64
    exe: drive_c/GOG Games/Star Wars - X-Wing Alliance/XWINGALLIANCE.EXE
    prefix: $GAMEDIR
  installer:
  - task:
      arch: win64
      name: create_prefix
      prefix: $GAMEDIR
  - task:
      arch: win64
      description: Setting Windows 10 mode
      name: winetricks
      prefix: $GAMEDIR
      app: win10
  - task:
      arch: win64
      description: Installing .NET 4.6.1
      name: winetricks
      prefix: $GAMEDIR
      app: dotnet461
  - task:
      arch: win64
      description: Running installer. Please quit the installer at the end, do not run
        the game until this script finishes installing.
      executable: install
      name: wineexec
      prefix: $GAMEDIR
  - task:
      arch: win64
      description: Installing XWA Upgrade
      executable: xwaupgrade
      name: wineexec
      prefix: $GAMEDIR
  - extract:
      description: Extracting custom 60 FPS DLLs
      dst: $CACHE/Star Wars - X-Wing Alliance
      file: xwa60fps
      format: zip
  - merge:
      description: Moving custom files into XWA directory
      dst: $GAMEDIR/drive_c/GOG Games/Star Wars - X-Wing Alliance/
      src: $CACHE/Star Wars - X-Wing Alliance/
  - task:
      arch: win64
      description: Install SuperBackdropsPatch_v2
      executable: superbackdrops
      name: wineexec
      prefix: $GAMEDIR
  - task:
      arch: win64
      description: Install New Victory-class Star Destroyer
      executable: vsd
      name: wineexec
      prefix: $GAMEDIR
  - task:
      arch: win64
      description: Install New Nebulon-B2 Frigate Model
      executable: NB2
      name: wineexec
      prefix: $GAMEDIR
  - task:
      arch: win64
      description: Install Rebel Dynamic Cockpits
      executable: rebelcockpits
      name: wineexec
      prefix: $GAMEDIR
  - task:
      arch: win64
      description: Install TIE Dynamic Cockpits
      executable: tiecockpits
      name: wineexec
      prefix: $GAMEDIR
  - task:
      arch: win64
      description: Install Z-95 model with Dynamic Cockpit
      executable: z95
      name: wineexec
      prefix: $GAMEDIR
  - task:
      arch: win64
      description: Install Imperial Research Ship
      executable: IRS
      name: wineexec
      prefix: $GAMEDIR
  - task:
      arch: win64
      description: Install Bulk Cruiser
      executable: BC
      name: wineexec
      prefix: $GAMEDIR
  - task:
      arch: win64
      description: Install Dunari's Rest
      executable: DR
      name: wineexec
      prefix: $GAMEDIR
  - task:
      arch: win64
      description: Install Repair Yard
      executable: repair
      name: wineexec
      prefix: $GAMEDIR
  - task:
      arch: win64
      description: Install Stormtrooper Transport
      executable: trans
      name: wineexec
      prefix: $GAMEDIR
  - task:
      arch: win64
      description: Install Container Pack
      executable: containers
      name: wineexec
      prefix: $GAMEDIR
  - task:
      arch: win64
      description: Install Acceleration Ring
      executable: accel
      name: wineexec
      prefix: $GAMEDIR
  - task:
      arch: win64
      description: Install Gun Platform pack
      executable: guns
      name: wineexec
      prefix: $GAMEDIR
  - execute:
      command: 'rm $GAMEDIR/drive_c/GOG\ Games/Star\ Wars\ -\ X-Wing\ Alliance/Hook_Time.dll'
  - task:
      arch: win64
      description: Install Blue Max's Effects
      executable: effects
      name: wineexec
      prefix: $GAMEDIR
  wine:
    overrides:
      ddraw.dll: n, b
      dinput.dll: n, b
  system:
    reset_desktop: true
  • Make sure to go into the winecfg and set it to Windows 10 after install
  • You can test this file by saving it to a <filename>.yaml file and then running `lutris -i /absolute/path/to/filename.yaml`

darknils
Recruit
Posts: 6
Joined: Thu May 07, 2020 8:43 pm

Post by darknils » Wed May 20, 2020 12:58 pm

dhollinger3 wrote:
Tue May 19, 2020 3:32 am
I've been working on a Lutris installer for this. A couple of notes from my work:
  • The WINECFG MUST BE SET TO Windows 10 otherwise you'll run into potential crashes and/or performance issues
  • I had to downgrade Blue Max's Effects pack from 1.1.3 to 1.1.2, otherwise FPS was between 10 and 20
I'll give both a try over the weekend. Thanks for your feedback and work on a lutris install script :)

dhollinger3
Cadet 4th Class
Posts: 20
Joined: Sat May 09, 2020 3:47 am

Post by dhollinger3 » Sat Jun 20, 2020 1:41 am

Ok, update on this progress as I've identified a few other adjustments that are needed and have updated everything locally.

I found a few options that fix framerate issues and crashes:

Add the following option to the start of the game to prevent crashes:

Code: Select all

DXVK_STATE_CACHE=0
This is much easier to do in the Lutris Config or Steam's Launch options than on the CLI.

Also disable the following options in ddraw.cfg to fix framerate issues with the Dynamic Cockpits and Effects:

Code: Select all

; Enable the new text renderer. Disabling this setting may improve performance
Text2DRendererEnabled = 0
; Enable the new radar renderer. Disabling this setting may improve performance
Radar2DRendererEnabled = 0
Additionally, if you want to easily install the game via Lutris you can find the local installer file at Github: To install these locally, you have to run Lutris from the CLI:

Code: Select all

$ lutris -i /full/path/to/xwaupgrade-full.yaml
To install these easily through the Lutris App or Lutris Website, you'll need to wait for the installer to be updated. I will update this post when they are ready.

Couple of other notes:
  • The above installers are for the GOG version of the game.
  • The GOG integration with Lutris recently broke due to GOG deprecating their old WebAPI. You have to ensure that you are NOT logged into your GOG account in Lutris. This will force Lutris to prompt you for the .EXE file.
IMPORTANT: I AM IN NO WAY AFFILIATED WITH THE XWAUPGRADE PROJECT AND THERE SHOULD BE NO EXPECTATION THAT THEY WILL PROVIDE HELP/SUPPORT FOR THIS.
THIS IS MAINTAINED ON MY OWN TIME AND BY ANYONE THAT CONTRIBUTES PULL REQUESTS TO THE GITHUB REPOSITORY. IF YOU HAVE ISSUES CONTACT VIA ONE OF THE FOLLOWING METHODS:

LaserTron
Recruit
Posts: 2
Joined: Sat Aug 29, 2020 12:48 pm

Post by LaserTron » Sat Aug 29, 2020 12:56 pm

Hi I have XWA with Steam on Manjaro. I followed @darknils variation of @Maywind's instructions for proton.

Edit:
I did everything the same (except upgrade to proton 5 in steam) and I get the following behaviour. When I launch from Steam, it works, I get a message that the fps_60 hook isn't initialized and the briefings are super fast.
Okay I forgot to deleted Hook_Time.dll, as indicated in @Maywind's instructions. Everything works well, but my question remains:

When I rename Xwingalliance.exe -> Alliance.exe, to bypass the launcher when launching from steam, I get no error messages, briefings look nice, but it crashes once the flight engine starts.

It looks like when I bypass the launcher (i.e. rename xwingalliance.exe to alliance.exe) the custom dlls don't get "activated." Could somebody explain what is happening here?

I also have a n00b question: is there a way launch run Steam games from the command line? How do I find and invoke the correct Steam-created proton prefix? I am already greateful to have laerned about the existence of protontricks!

darknils
Recruit
Posts: 6
Joined: Thu May 07, 2020 8:43 pm

Post by darknils » Sat Feb 06, 2021 8:32 pm

@ LaserTron did you try:
dhollinger3 wrote:
Tue May 19, 2020 3:32 am
A couple of notes from my work:
  • The WINECFG MUST BE SET TO Windows 10 otherwise you'll run into potential crashes and/or performance issues
  • I had to downgrade Blue Max's Effects pack from 1.1.3 to 1.1.2, otherwise FPS was between 10 and 20

dhollinger3
Cadet 4th Class
Posts: 20
Joined: Sat May 09, 2020 3:47 am

Post by dhollinger3 » Wed Feb 10, 2021 3:33 pm

darknils wrote:
Sat Feb 06, 2021 8:32 pm
@ LaserTron did you try:
dhollinger3 wrote:
Tue May 19, 2020 3:32 am
A couple of notes from my work:
  • The WINECFG MUST BE SET TO Windows 10 otherwise you'll run into potential crashes and/or performance issues
  • I had to downgrade Blue Max's Effects pack from 1.1.3 to 1.1.2, otherwise FPS was between 10 and 20
I completely reworked the Lutris installer when the mega patch came out. I would recommend using that for ease of setup.

LaserTron
Recruit
Posts: 2
Joined: Sat Aug 29, 2020 12:48 pm

Post by LaserTron » Wed Sep 01, 2021 11:45 am

I completely reworked the Lutris installer when the mega patch came out. I would recommend using that for ease of setup.
I just tried it out again yesterday (previous Lutris attempts had failed), but now it works great! Thank you so much!!!

Tryphon
Cadet 4th Class
Posts: 11
Joined: Mon Nov 21, 2011 1:44 pm

Post by Tryphon » Sat Jan 08, 2022 9:56 am

Hello pilots,

I spent more time to improve XWA 2.02 installation on Linux (no mega patch). I used xwahacker 3.2 (-p 71 and -f 30).
I tried many solutions : wine 6 (Windows 10 32-bit), steam, proton, lutris.
I tested aqrit and original ddraw wrappers.
The game is fully playable except when fight with laser : under high resolution, the FPS decreases to 4 FPS (wine) or 6 FPS (steam, proton, lutris).
During messy battles, this is not really playable.

People here did a remarkable job to improve Direct3D 11 capabilities. This is not really well implemented under Wine but ... DXVK gives a good replacement (DXVK 1.9.2). Now I can use ddraw d3d11 1.5.14. During battles I got 15-20 FPS at 1600x1200 and 25 FPS at 800x600. I can tell this is really better. However with this solution I got absolutely no text anywhere on the screen during missions and Wine throws many lines telling : d2d_device_context_DrawTextLayout Failed to draw text layout
Web search on this refers to almost no information.

It seems that ddraw 1.5.14 wrapper was not able to render the text. I have no idea what to do. Could someone help to point on the right way or what to check ?

Thank you.

Dell Precision T7810
2x Xeon ES-2690 v4 (total 28 cores)
256 GB RAM
Nvidia Quadro K6000 12 GB VRAM
M.2, SSD total 5 TB
Dell UP3216Q display monitor (3840x2160)
Ubuntu 20.04

Post Reply