Pathoschild / SMAPI

The modding API for Stardew Valley.
https://smapi.io/
GNU Lesser General Public License v3.0
1.81k stars 259 forks source link

Support gamemode #950

Open noah1510 opened 4 months ago

noah1510 commented 4 months ago

On Linux many people use https://github.com/FeralInteractive/gamemode to boost their pc automatically when gaming.

The support would be in two parts:

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.

test482 commented 1 month ago

"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.

noah1510 commented 3 weeks ago

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.