-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Make Luxtorpeda download required Steam files #238
Comments
I belive these are the AppIDs needed currently:
Example of how to download Steam Linux Runtime 3.0 (Sniper) from a bash script:
|
I've also looked into if it is possible to check if it's already installed. And it is with the console commands However, since the install command is quick and there's no problem if the app is already installed, I say we just run it |
Thanks for the commands, I do already have some checks that can see if its installed which is what the engines use if it requires. So I could add some logic there where if one is missing, run the install, then run the find command one more time. If one is missing then, then just throw an error. |
etqw is the way it is because steam does not provide the linux binaries, so I don't think that;ll be helped by this feature but the rest makes sense. The engines could be made simpler by this change since they could assume that the app needed is always installed. |
Some additional details in luxtorpeda-dev/packages#996 |
I've added this in this PR - #239 This uses the existing app id searching that was already there plus calling the steam://install (through xdg-open). If it does not find an app, it'll request with that, and then wait 5 minutes (waiting for it to be found and for the directory to exist). Note that the vdf exists as soon as install starts, so just that was not a guarantee that it was complete. Please feel free to test it out and let me know what you think if you'd like. Soon, I'll create a new client release most likely. |
How do I test this? I've downloaded and compiled the debug build. I guess I need to switch the branch? |
There should be a build artifact on the latest action that you can use. If not you should be able to build with cargo build and copy the so file in target/debug to your steam compat tools luxtorpeda folder, replacing the one already there. Using the makefile for the godot part isn't required for this since there aren't any UI changes |
I got it to work, it started downloading both apps needed for hl2 downfall but then lux closed/crashed. I restarted it and got this error in console: 2023-09-11 00:56:06 INFO luxtorpeda::command run returned with exit status: 127
ERROR: [RUST] file '/home/jpx/.cargo/registry/src/index.crates.io-6f17d22bba15001f/gdnative-core-0.11.3/src/object/bounds.rs' at line 77: panic occurred: "assume_safe called on an invalid pointer"
at: <unset> (src/lib.rs:48)
thread '<unnamed>' panicked at 'assume_safe called on an invalid pointer', /home/jpx/.cargo/registry/src/index.crates.io-6f17d22bba15001f/gdnative-core-0.11.3/src/object/bounds.rs:77:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread panicked while processing panic. aborting.
/home/jpx/.local/share/Steam/compatibilitytools.d/luxtorpeda-dev/luxtorpeda.sh: line 16: 56331 Aborted (core dumped) "$DIR/luxtorpeda.x86_64" "$@"
Uploaded AppInterfaceStats to Steam |
Here's some more output in a gist: https://gist.github.com/Jpxe/ef0c49c19b74a9322ab3ff3de5852d1b |
Strange I'll see if I can replicate that, it looks like it got an error from the game launching and then crashed after that. If you run it again does it work? And can you replicate that if you uninstall those two and let it install them again? |
I'm not at my computer anymore. I'll try to retest it and get back to you tomorrow. |
From your gist, it looks like the source sdk is crashing, not sure why luxtorpeda is crashing for you as well. I tested with another game and it closes cleanly like expected if the game crashes. So you may have some issues with launching source games in general? You may try launching another one just to see if it works as expected. |
Another thing you might try and look at is adding some logs to your debug build, possibly around here:
to see if it got there and why it's crashing for you. You could also try this build built by github actions (https://github.com/luxtorpeda-dev/luxtorpeda/actions/runs/6134725511), to see if it's something wrong with your env. |
So I tried again. I download the GitHub actions build you linked and I also deleted all Steam files and reinstalled Steam just in case.
Terminal output of error: 0:58:56 [INFO] request_steam_app_id_install checking app of 243730 installed tries = 58
20:59:01 [INFO] request_steam_app_id_install checking app of 243730 installed tries = 59
20:59:06 [ERROR] request_steam_app_id_install. app not found of 243730.
20:59:06 [ERROR] get_app_id_deps_paths. app id 243730 not found. error = Custom { kind: Other, error: "request_steam_app_id_install. app not found of 243730." }
20:59:06 [ERROR] run_game. error: get_app_id_deps_paths not completed, error: Custom { kind: Other, error: "get_app_id_deps_paths. app id 243730 not found. error = Custom { kind: Other, error: \"request_steam_app_id_install. app not found of 243730.\" }" }
Some suggestions:
As for the errors I'm getting, I'll try to retest it again. Here's a gist of the terminal output: https://gist.github.com/Jpxe/ef76edbc416e37ae4e3826367013a855 |
I tested again and both download windows appeared. But lux crashed. Second try:
Third try:
|
On the first thing it looks like that's because the download look longer than 5 minutes which is the current timeout. I could increase that to something much longer. Once that's taken care of it should work. For the auto download that's on steams side so I don't have any control of that. As well letting the user pick is probably the best option since most people have multiple libraries. I could add some additional details to the progress screen that they need to look at the steam window to start the download. I don't have the name of the app at that point but could at least say to look out for a download dialog |
Also the logs you mentioned about resources not being freed is normal, that's a godot issue on close that I haven't figured out but it does not hurt anything, since it's on close |
I might be able to minimize and show the window, I'll have to see what godot supports on that. Thanks for testing, I'll have another build soon with some changes |
There's a new build here: https://github.com/luxtorpeda-dev/luxtorpeda/actions/runs/6167481918 It adds some more details to the progress screen and increases the timeout, along with making it configurable. I didn't see a way with Godot to control the window show/hide state, so left that out. Let me know how that goes, thanks! |
I'll see if I can try it out later today. It is possible to get Steam to download automatically/without prompting the user to press ok:
I think this command and auto download might be the best option. Especially when the popup isn't in the front and is easy to miss. |
With the download automatically, I prefer to let the user decide with the prompt, in case they don't want to install it for whatever reason, as well that lets them pick their library |
Both dependencies started to download ok but then Lux GUI crashed immediately. Log here: |
Currently, lux checks for the vdf being there and the folder being there. There might be a window where the files are being copied from the downloading space and the folder has been created. I may have to put some metadata in the packages json to say for a particular app id, check if a certain file exists, and then if it does assume that it's ready. That might not be 100% though, because depending on how the files are copied, some might still be missing. |
Do you know if there's some sort of signal we could use that the download is complete? Maybe a steam file that if no longer there that means the file is complete? |
What about doing a file size check for all the needed files? You can get the file sizes from the depots on steamdb: https://steamdb.info/depot/1070561/ |
From looking at the data we're getting from the vdf, looks like that gives us a nice payload to look for: { app_id: 243730, path: "/run/media/dnimon/Storage/SteamLibrary/steamapps/common/Source SDK Base 2013 Singleplayer", name: Some("Source SDK Base 2013 Singleplayer"), universe: Some(Public), launcher_path: None, state_flags: Some([FullyInstalled]), last_updated: Some(SystemTime { tv_sec: 1695052190, tv_nsec: 0 }), update_result: Some(0), size_on_disk: Some(8192132063), build_id: Some(397216), bytes_to_download: Some(4973367280), bytes_downloaded: Some(4973367280), bytes_to_stage: Some(8192132063), bytes_staged: Some(8192132063), staging_size: Some(0), target_build_id: Some(397216), auto_update_behavior: KeepUpToDate, allow_other_downloads_while_running: UseGlobalSetting, scheduled_auto_update: None, full_validate_before_next_update: false, full_validate_after_next_update: false, installed_depots: {243731: Depot { manifest: 7649573089460931720, size: 7884009941, dlc_app_id: None }, 243734: Depot { manifest: 2038873838433757169, size: 308720478, dlc_app_id: None }}, staged_depots: {}, user_config: {"BetaKey": "upcoming", "additionalcontent": "380,220", "language": "english", "platform_override_dest": "", "platform_override_source": ""}, mounted_config: {"BetaKey": "upcoming", "additionalcontent": "380,220", "language": "english", "platform_override_dest": "", "platform_override_source": ""}, install_scripts: {}, shared_depots: {}, last_user: Some(SteamID(76561197990646384) {ID: 30380656, Instance: Desktop, Type: Individual, Universe: Public}) } The main thing in there is If I see that, I should be able to use that to consider it ready to go. I'll implement that soon and provide a build, if you can try that out and see what you think. |
Implemented in https://github.com/luxtorpeda-dev/luxtorpeda/actions/runs/6225375926, once that's done, please give that a try and let me know what you think. |
Any luck with the latest build? |
I did try it and got a crash again. It was likely the game engine. Lux closed/crashed but I later realized I had changed the lux config settings, and I think there was a setting for closing lux GUI directly after launch? so that's probably why. I will try to test it again properly. I'm heading to work now but I should be able to look at it this evening. Do you have any recommendations for how to test a build like this? Last time I changed the vdf file to rename it to luxtorpeda-test in Steam |
Tested Downfall, Minerva and Resistance Element. Souce SDK and Linux Runtime 1.0 download works. Lux didn't seem to check for/or download HL2EP1 so Minerva crashed when Lux tried to launch it. I downloaded it manually and then it worked. Resistance Element checked for HL2EP2 and downloaded it. Fix HL2EP1 check and install for Minerva and then it looks good! |
Are there any more games I should test? Is it implemented for any of these?
|
If you search for I'll look at the ep1, that may be something related to it being shared with half life 2, I'm asking for the app_id (380). Could you provide a log of your attempt with minerva, where you try and want it to install ep1? As well, does it work on a normal case? |
Here's the log for all the games I tested: lux6225375926.log |
What were the results from those tests? did any of them fail? |
Only Minerva. It's the log for the tests I did previously here: #238 (comment) |
I wonder if it's because half life 2 episode 1 is part of half life 2 so it's getting confused messages there. While it's downloading and then completed can you check the vdf file for the app id in your steam library and paste the results here |
What vdf file is it in and where is it located? |
It'll be on your steam library then steamapps/appmanifest_appid.acf If you could copy the contents of that file when you first do the install of hl 2 ep1 and then when it's finished, that'd be great, thanks! |
After I uninstalled HL2EP1 this is the content of appmanifest_380.acf:
After installed (installed directly when I pressed install, so seems to be already on disk):
|
So it seems like HL2EP1 is automatically installed if you install HL2EP2. EDIT: yeah checking I uninstalled HL2EP2 and that changed the behavior of HL2EP1: when I pressed uninstall it removed the VDF file completely. When I pressed install it starts downloading (instead of being done directly like previously). Here's the VDF during HL2EP1 downloading and HL2EP2 uninstalled:
Here's the VDF file after HL2EP1 download is completed and HL2EP2 still uninstalled:
|
Interesting, thanks, what was the behavior of the client if you uninstalled ep2 and ep1? Does it work as expected? And if you leave all of them installed, does minerva launch? |
Works as intended. It asked the download ep1 and then launched the game when the download had finished.
Yes |
It also worked after I "uninstalled" ep1 from steam. |
Is there any case now where minvera is not working? Or is it working as expected now? Thanks! |
It's not working when I paus ep1 downloading. I think it's the same condition as the first time I didn't work. Here's the log output:
Here's the vdf for 380:
|
On the file, is that when you were paused, or in a different state? |
when paused |
Can you try this build? https://github.com/luxtorpeda-dev/luxtorpeda/actions/runs/6314729294 I believe the issue was when you first start, it wasn't checking the fullyinstalled flag, like it does when it asks for the install, so that should fix your issue. Thanks! |
The install command doesn't seem to work when the download is paused. But other than that it no longer crashes and when I manually resumed to download it waited until it downloaded and launches the game. So I'd say it's good enough for merging if you feel happy with it. Thanks for implementing it! |
Ok great, yeah there probably isn't anything I can do about it being paused, but at least now it'll act correctly. Thanks! I'll merge this in soon and create a release. Thanks alot for all the help in testing! |
Feature Request
As asked by this user: luxtorpeda-dev/packages#994 (comment)
This feature would allow Luxtorpeda to download Steam files and runtimes if an engine requires them. Such as:
Could also potentially be used for more requirements like:
Solution
Additional Context
I've tested this out a bit and installation is possible using either of these commands:
steam "steam://dev/console/ +app_install <AppID>"
- will download directly and in the background. Works even when user doesn't have console enabled. Does nothing if it's already installed.steam steam://install/<AppID>
- will prompt user and ask if they want to install. If already installed: does nothingThe text was updated successfully, but these errors were encountered: