Open APasz opened 4 years ago
Related to https://github.com/Gribbleshnibit8/xcom2-launcher/issues/6
As I am not familiar with Mono (and do not personally use Linux), that is not something I am likely to look into.
Mono runs also on windows, that could be the first step to implementing the compatibility
welp. has anyone had success using it with wine? Also, if you could get it running with wine, would/could the game itself still run as a linux app?
You just have to install winetricks -q dotnet472
for the launcher to work.
The problem is that for some reason, it takes like 5 minutes in wine for the game window to get past the initial black screen.
You just have to install
winetricks -q dotnet472
for the launcher to work. The problem is that for some reason, it takes like 5 minutes in wine for the game window to get past the initial black screen.
So, once the launcher opens, does xcom itself run as a native app?
Of course not, this is about using it in wine.
@mirh How do I get it to recognize my steam and xcom installations?
You run the thing inside the same wine prefix that will run the game, as I said.
I've managed to get it working somehow. I honestly couldn't repeat all the steps, but I can give a rough outline in case it helps someone else.
protontricks 268500 dotnet472
) suddenly worked.I had tried running AML using the appropriate prefix and Wine executable several times while fiddling around with installing .NET 4.7.2, but it kept crashing. Even after getting it installed it still crashed, though it did give a different error which I took to mean I had made some progress. I tried running the same command from a fresh terminal and it worked! The command for me looked like:
WINEPREFIX=/home/SteamLibrary/steamapps/compatdata/268500/pfx /home/SteamLibrary/steamapps/common/Proton\ 5.0/dist/bin/wine64 XCOM2\ Launcher.exe
This was run in the directory where I had extracted AML, and you'll obviously need to adapt the paths based on where your Steam library lives.
It seems to be working for me now. Your results may vary.
Edit: Spoke too soon... the game crashes when loading the first mission. I guess it still needs some work.
It's because .net installation is broken https://github.com/Linux74656/SpaceEngineersLinuxPatches#issue-11 https://bugs.winehq.org/show_bug.cgi?id=49897
Tried today. Even when setting proton to 5.0 or 4, dot net 4.7.2 install fails.
Putting aside it's a complete mess with reproducibility, you have to use protontricks there
@mirh I know. I used it.
Then try with vanilla wine.
I just discovered this guide: https://www.reddit.com/r/xcom2mods/comments/rhjeby/you_can_run_aml_on_linux_proton_howto_included/
Has worked flawlessly for me and several others so far considering how simple it is, and that currently xcom 2 linux native is borked anyways, I'm going to say this is the best solution
So none of the above discussion is really on topic -- which is for AML to have Linux support. Helpful if someone wants to run XCOM2 via Proton (aka non-linux-native), and worth having here cuz it's where someone will ultimately end up on this search.
But for staying on the topic at hand: I think I've made some progress on the linux-native XCOM2 install front! (With HUGE help from robojumper in disc).
https://steamworks.github.io/installation/
When you build your application the following files must be copied into the output dir:
All Platforms:
steam_appid.txt - Required for testing your application outside of steam. Do not ship this to customers!
Steamworks.NET.dll - Make sure it’s the correct version for the platform that you plan on shipping for! - When building for OSX or Linux the wrong Steamworks.NET.dll will be copied over by default, it is recommended that you create a post build script to copy the correct version.
Windows:
steam_api.dll
Linux:
libsteam_api.so
So from the newest release of Steamworks.NET, taking the -- it wasn't)Steamworks.NET.dll
out of Steamworks.NET-Standalone_20.1.0/OSX-Linux-x64
and replacing the Steamworks.NET.dll
in the AML directory, and then running this via "Add non-Steam game" in steam and Proton Experimental
, I get the thing to open up! Oh, and you probably need to rename steam_api64.dll
to steam_api.dll
in the AML dir. (Come to think of it, wonder if the DLL replacement was really necessary.
Just run the dang thing in proton as-is and it'll work lol (this screenshot is from when I had the linux Steamworks swapped in, without it the UI fills in correctly with file sizes, paths, etcetc)
Without running via Steam (and thus having all the Steam-context stuff be automagically handled) you get this error, with or without the Steamworks.NET.dll
replacement:
Now, right now AML crashes shortly after it finally gets open. My log is filled with errors like this. Which is prolly a local issue I'll try to trace down.
2023-01-10 15:20:45,348 [1] WARN ModList:0 - Workshop request for WorkshopId=0 failed with result 'k_EResultFil
eNotFound'
I'm guessing there's going to be pathing issues, too. Since the linux install does a lot in .local/share/feral-interactive/XCOM\ 2\ WotC/VFS
, but that's next steps to figure out as well (might all be symlink'd neat and tidy already).
Edit, okay so actually just using AML as-is with Steam's Proton Experimental
(and like other vers) added as a "Non-Steam Game" kinda just works outta the box. Above is useful as steps towards a linux-native AML, maybe, but with as it is now AML already "works" besides with launching the game. Only thing remaining to do is figure out how to get it to point at the linux executable. Since we're in a windows context, it's very awkward to get it to handoff back to the Linux one with how it's setup. It's hardcoded to look for "Base path" + XCom2-WarOfTheChosen/Binaries\Win64/XCom2.exe
. I'm not really sure of a good way to hand it off.
https://github.com/X2CommunityCore/xcom2-launcher/blob/d23f80acfeb7f556c79d8853dda8ed311b8a43f0/xcom2-launcher/xcom2-launcher/Classes/XCOM/Xcom2Env.cs#L102
feral-interactive uses ./XCOM 2/XCOM2WotC/XCOM2WotC.sh
as it's entry point afaict (which I think'll have some hints), which ultimately points to ./XCOM 2/XCOM2WotC/bin/XCOM2WotC
with a handful of LD_PRELOAD
& friends.
Making a symlink to ./XCOM 2/XCOM2WotC/bin/XCOM2WotC
from ./<AML DIR (aka my "base path")>/XCom2-WarOfTheChosen/Binaries\Win64/XCom2.exe
gets me some "error loading shared libraries" (libidn.so.11
specifically rn), which makes me feel like the hand-off is being automagically done and I just need those prefixes, but I'll try that another day as I'm itching to play some XCOM and the feral launcher does work more/less fine already :^)
It works with Proton 8.0-2 pretty much out of the box now; it only requires that you trick Steam into avoiding the 2K Launcher and the default launcher. This is what I did:
cd "<steamlibrary>/common/XCOM 2"
mv 2KLauncher 2KLauncher_bak
ln -s Launcher 2KLauncher
# extract the latest release into the launcher folder (latest release is 1.5.0 at the time of writing)
# overwrite everything, if prompted
cd Launcher
mv launcher.exe launcher.exe.bak
ln -s "XCOM2 Launcher.exe" launcher.exe
ln -s "XCOM2 Launcher.exe" LauncherPatcher.exe
# Launch the game from Steam!
## To fix the UI being too small on high resoluion displays, you'll need to use protontricks to run winecfg,
## the set the scaling factor to something higher than the default (192 looks fine at 4K, for reference)
Ideally, it'd be nice to have a native solution but... honestly, Linux ports by FeralInteractive tend to suck anyway; so, I wouldn't blame anyone for not caring much about this
It'd be nice. For the same reasons that it's nice on Windows. Specifically Ubuntu as it's the officially supported distro.