R4wizard / NoitaSaveManager

A tool for managing Noita save files.
GNU General Public License v3.0
17 stars 2 forks source link

Launch through Steam #7

Open KubeRoot opened 4 years ago

KubeRoot commented 4 years ago

Currently, the game is being launched directly via the game exe. However, when launched this way, steam doesn't recognize the game being launched, which prevents the steam overlay from enabling.

If, instead, the launcher were to tell steam to launch the game, either through the browser protocol, specifically steam://run/<id>//<args>/, or through the -applaunch <appID> [launch parameters] commandline parameter, steam should properly recognize the game.

R4wizard commented 4 years ago

I have attempted to approach this problem using the steam://run/ protocol.

However it seems this spawns a steam process, which then spawns Noita, and finally ends the steam process. This causes the auto-save code to break as it believes the game has immediately exited.

R4wizard commented 4 years ago

An alternative solution is to bring the steam_api.dll into the NSM build and we can advertise "Playing Noita" even when NSM is open.

KubeRoot commented 4 years ago

The issue makes sense, I suppose you would need to detect the process separately from launching it in order to fix it properly. My main motivation for this is having steam overlay, primarily for chat and screenshot capabilities, which would presumably require steam to detect Noita specifically. Worst case scenario, game detection (for auto-save and similar) could be disabled when using steam, hopefully only as a temporary fix and future fallback if detection fails otherwise. Might also be worth looking into how steam game launchers work, they might have a hint.

That said, an option to advertise NSM as Noita might be desirable whether launching the game through steam or not. It might also not be necessary to include the steam_api with NSM, if it's possible to simply use the copy included with Noita.

R4wizard commented 4 years ago

I hadn't considered the steam overlay, that makes this a must fix. I will have to rejig the code to use a more active monitoring solution rather than the basic Exited event handling we do now.

I may still add advertising NSM as Noita as a toggle setting though :)

Klokinator commented 4 years ago

I'll add to this. Because the game launches not through steam, it doesn't appear to launch in beta mode. I would vastly prefer playing on beta mode with the seed selector, but cannot presently due to the game defaulting to non-beta.

Is this fixable?

R4wizard commented 4 years ago

@Klokinator I have created a new issue (#9) for that.