Support gamemode
noah1510 opened this issue ยท 3 comments
On Linux many people use https://github.com/FeralInteractive/gamemode to boost their pc automatically when gaming.
The support would be in two parts:
- run smapi using gamemode (#952)
- Provide a default gamemode config
- Figure out what changes to the stock gamemode behaviour would benefit smapi
- Add that config to the installer script for linux
- Make sure the installer doesn't overwrite an existing config file
The gamemode provides two main ways to start games using it.
One is by calling a c header only function and the other is a helper program.
Since smapi already has a Linux specific launch script, using 'gamemoderun' seems easier.
I already opened a PR to support this and didn't find any bugs even after hours of playing with this change.
The only thing that would be missing is a Smapi specific gamemode config file.
I think it would be good to ship future smapi version with a gamemode config.
It just has to be placed on the same dir as the StardewModdingAPI executable
This config is not strictly necessary and most of the benefits are from running the game using the default configuration but it would still be nice to have some smapi optimized config by default.
However it would require some special handling in the installer to prevent it from being overwritten after each update.
Many users might change that file to fit their needs (e.g. in case of laptops with iGPUs and a proper one).
An update should not overwrite this which in turn would annoy the users that have to update their config after each SMAPI update.
"run smapi using gamemode" might out of a mod api tool's responsibilities?
steam version game can run with gamemode by edit game launch options. most 3rd game manager client, such as Lutris and Heroic, already have "gamemode" option.
gamemode contains utilities to include in games directly that allow the game to always run with gamemode if available. Integrating gamemode into games is encouraged by the gamemode team.
Given that the PR was only a few lines in the launch script and there have been no reported issues, I don't see why this shouldn't be supported in smapi directly.
That being said I am not sure if adding an optimized default config should be part of smapi.
Running through gamemode was added in #952 (SMAPI 4.1.0). Overriding the default config is probably out of scope for SMAPI though, so I'll mark this done. Thanks for the suggestion and PR!