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

[Code & Docs] Add Support for Steam Deck #19

Merged
merged 25 commits into from
Mar 31, 2024
Merged

Conversation

kevin-wijnen
Copy link
Contributor

@kevin-wijnen kevin-wijnen commented Mar 27, 2024

Context

Addition to #9; I've been trying to get Comet to be easily usable with Valve's Steam Deck since Heroic Games Launcher works easily through Flatpak onto the handheld gaming device.

Since the rewrite to Rust (#15), technical compatibility has been made a lot easier. No more SSL certificate workarounds or separate packaging necessary as Comet works out of the box for Steam Deck users.

Proposal

With most of the issues resolved, I've tried to simplify usage of Comet for Steam Deck users by developing a Bash script to allow users to earn achievements when launching Steam shortcuts generated by Heroic Games Launcher.

This Pull Request adds the following to Comet:

  • Initial documentation regarding installation on the Steam Deck for both Desktop and Game Mode.
  • A Bash script users need to refer to in Heroic Games Launcher non-Steam game shortcuts in the Launch Options field to start Comet along with the achievement enabled GOG game.
  • Adds the Bash script and usage documentation to x86_64 Linux builds (as the Valve Steam Deck only uses this arch/OS configuration).

There are still few things to do for improved Steam Deck compatibility, but this seems like a good start. I intend to help out providing more documentation in the Wiki of the repository and list problematic games not working with the current set up (as previously discussed: games like Cuphead not communicating with Comet at all for example).

TO-DO:

  • Add instructions for workaround for GOG Galaxy games using older SDKs
    • Instructions present in the folder, yet might be useful to add to the USAGE.md for Steam Deck users.
    • Currently being discussed in Steam Deck Compatibility #9. Attach .bat file for service creation.
    • Add .bat file to dummy artifacts.
  • Add renewed .bat file for easier installation when the script (along with GalaxyCommunication.exe is in a Heroic accessible location (for Flatpak)).

@kevin-wijnen
Copy link
Contributor Author

kevin-wijnen commented Mar 28, 2024

TO-DO:

  • Add instructions for workaround for GOG Galaxy games using older SDKs
    • Instructions present in the folder, yet might be useful to add to the USAGE.md for Steam Deck users.
    • Currently being discussed in Steam Deck Compatibility #9. Attach .bat file for service creation.
    • Add .bat file to dummy artifacts.

@kevin-wijnen kevin-wijnen marked this pull request as draft March 28, 2024 23:20
@kevin-wijnen kevin-wijnen marked this pull request as ready for review March 29, 2024 22:23
Copy link
Owner

@imLinguin imLinguin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall, I have a few small nitpicks

Maybe instead of the whole pfx/ path to be copied by user we could make .bat copy the file. Then we could support a wide range of Wine versions/wrappers. If you wish I can take care of this after merging this Pull Request.

I appreciate the contribution

.github/workflows/build.yml Outdated Show resolved Hide resolved
.github/workflows/build.yml Outdated Show resolved Hide resolved
@imLinguin
Copy link
Owner

So we could have the script like this

@echo off

SET currdir=%~dp0
SET targetdir=C:\ProgramData\GOG.com\Galaxy\redists

sc create GalaxyCommunication binpath=%targetdir%\GalaxyCommunication.exe
if not exist "%targetdir%" mkdir %targetdir% 
xcopy /y /q %currdir%GalaxyCommunication.exe %targetdir%

With that we could ship GalaxyCommunication.exe next to the script

@kevin-wijnen
Copy link
Contributor Author

kevin-wijnen commented Mar 30, 2024

So we could have the script like this

@echo off

SET currdir=%~dp0
SET targetdir=C:\ProgramData\GOG.com\Galaxy\redists

sc create GalaxyCommunication binpath=%targetdir%\GalaxyCommunication.exe
if not exist "%targetdir%" mkdir %targetdir% 
xcopy /y /q %currdir%GalaxyCommunication.exe %targetdir%

With that we could ship GalaxyCommunication.exe next to the script

I've tried this with SteamOS yet there is a problem. Because of how WINE loads the .bat script, the current directory is not where the .bat file is located on the Linux filesystem. It is a temporary directory elsewhere with only the .bat file present in it. So while it correctly creates the folder, it doesn't get to see GalaxyCommunication.exe to copy it over.

The exact file path I get (as currdir) would be /var/run/user/1000/doc/9f150bfb/, with (assumingly) the last folder being random/not static. See this for an explanation of the folder. It's a temporary folder for processes. And trying to "trick" it by running the dummy service prior to the script does not work, as both will be in separate temporary folders.

A workaround might be to wait in the script, mention its current directory and have the user copy the dummy service executable over before continuing the process. But I would argue that would not make it any easier for the end user.

While the batch script would work for Windows, it's unsuitable for Linux environments relying on WINE to get the job done. A hint that might be useful, is that WINE does mount the internal SSD as the Z:/ folder. So the script could use a static path to copy from it. Like using a /home/deck/comet folder and mount it, to have a static point of reference where the GalaxyCommunication.exe could be stored for the script to copy it from.

@imLinguin
Copy link
Owner

While the script is in locations like ~/Documents or ~/Desktop it should work just fine, since Heroic has full access to those. Could we add instructions to place downloaded files there? It just feels a lot simpler than digging through wine prefixes. Some people don't even know what wine prefix corresponds to their game

@kevin-wijnen
Copy link
Contributor Author

While the script is in locations like ~/Documents or ~/Desktop it should work just fine, since Heroic has full access to those. Could we add instructions to place downloaded files there? It just feels a lot simpler than digging through wine prefixes. Some people don't even know what wine prefix corresponds to their game

My bad - I did not know this was a side effect of not providing Heroic access to a certain folder. I had my comet related stuff in a separate directory in the deck (user) folder. Moving my comet folder with everything of comet to ~/Documents made it work flawlessly.

I'll do a quick fact-check on whether actions/download-artifact actually unzips from the get-go, then I'll attach the new .bat script provided by you and push through the proposed changes of yours. Thanks for the feedback and assistance throughout this PR and in general aiding with bringing Steam Deck support into this. 👍

@kevin-wijnen
Copy link
Contributor Author

kevin-wijnen commented Mar 30, 2024

Update

After (struggling) with the CI/CD, I implemented the following:

  • Added the renewed .bat script along documentation (mentioning users should keep the files in a folder where Heroic has access to & renamed it to be more obvious to its function (install-dummy-service.bat).
  • Refactored CI/CD pipeline as requested to refer directly to the required files for Linux/Steam Deck deployments during upload

README.md Outdated Show resolved Hide resolved
Copy link
Owner

@imLinguin imLinguin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@imLinguin imLinguin merged commit 55e4025 into imLinguin:main Mar 31, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants