MikeMaximus / gbm

Game Backup Monitor - Automatically backup your saved games!
https://mikemaximus.github.io/gbm-web/
GNU General Public License v3.0
233 stars 10 forks source link

Idea for better wine support #148

Closed basxto closed 6 years ago

basxto commented 6 years ago

This is more of a brain storming, but I think there could be some redundancy avoided. Kinda related to #133

Environment variables are definitely accessible, since you can manually read them with ps e <pid>

Examples from Freedom Force vs. the 3rd Reich (8890) with Proton: WINEPREFIX=/mnt/olhdd/steam/steamapps/compatdata/8890/pfx/

*) from $WINEPREFIX/userdef.reg or $WINEPREFIX/user.reg key [Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders]

%LOCALAPPDATA%\Irrational Games\Freedom Force vs the 3rd Reich\User\SaveGames translates to /mnt/olhdd/steam/steamapps/compatdata/8890/pfx/ + drive_c/users/steamuser/Local Settings/Application Data/ + Irrational Games/Freedom Force vs the 3rd Reich/User/SaveGames

MikeMaximus commented 6 years ago

This could work, easier than handling dosbox anyway. When it's a game running in wine and an absolute save path, I could grab the path variables from user.reg and use those in the path manager.

MikeMaximus commented 6 years ago

Also did Valve change the wine binary names with Proton? Since GBM only looks for wine-preloader or wine64-preloader. I can't really test it since all my Linux installs are currently VMs.

Edit From the source on github it looks like they didn't change.

basxto commented 6 years ago

Detecting proton games works.

And I would have a similar vm-related problem when I want to add games to the windows list. I don’t think it’s good enough to just test with wine. Edit: Since only paths and program names matter, wine could be enough. Today I also played around with wine reg, regedit and winepath, which are basically great tools, but they all update the prefix. This sadly results in creating a new user and altering the registry.

basxto commented 6 years ago

This would be again be paths, GBM can't detect before the game was run the first time. Therefore it should be similarly handled to #135

MikeMaximus commented 6 years ago

I'll start fiddling on this issue soon and probably #143.

I spent some time clearing off one of my drives to setup a real install again (Ubuntu 18.04) so I can do some better GBM testing and play around with Proton. It's kinda crazy how well Proton works already, I swear No Man's Sky runs better in Proton than it does in Windows 10 on the same system. The games I've tried with just Wine(3.14-staging) are also giving me a much better experience since the last time I tried playing them in Linux.

basxto commented 6 years ago

Best list for proton games so far: https://spcr.netlify.com/

Some games would run best with lutris, because they have complex installers which apply patches and download additional libraries with winetricks. https://lutris.net/games/one-piece-pirate-warriors-3/ (You appear to have that game too; gamepad fix is wrong)

I haven’t played much with steam controller configuration yet, but that looks like a good way to fix games which have trouble to detect the gamepad correctly. Especially since you can download and share them.

There are still many games with problems, but it would be naive to expect ports to run better. https://wiki.archlinux.org/index.php/Steam/Game-specific_troubleshooting

SteamOS + Steam Controller will benefit heavily from proton. Same goes for Steam Link (device and app)

basxto commented 6 years ago

Maybe prefixes for MonitorID should be introduced in general. Otherwise you would need to dublicate monitorlist completely. L for Linux, W for Windows / Wine. Others could follow like M for Mac, B for BSD, G for GNU, H for Haiku, A for AmigaOS/AROS etc. But I don’t think alternative open source operating systems have much to offer in regard to gaming. They likely “only“ have ported open source games and run Windows and Linux games through compatibility layers.

MikeMaximus commented 6 years ago

Yeah i'm still chewing on how to handle some parts of this issue.

The Wine functionality part is basically done and needs some testing / tweaking. I'm just not sure how I want to handle a few issues in the GUI and the configuration identity issue you discussed.

MikeMaximus commented 6 years ago

This is how this feature will work for v1.1.5.

  1. In Linux, users are now able to import from either the official Windows or Linux configuration lists. A one-time information message about this feature is the displayed the first time a Linux user tries to import from the Windows list.

  2. Windows configurations are displayed in the Game Manager as they are in Windows, except environment variables won't be resolved.

  3. The first time a Windows configuration with a convert-able save path is detected running in Wine/Proton, GBM will convert the save path for the configuration to what it would be within the prefix and save it.

I decided not to make any additions for configuration OS identify for this version.

I need to do some testing with Wine games that use a relative path before release, but the feature seems to work great so far with all the Proton games I've tried that use an absolute path.

basxto commented 6 years ago

Sounds good, thanks. So in game manager you won’t see whether a game is native or not?

MikeMaximus commented 6 years ago

So in game manager you won’t see whether a game is native or not?

Right, there's no special flag yet to designate which OS a configuration is designed for. I'm just using tags to keep things organized at the moment.

basxto commented 6 years ago

Maybe just add tag “Wine” to games downloaded from the windows list. Unless you are doing something similar already.

MikeMaximus commented 6 years ago

I was thinking about that, as well as dropping the official tag from them since they'll be modified once the game is detected.

basxto commented 6 years ago

Why do they get modified? So on linux you can’t export to the official list of Windows games? It would be interesting adding games, one tested with Wine.

Edit:

GBM will convert the save path for the configuration to what it would be within the prefix and save it.

Somehow misread that as game path. So you are avoiding to create a new field for the prefix.

MikeMaximus commented 6 years ago

The save path is modified to point to the wine prefix, so it's ready for future saves and so you're able to restore if required.

It would be nice to have an amalgamated game list, it's just not something I want to tackle for this release.

MikeMaximus commented 6 years ago

Somehow misread that as game path. So you are avoiding to create a new field for the prefix.

Yeah basically. I have some changes in mind that I want to do all that once, but i'd like to get this release out first.

MikeMaximus commented 6 years ago

I've made the following changes when importing from the Windows list in Linux.

  1. Wine tag is automatically added.
  2. Official tag is removed.
  3. Games tagged with DOSBox / ScummVM are not shown for import.
MikeMaximus commented 6 years ago

Further enhancement/changes to this feature will be part of an upcoming issue.

basxto commented 5 years ago

With known prefix path and path of the emulator executable it be done much easier, I think. (related to #151)

#!/bin/sh
wine='wine'
export WINEPREFIX="${HOME}/.wine"
export COMMONDOCUMENTS=$(${wine} reg query 'HKLM\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders' /v 'Common Documents' | egrep -o ".?:\\\\.*" | tr -d '\r')
export USERDOCUMENTS=$(${wine} reg query 'HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders' /v 'Personal' | egrep -o ".?:\\\\.*" | tr -d '\r')
resolve(){
  resolved=$(${wine} cmd /c echo $1)
  ${wine} winepath "${resolved}"
}

resolve '%COMMONDOCUMENTS%\Monolith Productions\Condemned\Save'
resolve '%LOCALAPPDATA%Low\Weather Factory\Cultist Simulator'
resolve '%PROGRAMDATA%\Steam\Bejeweled2\users'
resolve '%APPDATA%\DarkSoulsII'
resolve '%USERDOCUMENTS%\nbgi\darksouls'
resolve '%USERPROFILE%\Saved Games\darksiders1.exe'
/home/dabascht/.wine/dosdevices/c:/users/Public/Documents/Monolith Productions/Condemned/Save                                                                 
/home/dabascht/.wine/dosdevices/c:/users/dabascht/Local Settings/Application DataLow/Weather Factory/Cultist Simulator                                        
/home/dabascht/.wine/dosdevices/c:/users/Public/Application Data/Steam/Bejeweled2/users                                                                       
/home/dabascht/.wine/dosdevices/c:/users/dabascht/Application Data/DarkSoulsII
/home/dabascht/.wine/dosdevices/c:/users/dabascht/Meine Dokumente/nbgi/darksouls                                                                              
/home/dabascht/.wine/dosdevices/c:/users/dabascht/Saved Games/darksiders1.exe
MikeMaximus commented 5 years ago

That is a more future proof way to do things. GBM's current method will break if they change how Wine reg files are stored/formated.