0neGal / viper

Launcher+Updater for TF|2 Northstar
https://0negal.github.io/viper
GNU General Public License v3.0
152 stars 21 forks source link

feat: Linux "Launch" support #38

Closed 0neGal closed 4 months ago

0neGal commented 2 years ago

I would love to add support for Linux users to also be able to Launch the game through Viper, albeit it'll probably take some manual configuration from the user, like setting a command to launch Vanilla and Northstar.

However if the user has Lutris installed we could try and parse lutris --list, and same with Steam. To try and find the launch command.

We'll likely need this in R2Northstar/NorthstarWiki#34 anyway, at least for the Linux side of that issue.

3top1a commented 2 years ago

One way to do Northstar for steam - move Titanfall2.exe to Titanfall2_old.exe and copy NorthstarLauncher.exe to Titanfall2.exe. I use this to play Northstar though steam, although it is quite risky and not as sensible.

0neGal commented 2 years ago

although it is quite risky and not as sensible.

Which is exactly why we're not going to do that...

3top1a commented 2 years ago

Another idea: Lutris has a "launch EXE within prefix" option we can use, but I don't know if the CLI has this option. For steam, perhaps proton tricks has a function for that, or we could use this script that I found. There's also a AddNonSteamGame option in Steams' Steam Browser Protocol.

0neGal commented 2 years ago

Lutris has a "launch EXE within prefix" option we can use

This won't have your environment variables nor will it use the version of Wine that you want.

There's also a AddNonSteamGame option in Steams' Steam Browser Protocol.

I suggest we don't mess with people's Steam library.

As I've mentioned before, the kind of user who uses Linux will most likely not only understand what the game path is, but also be able to install and launch the game.

0neGal commented 2 years ago

As I've mentioned before, the kind of user who uses Linux will most likely not only understand what the game path is, but also be able to install and launch the game.

With the release of the SteamDeck this no longer really holds true, however I still believe we shouldn't mess with people's libraries, and instead just let people launch the game through Viper, which'll also ensure the game/NS stays up-to-date.

GeckoEidechse commented 2 years ago

So there's been some interesting new info in regards to Linux launch stuff on Steam. Next to -northstar there also exists run_northstar.txt as an option that works similar in a similar. Basically again the wsock32.dll from Northstar that overwrites the game one, checks for run_northstar.txt and if the file has a single 1 in it launches Northstar, a single 0 would launch vanilla. https://github.com/R2Northstar/NorthstarDocs/issues/93

With that is has been found that using WINEDLLOVERRIDES we can get Northstar to launch on Linux via WINEDLLOVERRIDES="wsock32=n,b" %command% -northstar as launch arguments on Steam. (it's not clear yet whether -northstar is actually needed here) https://github.com/R2Northstar/Northstar/issues/291#issuecomment-1185906594

So this is the closest we have to -northstar on Linux+Steam so far ^^

You still ofc need the right Proton version. We found that the issue with Northstar not working on Proton appears to be related to Proton specific patches as there no/less issues with Wine in regards to Northstar crashing on Linux.

0neGal commented 2 years ago

I was actually earlier today reinstalling the game, for various reasons, but mostly some issues with my prefix that made Origin refuse to startup, and considered also installing the Steam version, I guess I'll do that so I can finally get this PR merged...

As for the Proton version, it may just be easiest to make a drop-down of all the versions that are found, and let it be up to the user, having to find what versions wokr and what don't seems like constant upkeep :p

However perhaps note that figuring out the right version could be done through ProtonDB or the Linux channel on the NS Discord...

GeckoEidechse commented 2 years ago

However perhaps note that figuring out the right version could be done through ProtonDB or the Linux channel on the NS Discord...

Through trial and error we basically found that Proton-7.3-GE-1 (not GE-Proton7-3) seems to working for the was majority of players on Linux with Steam

GeckoEidechse commented 2 years ago

Also just tested and WINEDLLOVERRIDES="wsock32=n,b" %command% even works on SteamDeck :D

0neGal commented 2 years ago

I would want to avoid installing GE versions through Viper, the note about this version can be added, but again, it seems like constant upkeep, for every single time a better more stable version is found.

But I'm not sure if there's a better solution...

GeckoEidechse commented 2 years ago

Well technically that Proton GE version was the only one recommended one so far :P

But yeah, best solution would be to just have either Northstar patched to work on current Proton (we need someone to investigate the cause of error first, so far no one was willing to look into it) or hope that Proton patches the stuff where we break and Valve make it the new default on Steam (takes time). I don't expect Viper to handle installing custom Proton version and all ^^

Jan200101 commented 1 year ago

Posting this information here so its kept track of

GeckoEidechse commented 1 year ago

Steam can be invoked via the Steam Browser Protocol or commandline flags to Launch Titanfall with any arguments.

This is probably the lowest hanging fruit solution and something I'm also planning to do in FlightCore. Basically just setup the user's Steam install of Titanfall2 to work with Northstar (add run_northstar.txt, install NorthstarProton) and then invoke Northstar by running Titanfall2 via Steam. (Not sure if -northstar works yet on Linux, if it does, run_northstar.txt shouldn't be needed).

I'm honestly even fine with "officially" just supporting Steam version of Titanfall2 on Linux. IIRC most Linux related tickets we got on the Northstar Discord are with issues when using Lutris. Having to deal with the varieties of Linux distros can be a pain and Steam helps a lot in standardising things a bit ^^

0neGal commented 1 year ago

The solution I'll end up at is likely giving the user these options:

  1. Invoke steam
  2. Run a script/executable/command
  3. Give a prefix and wine executable

And then the invoke Steam by default, and optionally ask whether the user wants to download NorthstarProton on top of that, and so forth.

Personally I would never use the Steam method myself, and I'd likely want to resort to a command or manually setting the prefix.

And manually selecting the prefix etc should have a warning that it may break prefixes or work incorrectly.

Feedback on that stance/way of doing it, is very welcome!