Matoking / protontricks

A wrapper that does winetricks things for Proton enabled games, requires Winetricks.
GNU General Public License v3.0
1.64k stars 36 forks source link

LiveSplit auto-split system does not work when using protontricks #233

Open ghost opened 1 year ago

ghost commented 1 year ago

Describe the bug If i launch the LiveSplit.exe file using protontricks in the same prefix as resident evil 4 remake for example, the livesplit will not be able to read the game memory to autosplit segments and pause/restart the timer when you press pause in the game or when you move to the next segment

Seems like protontricks uses its own wineserver or whatever to launch processes

this is the solution i found to get livesplit working without protontricks since it cant do it:

Basically with that we run livesplit with the already running wineserver and that allows it to read the game memory correctly.

To Reproduce Steps to reproduce the behavior:

  1. Open LiveSplit.exe using the "Protontricks Launcher" that is in the context menu of Dolphin
  2. Try to open the game and it wont even launch at all
  3. If i try to launch with protontricks launcher after the game is started livesplit will freak out and freeze or crash when i enable the autosplit feature in "Edit splits"

System (please complete the following information):

ghost commented 1 year ago

If theres already a system in place to run a .exe file in the same wineserver of a already running game and i dont know then you can close the issue if you wish, but let me know how to do it, thx! :frog:

Matoking commented 1 year ago

Can you try using the --no-bwrap parameter with protontricks-launch instead? I tested this with Hitman 3 and Peacock Patcher (which also relies on reading the game's memory), and was able to make it work in this case:

protontricks-launch --no-bwrap <exe path>

When the bwrap is in use it retains the same PID namespace, which means it has access to the same processes as the host, but there seems to be something else preventing it from reading the game memory. In my case, without --no-bwrap the Peacock Patcher crashes when the game is launched as opposed to not detecting the game at all, so I suppose there is some other Steam Runtime related restriction or limitation at play?

Ideally, this should work with default options but this might be something that Protontricks cannot easily fix if we want to use Steam Runtime at the same time. Steam Runtime (aka bwrap) is used by default to run it in a similar environment as what Steam uses, which is required for older distros, so it's not something that can be easily disabled across the board.

ghost commented 1 year ago

protontricks-launch --no-bwrap <exe path> Seems to work, but only after the game is launched, that's good enough for livesplit to read memory and pause/start automatically

ishitatsuyuki commented 1 year ago

Debuggers won’t work with bwrap unless you launch them inside the container: https://gitlab.steamos.cloud/steamrt/steam-runtime-tools/-/issues/84

See https://gitlab.steamos.cloud/steamrt/steam-runtime-tools/-/blob/main/docs/slr-for-game-developers.md#inserting-debugging-commands-into-the-container for the “official” way to inject commands.