Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Viper not auto-detecting Titanfall2 install on SteamDeck #94

Closed
GeckoEidechse opened this issue Mar 17, 2022 · 22 comments · Fixed by #97
Closed

bug: Viper not auto-detecting Titanfall2 install on SteamDeck #94

GeckoEidechse opened this issue Mar 17, 2022 · 22 comments · Fixed by #97
Labels
bug Something isn't working

Comments

@GeckoEidechse
Copy link
Contributor

Describe the bug
Viper fails to auto-detect Titanfall2 path when launching for the first time.

To Reproduce
Steps to reproduce the behavior:

  1. Own a SteamDeck (naturally the hardest part in reproducing this)
  2. Switch to desktop mode
  3. Download and run Viper AppImage
  4. Viper cannot find Titanfall2 install path

Expected behavior
Viper should be able to detect the game path. Especially SteamDeck which brings a lot of Linux noobs needs this feature to work.
(AFAIK auto-detecting path should work on Linux with #53)

Screenshots
Forgot to take a screenshot of the message (if you really want one, let me know where Viper stores the game path and I'll grab one)

Version:
v1.2.5

Additional Info
By default, the install for SteamDeck games is on /home/deck/.steam/steam/steamapps/common/. This of course changes if the game is installed on a SD card.

@GeckoEidechse GeckoEidechse added the bug Something isn't working label Mar 17, 2022
@0neGal
Copy link
Owner

0neGal commented Mar 17, 2022

Own a SteamDeck (naturally the hardest part in reproducing this)

Truly...


I've never actually tested #53, and had someone else do that for me, however would you be able to give the contents of ~/.steam/steam/steamapps/libraryfolders.vdf, as that's what we search, so if it's in there it should appear... Albeit I actually don't know if we support other folders than the standard location, but from peeking through the code, it looks like it just assumes the folder path quite a bit.

Forgot to take a screenshot of the message (if you really want one, let me know where Viper stores the game path and I'll grab one)

Unless the error wasn't the standard no game path found message I don't need it, in case it wasn't that error, simply removing ~/.config/viper.json will do it, keep in mind deleting it removes all settings, but you can also just set the gamepath value to ""

@GeckoEidechse
Copy link
Contributor Author

Contents of ~/.steam/steam/steamapps/libraryfolders.vdf. Titanfall2, i.e. 1237970 shows up:

"libraryfolders"
{
	"0"
	{
		"path"		"/home/deck/.local/share/Steam"
		"label"		""
		"contentid"		"6311211193224283608"
		"totalsize"		"0"
		"update_clean_bytes_tally"		"48244062152"
		"time_last_update_corruption"		"0"
		"apps"
		{
			"220"		"3815781836"
			"400"		"4167784026"
			"620"		"12755832170"
			"48000"		"103683209"
			"203160"		"11255565072"
			"228980"		"238275169"
			"310560"		"41657827517"
			"322500"		"4404334393"
			"351510"		"81051008"
			"424840"		"9651035051"
			"442070"		"247286636"
			"541200"		"2441511482"
			"571740"		"11516500797"
			"690040"		"2441708378"
			"1012560"		"1577655712"
			"1016920"		"457455538"
			"1070560"		"11307"
			"1118310"		"385242706"
			"1237970"		"68431323338"
			"1391110"		"635588870"
			"1572920"		"189248704"
			"1887720"		"1112259872"
			"1902490"		"4461464703"
		}
	}
}

@GeckoEidechse
Copy link
Contributor Author

I tried setting gamepath back to "" and then starting Viper and it failed to auto-detect the game yet again.

@0neGal
Copy link
Owner

0neGal commented Mar 17, 2022

"path"		"/home/deck/.local/share/Steam"

Seems to imply that the game is installed at that location and not ~/.steam, can you confirm this? Also can you confirm what the path is to the Titanfall2 directory from the Steam directory, as I think it might be that the code is assuming it's the default path...

@GeckoEidechse
Copy link
Contributor Author

Huh, so /home/deck/.local/share/Steam/steamapps/common/Titanfall2 exists. And that's also the location of Titanfall2 when I hit "Browse" in the game properties.

Also can you confirm what the path is to the Titanfall2 directory from the Steam directory, as I think it might be that the code is assuming it's the default path...

Not sure what you mean by this exactly ^^

@0neGal
Copy link
Owner

0neGal commented Mar 18, 2022

Not sure what you mean by this exactly ^^

I felt it was phrased very weirdly as well, I was referring to the path behind the Titanfall2 folder, specifically I wanted to know if it had the steamapps/common/ part of it, I'll try and have a look at it, as I should have quite a bit of time to look into it in more detail...

@0neGal
Copy link
Owner

0neGal commented Mar 22, 2022

I added some debug messages to the fix-vdf-not-working (#97) PR/branch, if you could try and run that and see what it outputs that'd be helpful... It should give something like:

VDF file found at: /home/deck/.steam/steam/steamapps/libraryfolders.vdf

Game found at: <path>
# or
Game not found at: <path>

Should be right at the top of the logs...

@GeckoEidechse
Copy link
Contributor Author

Can try but I will need either build instructions so I can create an AppImage on my Linux machine to copy over to the Deck or a pre-built AppImage.

The Deck doesn't have npm installed by default and an immutable filesystem (I don't wanna disable its readonly lock) so I cannot just do npm installl && npm run start.

@0neGal
Copy link
Owner

0neGal commented Mar 22, 2022

Can try but I will need either build instructions so I can create an AppImage on my Linux machine to copy over to the Deck or a pre-built AppImage.

npm i && npm run build:linux should do it, and it'll end up inside dist/ although keep in mind that will build all the various formats we have, so npx electron-builder --linux appimage would probs be better, unless you wanna wait for it to finish building all of it...

The Deck doesn't have npm installed by default and an immutable filesystem (I don't wanna disable its readonly lock) so I cannot just do npm installl && npm run start.

Hm, perhaps you could transfer the npm and node binary to your home directory, and run them, no clue which binaries would be needed to be able to run it, but it seems rather complicated :p

@GeckoEidechse
Copy link
Contributor Author

$ npm install && npx electron-builder --linux
npm WARN marked-man@0.7.0 requires a peer of marked@^0.7.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: iconv-corefoundation@1.1.7 (node_modules/iconv-corefoundation):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for iconv-corefoundation@1.1.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: dmg-license@1.0.11 (node_modules/dmg-license):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for dmg-license@1.0.11: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

audited 318 packages in 1.776s

27 packages are looking for funding
  run `npm fund` for details

found 6 vulnerabilities (1 low, 5 high)
  run `npm audit fix` to fix them, or `npm audit` for details
Cannot find module 'fs/promises'

Seems like there's a missing package?

@0neGal
Copy link
Owner

0neGal commented Mar 22, 2022

Weird... My random guess is you're not using the right Node version, Alystrasz had similar issues in #86, if you could try using node v17 or similar and see if that fixes it? That is, if you're not already...

@GeckoEidechse
Copy link
Contributor Author

GeckoEidechse commented Mar 22, 2022

Yup, that seems to it

$ npm --version
6.14.4

Thanks Ubuntu :trollface:
Snap version of node also fails, so I'll try a Docker container instead to build it ^^

@0neGal
Copy link
Owner

0neGal commented Mar 22, 2022

Yup, that seems to it

$ npm --version
6.14.4

I was more referring to node not npm, although npm's latest version is 8.X.X so it's still old... That's more or less what happens when you use an LTS/Debian distro :p

Seems it is possible to install it tho, just not through APT and instead a bash pipe.

@GeckoEidechse
Copy link
Contributor Author

GeckoEidechse commented Mar 22, 2022

Aight, managed to build the AppImage via some electron builder Docker container.
Copied the AppImage over to the SteamDeck, deleted viper.json and then ran the AppImage via the terminal.

The output:

(deck@steamdeck Warpinator)$ ./Viper-1.2.5.AppImage 
VDF file found at: /home/deck/.steam/steam/steamapps/libraryfolders.vdf
Promise { false }
[6247:0322/222832.259097:ERROR:object_proxy.cc(642)] Failed to call method: org.freedesktop.DBus.Properties.Get: object_path= /org/freedesktop/portal/desktop: org.freedesktop.DBus.Error.InvalidArgs: No such interface “org.freedesktop.portal.FileChooser”
[6247:0322/222832.259197:ERROR:select_file_dialog_impl_portal.cc(243)] Failed to read portal version property
[6282:0322/222832.723695:ERROR:sandbox_linux.cc(376)] InitializeSandbox() called with multiple threads in process gpu-process.
Checking for update
error: Northstar is not installed!
VDF file found at: /home/deck/.steam/steam/steamapps/libraryfolders.vdf
error: Northstar is not installed!
Update for version 1.2.5 is not available (latest version: 1.2.5, downgrade is disallowed).
checkForUpdatesAndNotify called, downloadPromise is null
error: Northstar is not installed!
error: Northstar is not installed!
error: Northstar is not installed!
error: Northstar is not installed!

(After prompted to select the Titanfall2 install location I cancelled out)

@0neGal
Copy link
Owner

0neGal commented Mar 22, 2022

Seems like it's never actually searching any library, I added an exrta log that should spew out all the parsed VDF stuff, perhaps that'll give some more insight into what's going wrong...

(After prompted to select the Titanfall2 install location I cancelled out)

Won't matter, the log code runs no matter what :)

@GeckoEidechse
Copy link
Contributor Author

Same process as before ^^

(deck@steamdeck Warpinator)$ ./Viper-1.2.5.AppImage 
VDF file found at: /home/deck/.steam/steam/steamapps/libraryfolders.vdf
{
  libraryfolders: {
    '0': {
      path: '/home/deck/.local/share/Steam',
      label: '',
      contentid: '6311211193224283608',
      totalsize: '0',
      update_clean_bytes_tally: '48244062152',
      time_last_update_corruption: '0',
      apps: [Object]
    }
  }
}
Promise { false }
[10909:0322/224448.749295:ERROR:object_proxy.cc(642)] Failed to call method: org.freedesktop.DBus.Properties.Get: object_path= /org/freedesktop/portal/desktop: org.freedesktop.DBus.Error.InvalidArgs: No such interface “org.freedesktop.portal.FileChooser”
[10909:0322/224448.749402:ERROR:select_file_dialog_impl_portal.cc(243)] Failed to read portal version property
[10943:0322/224449.203530:ERROR:sandbox_linux.cc(376)] InitializeSandbox() called with multiple threads in process gpu-process.
Checking for update
error: Northstar is not installed!
VDF file found at: /home/deck/.steam/steam/steamapps/libraryfolders.vdf
{
  libraryfolders: {
    '0': {
      path: '/home/deck/.local/share/Steam',
      label: '',
      contentid: '6311211193224283608',
      totalsize: '0',
      update_clean_bytes_tally: '48244062152',
      time_last_update_corruption: '0',
      apps: [Object]
    }
  }
}
error: Northstar is not installed!
Update for version 1.2.5 is not available (latest version: 1.2.5, downgrade is disallowed).
checkForUpdatesAndNotify called, downloadPromise is null
error: Northstar is not installed!
error: Northstar is not installed!
error: Northstar is not installed!
(deck@steamdeck Warpinator)$ 

@0neGal
Copy link
Owner

0neGal commented Mar 22, 2022

Everything seems normal, it just never actually wants to check if a library contains the game, which is odd, I added one last step of debug logging, if that doesn't give any useful info, I'll probably go ahead and @ 3top1a, who implemented the whole VDF parsing to begin with...

@GeckoEidechse
Copy link
Contributor Author

(deck@steamdeck Warpinator)$ ./Viper-1.2.5.AppImage 
VDF file found at: /home/deck/.steam/steam/steamapps/libraryfolders.vdf
{
  libraryfolders: {
    '0': {
      path: '/home/deck/.local/share/Steam',
      label: '',
      contentid: '6311211193224283608',
      totalsize: '0',
      update_clean_bytes_tally: '48244062152',
      time_last_update_corruption: '0',
      apps: [Object]
    }
  }
}
Promise { false }
[11296:0322/225804.569176:ERROR:object_proxy.cc(642)] Failed to call method: org.freedesktop.DBus.Properties.Get: object_path= /org/freedesktop/portal/desktop: org.freedesktop.DBus.Error.InvalidArgs: No such interface “org.freedesktop.portal.FileChooser”
[11296:0322/225804.569307:ERROR:select_file_dialog_impl_portal.cc(243)] Failed to read portal version property
[11329:0322/225805.019925:ERROR:sandbox_linux.cc(376)] InitializeSandbox() called with multiple threads in process gpu-process.
Checking for update
error: Northstar is not installed!
VDF file found at: /home/deck/.steam/steam/steamapps/libraryfolders.vdf
{
  libraryfolders: {
    '0': {
      path: '/home/deck/.local/share/Steam',
      label: '',
      contentid: '6311211193224283608',
      totalsize: '0',
      update_clean_bytes_tally: '48244062152',
      time_last_update_corruption: '0',
      apps: [Object]
    }
  }
}
error: Northstar is not installed!
Update for version 1.2.5 is not available (latest version: 1.2.5, downgrade is disallowed).
checkForUpdatesAndNotify called, downloadPromise is null
error: Northstar is not installed!
error: Northstar is not installed!
(deck@steamdeck Warpinator)$ 

@0neGal
Copy link
Owner

0neGal commented Mar 22, 2022

After a little digging, and guessing based on the raw VDF file you gave earlier, I was able to reproduce the problem, apparently as documented in the code:

// `.length - 1` This is because the last value is `contentstatsid`

We apparently remove the first element because it's not a library, however, for whatever reason the VDF file that the SteamDeck makes doesn't have this value (either due to Valve refactoring code or something maybe, or the value isn't set for whatever reason), which means, it skips the first library, given you only have one library, it skips everything... So I need to implement a quick check to whether the first value is contentstatsid or a library.

@0neGal
Copy link
Owner

0neGal commented Mar 22, 2022

From my testing it should now be fixed, but if you've the time, it'd be nice if you could verify that it in fact does fix it! I also removed all the debugging logs! Which I now realize may not have been the best idea to verify that it works... Just delete your config and check if it finds the path, if not I'll add the logging back in briefly :p

@GeckoEidechse
Copy link
Contributor Author

Confirmed working on c411343 :D

@0neGal
Copy link
Owner

0neGal commented Mar 22, 2022

Lovely, I'll merge it, then fix the flatpak issue...!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants