sonic2kk / steamtinkerlaunch

Linux wrapper tool for use with the Steam client for custom launch options and 3rd party programs
GNU General Public License v3.0
2.15k stars 73 forks source link

Non-Steam Games cannot find files in game dir #941

Closed CartoonFan closed 1 year ago

CartoonFan commented 1 year ago

System Information

Issue Description

As always, I like to clear issues with you before making new ones, to avoid unnecessary bug reports. After all, I could just be missing something obvious :sweat_smile:

While doing the final tests of #906, using Tokyo Xanadu eX+ as the test game, I noticed something strange. When the game's start directory is empty, the actual game seemingly can't find the necessary files, despite them being present in the directory:

2023_10_17_18_10_24

2023_10_17_18_06_45

2023_10_17_18_07_23

[jeremiah@arcadia Tokyo Xanadu eX+]$ pwd
/home/jeremiah/games/managed_games/gog/tokyo-xanadu-ex/drive_c/GOG Games/Tokyo Xanadu eX+
[jeremiah@arcadia Tokyo Xanadu eX+]$ ls -lv
total 5073892
-rw-r--r-- 1 jeremiah jeremiah  877325813 Oct 14 23:55  Asset1.bra
-rw-r--r-- 1 jeremiah jeremiah  499000182 Oct 14 23:54  Asset2.bra
-rw-r--r-- 1 jeremiah jeremiah 1653278165 Oct 14 23:56  Asset3.bra
-rw-r--r-- 1 jeremiah jeremiah  785690772 Oct 14 23:54  Asset4.bra
-rw-r--r-- 1 jeremiah jeremiah  716768383 Oct 14 23:55  Audio.bra
-rw-r--r-- 1 jeremiah jeremiah      51867 Oct 17 10:32  EULA.txt
-rw-r--r-- 1 jeremiah jeremiah    4730880 Oct 14 23:55  Galaxy.dll
-rw-r--r-- 1 jeremiah jeremiah  555182718 Oct 14 23:55  Japanese.bra
-rw-r--r-- 1 jeremiah jeremiah        633 Oct 14 23:58 'Launch Tokyo Xanadu eX+.lnk'
-rw-r--r-- 1 jeremiah jeremiah        277 Oct 15 00:15  ReShade.ini
-rw-r--r-- 1 jeremiah jeremiah     189241 Oct 17 17:25  ReShade.log
-rw-r--r-- 1 jeremiah jeremiah    3222240 Oct 17 16:03  ReShade32.dll
-rw-r--r-- 1 jeremiah jeremiah        526 Oct 17 18:06  ReShade32.json
drwxr-xr-x 3 jeremiah jeremiah       4096 Oct 17 17:11  Screenshots
-rw-r--r-- 1 jeremiah jeremiah         99 Oct 17 18:06  SpecialK_enabled.txt
-rw-r--r-- 1 jeremiah jeremiah   69753379 Oct 14 23:55  System.bra
-rwxr-xr-x 1 jeremiah jeremiah    7225344 Oct 14 23:55  TokyoXanadu.exe
-rw-r--r-- 1 jeremiah jeremiah       1755 Oct 17 17:13  TokyoXanadu.ini
-rw-r--r-- 1 jeremiah jeremiah    1574072 Oct 17 17:25 'TokyoXanadu 2023-10-17 17-25-05.png'
-rw-r--r-- 1 jeremiah jeremiah     121589 Oct 17 10:21  TokyoXanadu_20231017_172150.dmp
-rw-r--r-- 1 jeremiah jeremiah     119695 Oct 17 10:22  TokyoXanadu_20231017_172247.dmp
-rw-r--r-- 1 jeremiah jeremiah      46921 Oct 17 17:07  TokyoXanadu_20231018_000746.dmp
-rw-r--r-- 1 jeremiah jeremiah         12 Oct 15 00:15  check-steam_appid.txt
-rw-r--r-- 1 jeremiah jeremiah    3681600 Oct 17 16:03  d3dcompiler_47.dll
-rw-r--r-- 1 jeremiah jeremiah   10544128 Oct 17 18:06  dxgi.dll
-rw-r--r-- 1 jeremiah jeremiah       7197 Oct 17 18:06  dxgi.ini
-rw-r--r-- 1 jeremiah jeremiah      69248 Aug  9  2017  gog.ico
-rw-r--r-- 1 jeremiah jeremiah        157 Oct 17 10:32  goggame-1565811574.hashdb
-rw-r--r-- 1 jeremiah jeremiah     179429 Mar 30  2018  goggame-1565811574.ico
-rw-r--r-- 1 jeremiah jeremiah        336 Oct 17 10:32  goggame-1565811574.info
-rw-r--r-- 1 jeremiah jeremiah        157 Oct 14 23:56  goggame-1908505665.hashdb
-rw-r--r-- 1 jeremiah jeremiah     179429 Mar 30  2018  goggame-1908505665.ico
-rw-r--r-- 1 jeremiah jeremiah        603 Oct 14 23:56  goggame-1908505665.info
drwxr-xr-x 3 jeremiah jeremiah       4096 Oct 17 18:06  logs
drwxr-xr-x 2 jeremiah jeremiah       4096 Oct 14 23:55  movie
drwxr-xr-x 2 jeremiah jeremiah       4096 Oct 14 23:56  movieJP
drwxr-xr-x 5 jeremiah jeremiah       4096 Oct 15 00:14  reshade-shaders
-rw-r--r-- 1 jeremiah jeremiah         11 Oct 15 00:15  steam_appid.txt
-rw-r--r-- 1 jeremiah jeremiah      62895 Aug  9  2017  support.ico
-rw-r--r-- 1 jeremiah jeremiah    1862360 Oct 14 23:58  unins000.dat
-rwxr-xr-x 1 jeremiah jeremiah    1334880 Oct 14 23:58  unins000.exe
-rw-r--r-- 1 jeremiah jeremiah         41 Oct 14 23:58  unins000.ini
-rw-r--r-- 1 jeremiah jeremiah      23077 Oct 14 23:58  unins000.msg
-rw-r--r-- 1 jeremiah jeremiah    1634786 Oct 17 10:32  unins001.dat
-rwxr-xr-x 1 jeremiah jeremiah    1334880 Oct 17 10:32  unins001.exe
-rw-r--r-- 1 jeremiah jeremiah         41 Oct 17 10:32  unins001.ini
-rw-r--r-- 1 jeremiah jeremiah      23077 Oct 17 10:32  unins001.msg
-rw-r--r-- 1 jeremiah jeremiah     298538 Mar 30  2018  webcache.zip

I then tried a few more options:

2023_10_17_18_13_27

2023_10_17_18_17_43

Also, changing the working directory there does...nothing? No game, and the function doesn't even save the setting:

2023_10_17_18_23_24

The only way I was able to make it work was by running the game as a custom command:

2023_10_17_18_26_22

2023_10_17_18_26_49

2023_10_17_18_26_57

2023_10_17_18_27_24

2023_10_17_18_27_31

Running the game with a Steam compatibility tool (Proton-GE, Proton-TkG, regular Proton, etc.) instead of Steam Tinker Launch, doesn't help the game find the files, either :shrug:

2023_10_18_09_23_21

I'm pretty sure this is a bug of some sort, but, as mentioned, I'm looking for a second opinion :pray:

Also, sorry for the cluttered issue. It didn't come out as good-looking as I'd have liked :sweat_smile:

Logs

3678379145.log

steam-15798518130096996352.log

3678379145.log

CartoonFan commented 1 year ago

Woohoo! I'm glad that fixes it!

Me too! :grin:

Since I have the STL option enabled for creating a steam_appid.txt in the game folder, a 2nd runs returns the game to its old, crashing behavior (as expected?)

I haven't quite figured out why it causes a crash yet, but my guess is that STL is trying to do some Steam game specific setup when it gets this AppID. One fix I have in mind for this would be to simply ignore reading this file entirely when we have a Non-Steam Game (there are a couple ways to potentially tell).

I'll have to look and see how this file is actually used, but having this option cause crashes for Non-Steam Games is no good.

This isn't accusatory, I'm just wondering, what is this option enabled for? Is it just a handy way of getting the Steam AppID for a game for your own information? If so, it's probably safe to just tell STL not to read this for Non-Steam Games during a game launch.

It's occasionally used for allowing games to be run DRM-free (https://www.pcgamingwiki.com/wiki/The_big_list_of_DRM-free_games_on_Steam#SEGA) or for...non-Steam games? I vaguely remember something about...Fallout: New Vegas needing it for a mod or an installer or whatever. Honestly, I wouldn't have imagined it would cause problems--if anything, I thought it would help compatibility--so I figured leaving it enabled wouldn't hurt anything :disappointed:

The only thing I can think of right now that might use it is Special K, but even that's a moonshot. I'm...OK with disabling it, I think :sweat_smile:

But thanks for your gentle approach to the question :purple_heart:

I'm guessing this value doesn't crash regular Steam games? 😅 I have never used this option before, and totally forgot about it. And I didn't even catch that log line until just now when I brought it up. This explains why the blank paths work, because it doesn't have this AppID file to try and read from, so it never tries to incorrectly set this.

Hasn't happened yet to my knowledge, but...I'll have to try some without it now :eyes:

As far as I know, for a regular Steam launch, SteamAppId is an environment variable set as part of game launch. Steam passes SteamId for Non-Steam Games, so potentially it's Steam falling over here as well when we try to export SteamAppId as the contents of that text file. I'll have to test this, but if this is the case, then for Non-Steam Games we'll need to totally ignore that file if it's Steam falling over.

Haha, that's...kind of funny :sweat_smile:

Didn't expect all our digging to point...there, but it's good that we found a better workaround than the one at the beginning :+1:

Phew, thanks for all the testing and patience here. We got to the bottom of this in the end, fixed a couple of issues along the way, and found a couple more. The main one here I want to fix is the crash with the steam_appid.txt file, and I'd like to document that StartDir should always have quotes and to make sure of that (and a cheeky note that a PR would be welcome to fix that, because at least to me it seems like a really tricky problem to solve 😉)

You're welcome :weary: :+1:

Somehow, it feels like these issues are progressively getting more complex, and I'm not sure if that's because we're fixing the easier stuff, or if I just happen to point out tricky issues, or...something else, I guess :shrug:

After I regroup, my next big set of issues (either part of #894 or separate issues; please let me know whichever you prefer) will be dealing with the handful of weird cases I've found while testing ReShade + Special K compatibility.

Briefly:

2023_10_20_21_16_03

2023_10_20_21_22_14 2023_10_20_21_22_24

Hopefully, that'll be it for a while. As mentioned above, please let me know which of these deserve their own issues :purple_heart: :pray:

I'll leave this issue opened until I can fix this text file problem. But in the meantime, I hope you get to sit down and enjoy your game in the end 😄

You too! It'll be great to finally enjoy the full experience of a game that I bought in...2019? :rofl:

If you decide to keep the game, I hope you enjoy it as well. Paying full price for a game just to diagnose a bug is absolutely an amazing move :laughing:

Once those three points are resolved, I think we can close this issue. If there is something we discussed that I forgot about which also needs resolved, please let me know, but I think everything is working for you now? We just need to fix the option that caused this issue for you in the first place :-)

Sounds good :+1:

Assuming everything is working now, I'm really glad we got it resolved. For a moment there I thought this was going to be an obscure Steam bug, but hopefully it's all working for you now with STL.

Thanks again :pray: :purple_heart:

And by the way, I forgot to mention before, but it's pretty cool that you use STL as your default compat tool 😄

You know, I originally used it because I wanted to have OBS Game Capture, MangoHud, and Gamescope all on at the same time without...a crazy looking launch command. At first, the number of options was overwhelming :sweat_smile: , but over time, I've come to appreciate the flexibility and convenience it offers.

You're doing a great job :+1:

sonic2kk commented 1 year ago

s occasionally used for allowing games to be run DRM-free (https://www.pcgamingwiki.com/wiki/The_big_list_of_DRM-free_games_on_Steam#SEGA) or for...non-Steam games? I vaguely remember something about...Fallout: New Vegas needing it for a mod or an installer or whatever. Honestly, I wouldn't have imagined it would cause problems--if anything, I thought it would help compatibility--so I figured leaving it enabled wouldn't hurt anything 😞

I view it more as a lucky coincidence that you did. I mean, this has gone unnoticed for like 2 years or so, right? But now it's been found and it can be fixed :-)

Do let me know if any games break without this text field, because if so, I'll probably report it upstream to Steam for Linux. It may be a client bug in that case if Non-Steam Games can use it but Steam breaks if you set it for Non-Steam Games. But if Non-Steam Games are never gonna use it, then it's probably best to just avoid giving this to Steam.

Though I suppose in the latter case the fact that it loads it at all for Non-Steam Games could be a bug...

Somehow, it feels like these issues are progressively getting more complex, and I'm not sure if that's because we're fixing the easier stuff, or if I just happen to point out tricky issues, or...something else, I guess

I think a lot of people just don't report issues, and don't have the same kinds of use cases that you do. A lot of what I observed online in the past was that people used STL as simply an installer for MO2/Vortex, and don't really use any other part of it.

The way you use STL is a lot more like how I use it. It's my front-end to avoid having a freaking crazy launch command, and without having to remember the order of gamescope+gamemode+MangoHud. But the options we use are different, and there are lots of constellations that may not have been accounted for before, so the way we use STL just brings these issues to light.

That isn't to say you or I should use STL differently, I view it wholly as a good thing. I get a ton more satisfaction out of fixing issues like this than doing anything on the mod tools to be frank.

Special K doesn't seem to be able to automatically detect D3D9 games--the "auto" renaming setting just drops dxgi.dll into the folder. My example for this is my personal staple for compatibility issues, One Piece Pirate Warriors 3

Seems like that game isn't on the PCGamingWiki article (several games aren't), so when we can't find the game and renderer for SpecialK, we default to dxgi. You should be able to manually set the DLL to be d3d9.dll though :-)

ReShade, with Atelier Ayesha: The Alchemist of Dusk DX (https://www.pcgamingwiki.com/wiki/Atelier_Ayesha:_The_Alchemist_of_Dusk_DX), apparently bases its architecture detection on the launcher (which is 32-bit?) before it detects the game (which is 64-bit?) and...somehow neither the game nor the launcher get access to Special K or ReShade. I briefly tried renaming the game to the launcher--which worked partially, I think, but...it's kind of a weird situation 😅

There should be an optiom to choose an alternative EXE to check the architecture on somewhere around the ReShade options, which is in place for situations like this where you need DLLs matching the architecture of an EXE that is not the main game. Selecting the actual game EXE should get STL to check the architecture of that EXE instead of the launcher, and use the correct architecture.

As for loading the DLLs, you may have to skip the launcher. I'm not sure how this is meant to work, but you should be able to skip the launcher by setting the game EXE as the custom command, which should bypass the launcher. You can use"only custom command" so that the launcher won't start afterwards as well.

Actually, I think there was a change made a while ago so if a custom command is selected, we check the architecture of that EXE instead. But it's late and I'm on my phone so I can't hunt for the PR right now, but I recall making a change around this in the past I think... Still, selecting the EXE you want to check the architecture of explicitly couldn't hurt :-)

Guilty Gear Xrd -Revelator- (https://www.pcgamingwiki.com/wiki/Guilty_Gear_Xrd_-Revelator-) launches with a script, which throws off the DLL installation. Hopefully more of a minor thing--since I can just copy the DLLs and stuff in manually--but it's there nonetheless.

Fix should be same as above, pick the EXE that the bat launches to check the architecture against. I own this game on Steam I think so I could test this one out tomorrow (around the time I got into Strive I got it cheap I think).

Haven't really tried Vulkan/OpenGL/DX12 stuff yet, but those will probably be handfuls, too

Vulkan isn't supported by ReShade on Linux, and I think there's very limited SpecialK support... Not too sure to be honest!

I tested OpenGL games with ReShade and they worked (DOOM 3 was the main one I remember) but I'm not too sure about SpecialK. Does it support OpenGL?

I haven't tested DX12 games I don't think but I own a few I could test with as well.

As for which of these deserve their own issues, we can revisit it in one separate new issue to start off with if the above advice didn't resolve it for you 🙂

If you decide to keep the game, I hope you enjoy it as well. Paying full price for a game just to diagnose a bug is absolutely an amazing move 😆

Curiosity gets the better of me sometimes, both in terms of diagnosing bugs, and seeing all the unique games people use with STL has definitely influenced more than a few purchases outside of bug hunting :-)

You know, I originally used it because I wanted to have OBS Game Capture, MangoHud, and Gamescope all on at the same time without...a crazy looking launch command. At first, the number of options was overwhelming 😅 , but over time, I've come to appreciate the flexibility and convenience it offers.

It's for sure overwhelming, and the moment Yad gets support for tabs on Wayland you can bet I'm overhauling the UI. It's also really refreshing to hear those features come up, gamescope in particular is an area I've spent quite a bit of time on.


If the SpecialK+ReShade stuff is still giving you headaches, feel free to put it all in a new issue whenever you have time. There's no major hurry so just report whenever you have some time and I'll gladly take a look to try and figure things out.

Glad to be able to track down another good issue 👍

CartoonFan commented 1 year ago

It's going to take me a bit to process all this, but for now I just want to say:

Also,

Glad to be able to track down another good issue 👍

Glad to help :+1:

sonic2kk commented 1 year ago

Got an experimental PR up that should fix the steam_appid.txt generation for Non-Steam Games over at #946. If we have a Non-Steam Game we don't create the AppID file and turn the setting off on the next launch of the Non-Steam Game. So it should be safe for you to keep this option on by default!

There is also some logging to note when STL thinks it has a Non-Steam Game with this new code to check for Non-Steam Games. It may not be foolproof so if you run into a situation where steam_appid.txt is not created for a Steam game when you think it should be, you can report it and also check the log to see if STL did get it wrong. The code just tries to infer when we might have a Non-Steam Game based on some Steam environment variables :smile:

There are a couple more things related to Non-Steam Games on my radar still:

I think I will leave this issue opened until these are fixed :-)

CartoonFan commented 1 year ago

@sonic2kk I think we/I might've broken something :sweat_smile:

[jeremiah@arcadia ~]$ steamtinkerlaunch version
steamtinkerlaunch-v14.0.20231022-3
[jeremiah@arcadia ~]$ steamtinkerlaunch update grid installed
/usr/bin/steamtinkerlaunch: line 1635: getInstalledGameIDs: command not found
Could not find artwork on SteamGridDB to save with filename '_hero' -- Check the log for details
Could not find artwork on SteamGridDB to save with filename '_logo' -- Check the log for details
Could not find artwork on SteamGridDB to save with filename 'p' -- Check the log for details
Could not find artwork on SteamGridDB to save with filename 'SEARCHID' -- Check the log for details
[jeremiah@arcadia ~]$ 
sonic2kk commented 1 year ago

Good catch :fearful: getInstalledGameIDs doesn't seem to exist. I wonder where that came from, I'll have to investigate as I'm pretty sure this was used elsewhere...

sonic2kk commented 1 year ago

Dammit, I think there's a shortcut to close as completed and my silly fingers pressed it by accident...

CartoonFan commented 1 year ago

Dammit, I think there's a shortcut to close as completed and my silly fingers pressed it by accident...

That's totally fine :pray: :laughing:

sonic2kk commented 1 year ago

Ah, it's listInstalledGameIDs. Will just push this fix directly to master. I'm very surprised shellcheck didn't catch that...

That option actually had significantly little testing, so:

  1. Please do report back with issues
  2. It probably doesn't work for Non-Steam Games yet, because I haven't implemented a way to get IDs for Non-Steam Games yet (wrote a gist for it though)
  3. Hopefully you don't get rate limited :smile: This option always seemed risky to me, but it was there previously so it must've worked before, it's usefulness always seemed limited to me. I have over 400 games installed so even hitting the endpoint 400 times seemed like a stretch to me, I couldn't imagine hitting it 1,600 times!
sonic2kk commented 1 year ago

Fixed the incorrect function name in 15c2b22c92ca44d117c3c8e3e13a31b1a558c149 and bumped the version in 04260b7c049c81e6f311e1ca4e315428ac2b8932 (forgot to do it in the initial commit >_<)

CartoonFan commented 1 year ago

I'll give it a try :+1:

CartoonFan commented 1 year ago

Still busted, although not in the same way as the earlier comment :thinking: steamgriddb_terminal_log.log

sonic2kk commented 1 year ago

That was a scary log... okay, it looks like it's just passing all the IDs to the endpoint as one big string, instead of as individual ideas. Should be fixable though, it's getting further than I kinda thought it would, so if we can send the IDs properly we may be onto something.

CartoonFan commented 1 year ago

That was a scary log...

Sorry about that :sweat_smile: . I figured it'd be better than just...putting it in a big code block.

okay, it looks like it's just passing all the IDs to the endpoint as one big string, instead of as individual ideas. Should be fixable though, it's getting further than I kinda thought it would, so if we can send the IDs properly we may be onto something.

Got it!

sonic2kk commented 1 year ago

Phew, today has been a busy development day :sweat_smile: Pushed up a fix with https://github.com/sonic2kk/steamtinkerlaunch/commit/08a6bc4966ed295568ea44200ed216505ac01729 - I'll be interested to see how that goes. Now it should read the installed IDs one at a time and send them to getSteamGridDBArtwork.

CartoonFan commented 1 year ago

The command's looking pretty good so far :grin:

Thanks for all your hard work! :purple_heart:

sonic2kk commented 1 year ago

I resolved most of the points from my previous comment about the remaining tasks before we can close this issue. The outstanding pieces now I think are:

Once I fix the EXE path issue for Non-Steam Games, this can probably be closed :-)

CartoonFan commented 1 year ago

I resolved most of the points from my previous comment about the remaining tasks before we can close this issue. The outstanding pieces now I think are:

  • Fixing the EXE path not being found for Non-Steam Games. (looking into it right now, but no idea if it'll get fixed tonight 😅)

  • The discussed ReShade/SpecialK stuff, but that can go in a separate issue and be investigated separately

Once I fix the EXE path issue for Non-Steam Games, this can probably be closed :-)

Sounds good to me!

sonic2kk commented 1 year ago

Fixed game EXE name in 471f777f660a7a2595d3e4784d80d9d2f36a1294, this can be closed :partying_face:

image

CartoonFan commented 1 year ago

Thanks!