luxtorpeda-dev/luxtorpeda

Is it possible to have the game official version (native or proton) as an option in the engine selection menu?

Closed this issue · 16 comments

Feature Request

Take as an example DOOM: Although the steam version runs on proton, it has splitscreen and other nice features, It would be nice to have it as an option in the engine menu for quick selection with a controller.

Solution

Keep the game official version as an option in the engine selection menu.

Additional Context

No response

The easiest way to do that today is to change your compatibility tool settings from luxtorpeda to proton and back currently.

The issue with selecting a native version is when you use luxtorpeda, it's like proton where you'll telling steam to download the windows version, so the native version isn't available.

For proton, that may be more doable, but that also runs into issues where there's many proton versions available, and how do we pick one. On top of that, we're already in a runtime environment that may be different than what versions of proton expect, so it may not work as expected.

I looked into this a bit and it seems like Steam is storing what game uses what compatibility tool in ~/.local/share/Steam/config/config.vdf.

When I change "Force the use of a specific Steam Play compatibility tool" for "Indiana Jones and the Last Crusade" from Luxtorpeda to Proton 8 inside Steam it changes some rows in the file from:

"32310"
{
    "name"		"luxtorpeda"
    "config"		""
    "priority"		"250"
}

To:

"32310"
{
    "name"		"proton_8"
    "config"		""
    "priority"		"250"
}

If I uncheck "Force the use of a specific Steam Play compatibility tool" from Steam settings, these rows are deleted from the file.

I was thinking that maybe we could modify a file to change what compatibility tool is used for a game. I tried testing changing the file when Steam was running but it didn't change what compatibility tool was used. Restarting Steam overwrote the file with the previous setting. So no luck there yet.

Seems like ProtonUp-QT is doing it in that way: https://github.com/DavidoTek/ProtonUp-Qt/blob/d82d8e71d65d8be62274788305fe1f00eda6d272/pupgui2/steamutil.py#L362-L389

I've also found another way to do this without modifying the file directly, instead using Steam Console:
steam "steam://open/console/ +app_change_compat_tool 32310 luxtorpeda \"\" 250"

I did a lot of trial and error and guess work to find a command that actually work 😄, this should be able to change the compat tool without reloading Steam.

Some options for compat tools are: luxtorpeda, steamlinuxruntime, proton_8, proton_experimental, GE-Proton8-14

I'm not sure I've found the best way to reset it back to the standard settings but this seems to work:
steam "steam://open/console/ +app_change_compat_tool 32310 \"\" \"\" \"\""

Reopening this one since it'll possibly be done in the client versus as an engine

Native wouldnt be possible at runtime since steam is downloading the windows version, but proton may be doable.

Im thinking this could be done for non-native (launch with proton), with an extra config parameter to enable the proton choice feature. This would make the choice menu show all the time for all games, and add metadata for all the compat tools that make sense there, then those could call a canned engine, which could be basically what you have in the packages repo.

Native wouldnt be possible at runtime since steam is downloading the windows version, but proton may be doable.

It should be possible like this:

# set the compat_tool to blank:
steam "steam://dev/console/ +app_change_compat_tool 32310 \"\" \"\" \"\""

#download native
steam "steam://dev/console/ +app_install 32310"

#run native
steam -applaunch 32310

It could possible also be done with this command to download the linux depot:
download_depot <appid> <depotid> [<target manifestid>] [<delta manifestid>] [<depot flags filter>]

Would those work when the game is running? That might cause confusion

Ah you're right that probably won't work. Still we should test it.

In that case we could use this command after installing the native version:

app_stop <appid> [force:0|1] — Stop this running app by ID.

To close the game. And then we should be able to use -applaunch to relaunch the game but the native version

Once the game is stopped our stuff would be gone, although we might be able to create a new process of a script that starts it. We can see if that's worth it/works

Hmm this got me thinking about some different, and maybe strange, possible options. What about separating Luxtorpeda into an outside of Steam component and an inside Steam component?

That way the outside component could do things before installing and launching a game, like downloading from Linux or windows depots and setting different compat tools.

One option would be to have the client/GUI outside of Steam.

It would also open up other possibilities like updating engines in the background.

That may make things like steam deck confusing since someone would have to know to launch something else for the outside lux. The nice thing about how it works currently is there's little to no interaction needed to setup and run a game.

The other thing I'm unsure of with the proton change compat part is that it would probably have the same problem, where the lux client would have to stop. It could work if we prompted people to re-launch the game, although the downside is then they would have to manually switch back to luxtorpeda.

Another option would be to manually run the proton command ourselves, although that could have its own issues.

That may make things like steam deck confusing since someone would have to know to launch something else for the outside lux. The nice thing about how it works currently is there's little to no interaction needed to setup and run a game.

It could be an optional add on. Add a description on GitHub read me: "If you want to enable switching to Proton and Native from inside the Luxtorpeda menu, you need to downlod luxtorpeda-helper app".

The helper app could have an option to always run in the background. When launching regular Luxtorpeda client it would check if the helper app is running and only show Proton, GE-proton, Linux Runtime and Native in the menu when it is.

When a user selects for example GE-Proton from the Luxtorpeda client. The client or helper app (whichever works best) will use Steam:// commands to change the compat_tool for Steam, close the Steam game, relaunch the steam game and then set the compat_tool back to luxtorpeda - Either directly, if that works when the game is running, or after the game is closed.

Here’s an example of how I think these features could be made to work using a luxtorpeda-helper application that's running in the background. This example uses the Steam commands method to get a result that’s identical to the user changing game launch options (Proton, GE, Native, etc) from the regular Steam GUI. So step to step from beginning to end:

  1. User sets Luxtorpeda as the Steam Play tool for a game.
  2. User launches the game
  3. Lux client is launched
  4. Lux client checks if helper app is running (In this example it is running)
  5. Lux client menu launches and shows the regular game engines and also other compat tools/environments that make sense for that game (like Proton 8, Proton Experimental, GE-Proton, Linux Runtime and Native).
  6. User selects desired tool/engine/env (in this example: native)
  7. Depending on what works, from here either path A or path B:

Path A - Live changing works

  1. Lux client: Use Steam commands to change compat_tool
  2. Lux client: inform the user that lux will close and the game will restart with the selected option (in this case Native)
  3. Lux client: send command to lux-helper to close and relaunch game
  4. Lux-helper: sends Steam command to close game, wait some secs
  5. lux-helper: sends Steam command to launch game
  6. Lux-helper: sends Steam command to set compat_tool to Luxtorpeda for game. (So it is back to Luxtorpeda the next time a user launches the game)

Path B - Live changing doesn’t work

  1. Lux client: inform the user that lux will close and the game will restart with the selected option (in this case Native)
  2. Lux client: send command to lux-helper to close and relaunch game
  3. Lux-helper: sends Steam command to close game, wait some secs
  4. Lux-helper: send Steam command to change compt_tool to selected option (in case of native send “”)
  5. lux-helper: sends Steam command to launch game
  6. Game launches with selected env/tool (in this case native)
  7. User plays
  8. User closes the game
  9. Lux-helper: detect that the game had closed (PID check?)
  10. Lux-helper: send Steam command to set compat_tool to Luxtorpeda for game. (So it is back to Luxtorpeda the next time a user launches the game)

It looks like protonup-qt may help to provide this for us, in terms of being able to pick compat tools for games, and to make it easier to pick luxtorpeda.

Since that tool already has work involved with seeing the current tools in-use (versus luxtorpeda which starts at it already being picked), I think that'll work nicely

See DavidoTek/ProtonUp-Qt#342 (comment) for more information on a proposed idea to make it even easier.

I'll re-open this if it makes sense for luxtorpeda to do this in the future.