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

One-Time Run: Default to per-game Proton version if --proton is not passed #1129

Merged
merged 6 commits into from
Jun 23, 2024

Conversation

sonic2kk
Copy link
Owner

@sonic2kk sonic2kk commented Jun 17, 2024

This PR allows for running One-Time Run without passing a Proton version. If the Proton version given is blank, or if --proton= is omitted entirely, we will fall back to the per-game Proton version, "USEPROTON".

If the per-game Proton version USEPROTON does not exist in ProtonCSV.txt (perhaps there have been Proton updates, or the game has not been launched in a long time and the value is a very old GE-Proton version) then we will resolve the mismatch using the USEPROTON.

This PR also fixes an issue with commandline One-Time Run where blank values were not being resolved correctly, because fixProtonVersionMismatch does not run unless ISGAME -eq 2, which is not guaranteed to be the case with One-Time Run if launched outside of Steam. Therefore, if we get far enough into the commandlineOneTimeRun function that we think we need to use Proton, we will force fixProtonVersionMismatch by passing a new argument FORCEPROTONMISMATCHRESOLVE which defaults to 0 if not passed to preserve existing functionality.

With that fixProtonVersionMismatch alone, it meant that it would've returned the first item in ProtonCSV if the mismatch version to resolve was blank (i.e. if --proton was not passed), which is not ideal. Instead this PR has extra functionality to make fixProtonVersionMismatch fall back to the per-game Proton version if RUNOTPROTON is blank (i.e. if --proton is not passed).

As a result, this PR means the following lines work:

  • steamtinkerlaunch otr --exe="/path/to/valid/exe" - This previously would not have worked because fixProtonVersionMismatch would not have ran, so the EXE would not run
    • With this PR, not only is this fixed, but we will fall back to the per-game Proton version instead of relying on fixProtonVersionMismatch to return whatever the first Proton value is in ProtonCSV
  • steamtinkerlaunch otr --exe="/path/to/valid/exe" --proton="invalid-proton" - This was previously meant to work by resolving with fixProtonVersionMismatch, but this would have usually failed because the function was not running at all if ISGAME was not 3. Now it will attempt to resolve the mismatch.

There are some things left to do in this PR, mainly I want to check to see if OTPROTON needs to be updated after a Proton version mismatch. Logically it seems to me that it should, since it is only set to the value given by --proton="" in the form of RUNOTPROTON, but as we can update this value to resolve mismatches if it is invalid, that means OTPROTON could be left being an invalid Proton version; that is, whatever RUNOTPROTON was originally set to.

TODO:

  • Further testing
  • Check if OTPROTON and other saving behaviour needs updated after RUNOTPROTON gets updated for a Proton version mismatch resolution
  • Version bump

@sonic2kk sonic2kk force-pushed the otr-default-proton-ver branch from a3fc3a2 to b770067 Compare June 20, 2024 18:31
@sonic2kk
Copy link
Owner Author

OTPROTON does need updated. It is blank if --proton is not given, and is incorrect if there is a mismatch resolution. It is set to the Proton name and not the path unlike RUNOTPROTON, so we need a way to get the RUNOTPROTON name and assign it to OTPROTON after we have confirmed a valid Proton version.

We can probably get the RUNOTPROTON name from the path using the ProtonCSV.

@sonic2kk
Copy link
Owner Author

Fixed OTPROTON issue. Now I need to verify that the UI still works fine with the selected Proton version.

@sonic2kk
Copy link
Owner Author

One-Time Run GUI still works as expected. Mismatch still works as expected on the UI as well. Tested using Proton Experimental on the UI which works.

Also tested the mismatch resolution on the UI by manually setting an invalid Proton version on the config which displayed on the UI and then resolved correctly when launching the game. The GUI defaults to the Proton version set in the Per-Game Config (USEPROTON).


Remaining work for this PR is to update the help screen to note that if --proton is left out, it will use the Per-Game Proton version by default. We also need to document this on the One-Time Run wiki. After that, a rebase, version bump, and merge.

sonic2kk added 5 commits June 23, 2024 02:48
… passed

If per-game Proton 'USEPROTON' is empty, we resolve the mismatch using that instead of RUNOTPROTON.
Also fixes an issue where One-Time Run did not correctly resolve Proton version mismatches if
RUNOTPROTON was blank.
@sonic2kk sonic2kk force-pushed the otr-default-proton-ver branch from f04632a to 885ac5a Compare June 23, 2024 01:48
@sonic2kk
Copy link
Owner Author

@sonic2kk sonic2kk merged commit 92cadd4 into master Jun 23, 2024
2 checks passed
@sonic2kk sonic2kk deleted the otr-default-proton-ver branch June 23, 2024 01:51
@sonic2kk
Copy link
Owner Author

This change has not been noted on the changelog because it pertains to commandline One-Time Run usage, which is is not available in a release.

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.

1 participant