-
-
Notifications
You must be signed in to change notification settings - Fork 453
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
[Feature]: Add gamescope support #3089
Conversation
@Nocccer tested here with Flatpak and its working mostly fine. A few small improvements: The scaling method should be a Toggle and when enabled should show a Select with Interger, FSR and NVidia Integer Scaling (if I am not wrong its open source and works on all GPUs but its worse than FSR in most cases I guess). Using Interger and FSR won't work I guess since Interger will keep the fullscreen window but setting the game window itself to the internal game resolution. For instance: Game resolution 1440p upscaled to 4k, the game window does not use the whole screen when using interger: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we dont need to update this file anymore, in fact, we can remove the prepareFlatpak script in total since I added the other github action that clone the flatpak repo and opens a PR there with all the updates, including the changelog as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How we can build flatpak locally then from inside the heroic repository?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, so we will need both then.
Another thing, one good improvement would be also to check if gamescope is available and disable the Also, should we also add the Stretch scaling option? I wonder if people would use it to play 4:3 games from GOG or Amazon for instance and stretch it to 16:9. |
Ok so i added the message if gamescope can not be found. I also wrapped upscale and limiter behind a toggle. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we add a class to the div in line 84 like gamescopeSettings
we can fix the (i)
alignment issue with something like:
.gamescopeSettings .selectFieldWrapper {
grid-template-areas:
'label info'
'select select';
grid-template-columns: max-content 1fr;
}
.gamescopeSettings .textInputFieldWrapper {
grid-template-areas:
'label info'
'input input';
grid-template-columns: max-content 1fr;
}
And we can also replace the divs with margin 10 used as separators with:
.gamescopeSettings .row {
display: flex;
gap: 10px;
}
And changing the toggleRow
class with .row
. So we don't use toggleRow
for things components that are not toggles
<> | ||
{/* Upscale Method */} | ||
<SelectField | ||
label={'Upscale Method'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
label={'Upscale Method'} | |
label={t('settings.gamescope.upscaleMethod', 'Upscale Method')} |
.then((installed) => { | ||
setIsInstalled(installed) | ||
setFetching(false) | ||
}) | ||
.catch(() => { | ||
setIsInstalled(false) | ||
setFetching(false) | ||
}) | ||
}, []) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.then((installed) => { | |
setIsInstalled(installed) | |
setFetching(false) | |
}) | |
.catch(() => { | |
setIsInstalled(false) | |
setFetching(false) | |
}) | |
}, []) | |
.then((installed) => setIsInstalled(installed) ) | |
.catch(() => setIsInstalled(false) ) | |
.finally(() => setFetching(false) ) | |
}, []) |
setGamescope({ | ||
...gamescope, | ||
gameWidth: | ||
setResolution(event.currentTarget.value) ?? | ||
gamescope.gameWidth | ||
}) | ||
}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a suggestion, we use this code in 6 places, maybe we could move this inside setResolution
and do setResolution('gameWidth', event.currentTarget.value)
for example
and do this setGamescope....
code there instead
value={gamescope.windowType} | ||
> | ||
{['fullscreen', 'borderless'].map((opt, i) => ( | ||
<option key={i}>{opt}</option> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<option key={i}>{opt}</option> | |
<option key={i} value={opt}> | |
{t(`gamescope.windowType.${opt}`, opt)} | |
</option> |
We need to add this also somewhere before this return for the yarn i18next
command:
// t('gamescope.windowType.fullscreen', 'Fullscreen')
// t('gamescope.windowType.borderless', 'Borderless')
We can do something similar for the upscaling method select, to say AMD FidelityFX™ Super Resolution
instead of fsr
for example?
enableUpscaling: !gamescope.enableUpscaling | ||
}) | ||
} | ||
title={t('setting.gamescope.enableUpscaling', 'Enables Upscaling')} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
title={t('setting.gamescope.enableUpscaling', 'Enables Upscaling')} | |
title={t('setting.gamescope.enableUpscaling', 'Enable Upscaling')} |
if (!gameScopeBin) { | ||
return { | ||
success: false, | ||
failureReason: | ||
'Gamescope is enabled, but `gamescope` executable could not be found on $PATH' | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we should puts something in the logs and ignore gamescope instead of failing?
because if a user uninstalls gamescope and a game has it configured or it's configured in the defaults, there's no way for the user to disable gamescope form Heroic because we show We could not found gamescope on the PATH. Install it or add it to the PATH.
and hide the gamescope settings.
Or maybe we can always show the gamescope settings but show a warnings at the beginning of that section saying the executable was not found, so users can disable it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heroic should check for gamescope at launch as well, so it can ignore the gamescope settings if was not found.
This would avoid breaking some games in this example.
But I also vote for the disabled setting instead of removing it, so we can be more clear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah disabling the feature if no gamescope found is the best way in my opinion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just to clarify, currently the feature is partially disabled when the binary is not found (it shows a message and no actual settings)
that is what would cause this issue: if you had that available, enabled it, and then uninstall gamescope, the settings are disabled but the game would fail to run and we have no way of disabling it since the settings are gone
so we have to either:
- not fail if it's enabled but not available
- not hide the settings if it's enabled, even if not available to allow disabling it (we could hide the settings if disabled and not available to prevent enabling it)
- do both things to be extra safe
Tested here and the feature itself works pretty well (FPS limit won't work for me for some reason but I can see that the command is correct). I believe some of the improvements like the style can be done on another PR, I will also need to move it to a tab anyway once I merge my tabs settings PR. So I think solving some of the other comments here should be fine to merge. |
One thing we need is a new component that is an input with the exclamation icon inside it, on the left or right, to show the help text. Outside like this is not fine. we can improve that before the next release though. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Good stuff!
"gamescope": { | ||
"enableLimiter": "Enable FPS Limiter", | ||
"enableUpscaling": "Enables Upscaling", | ||
"missingMsg": "We could not found gamescope on the PATH. Install it or add it to the PATH." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"missingMsg": "We could not found gamescope on the PATH. Install it or add it to the PATH." | |
"missingMsg": "Heroic could not find gamescope on your system. Install it or add it to the PATH." |
I think it is easier to understand this way.
<div style={{ color: 'red' }}> | ||
{t( | ||
'setting.gamescope.missingMsg', | ||
'We could not found gamescope on the PATH. Install it or add it to the PATH.' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'We could not found gamescope on the PATH. Install it or add it to the PATH.' | |
'Heroic could not find gamescope on your system. Install it or add it to the PATH.' |
with my suggested change, the
I can push those changes, I already tested them |
Fine by me, that works as well |
Merging this one as well and we can improve it afterwards |
This PR adds support for gamescope configuration per game.
simplescreenrecorder-2023-10-02_19.28.05.mp4
Use the following Checklist if you have changed something on the Backend or Frontend: