tkashkin / GameHub

All your games in one place
https://tkashkin.github.io/projects/gamehub
GNU General Public License v3.0
2.23k stars 128 forks source link

Proton compatibility layer suddenly missing on non-Steam games #672

Open ghost opened 1 year ago

ghost commented 1 year ago
Expected behavior

When configuring a game, I can choose any version of Proton currently installed by choosing in in the "Compatibility layer" drop-down menu, like I always did. Proton was usually the default.

Actual behavior

When configuring a game, only Retroarch and Wine 32 + 64 show up.

Steps to reproduce

I don't remember doing anything.

Version and environment
- GameHub
    Version: 0.16.1--
    Branch:  
- Environment
    Distro:  Linux Mint 21.1
    DE:      X-Cinnamon
    GTK:     3.24.33
    Themes:  Mint-Y-Dark-Blue | Mint-Y-Dark-Blue
ghost commented 1 year ago

Could someone point me in the right direction? In what folder should Proton be for Gamehub to detect it? In the settings, under Steam, I am still correctly authenticated and the installation directory is correct, but there is nothing under Proton. I tried moving a Proton installation around, but to no avail. I even deleted .steam and reinstalled Steam and no success either.

Proxycon commented 1 year ago

Same problem here. Would really like to use Proton as compatibility layer. Grateful for any advice.

fyr77 commented 1 year ago

I am having the same issue. I suspect Steam may have changed something about the VDF file format. At launch, GameHub logs [AppInfoVDF] Error reading '/home/jakob/.steam/steam/appcache/appinfo.vdf': Unknown node type: 0x85 (at 77).

I tried investigating this a bit. Right at startup, when trying to find proton versions, GameHub reads a Steam VDF file looking for Proton instances installed. This uses src/utils/BinaryVDF.vala, AppInfoVDF to be precise. I do not quite understand how to read VDF files, but it is clear that AppInfoVDF gets aborted at some point (line 77 of the VDF in my case?) which leads to proton never being found.

I sadly did not manage to fix this yet, but maybe this can provide some info to code a fix.

Edit: What is strange about this is that all my games seem to show up fine. Maybe this is not the actual issue after all. Edit 2: According to this, the AppInfo format was changed in December 2022.

ghost commented 1 year ago

I'm glad you two could confirm that it isn't just me. This might finally spark some attention from the developer.

Proxycon commented 1 year ago

I fear this project is no longer maintained, considering the last dev activity was nearly a year ago. I don’t have any experience with vala and am not very confindent since @fyr77 (Amazing hint btw) already tried, but I try to look into this again, if I find the time.

fyr77 commented 1 year ago

A solution would perhaps be to not look for the proton versions in AppInfo, but instead use the regular path. We can detect the steam location without issue, normally they are found in compatibilitytools.d as far as I know? So just scanning that directory (and other typical places) might work.

Proxycon commented 1 year ago

With only looking at the code here on GitHub, my assumption would be, that the problem is happening before the AppInfoVDf is called. In the edit to the appinfo.vdf @fyr77 linked, it looks, like an additional entry (SHA1 checksum) is added an now in the spot where the BinaryVDF was listed before. So I could imagine, that instead of parsing the binary file, the AppInfoVDF Class is now given the SHA1 checksum as parameter, instead of the actual file. Maybe we should look into where the class gets called and how the parameters are chosen.

Edit: After reading a bit, it seems like in line 304 of BinaryVDF.vala „seek“ is used to skip the stream by 44 (bytes?). Afterwards the app ID is read from the stream. As this seems pretty hardcoded to me, it may be a fix to just skip/seek a bit further. This states, that the added checksum is 20 bytes long, so maybe just bumping the offset to 64 is enough?? Also today I learned: Vala is considered dead and documentation is pretty bad.

fyr77 commented 1 year ago

Update: I managed to implement using custom Proton versions in compatiblitytools.d https://github.com/fyr77/GameHub/commit/22e297b9b6bd857022009c8852c648859ca75b09

This works fine for running games, but the problem with Steam's Proton versions still stands.

Edit: This is still kinda hacky, this was just a first attempt. I need to figure out how to get the Steam directory set in the app settings, currently I am just scanning user home.

fyr77 commented 1 year ago

so maybe just bumping the offset to 64 is enough?? @Proxycon

Oh wow, it is. That fixes everything. I will test a bit and then push to my fork in case you want to build from source and try it.

And yes, Vala doc is kinda bad.

Proxycon commented 1 year ago

Oh wow, it is. That fixes everything. I will test a bit and then push to my fork in case you want to build from source and try it.

Amazing! Thank you for testing. And also adding support for custom Proton version is a often requested Feature, looking at the issues of this repo. Glad we could contribute a bit.

ghost commented 1 year ago

Amazing work! Thank you so much @fyr77 and @Proxycon. I've had this issue for about two months now. Now, could someone explain to a Github newbie how I can merge these changes without having to copy-paste the code @fyr77 posted directly into my local files like a caveman?

fyr77 commented 1 year ago

how I can merge these changes without having to copy-paste the code

Either you wait for this to be pulled into the main application, or you do the following:

  1. Uninstall your local installation of GameHub using your package manager.
  2. Follow these instructions to build it from source.
ghost commented 1 year ago

how I can merge these changes without having to copy-paste the code

Either you wait for this to be pulled into the main application, or you do the following:

  1. Uninstall your local installation of GameHub using your package manager.
  2. Follow these instructions to build it from source.

So kind of you. You made my day!

fionnb commented 9 months ago

Will this (proper) fix ever be merged? The original problem of improperly parsed appinfo.vdf is still present in 0.16.3-9327885-master

fyr77 commented 9 months ago

@fionnb I fear that the project dev is no longer working on this. Nothing has happened on this repository in quite a while.