rlabrecque / Steamworks.NET

Steamworks wrapper for Unity / C#
http://steamworks.github.io
MIT License
2.78k stars 366 forks source link

Steam wont stop saying "in-game" for some use cases #405

Closed natemakesgames closed 3 years ago

natemakesgames commented 3 years ago

Hi there,

I am developing a non-game utility software for Steam that acts as a launcher for other software. The problem is that I am kind of stuck in a corner where I cant initialize Steamworks, because if I do, my users would have to close all of the software they launched through my launcher to stop seeing "Playing xxxx" as their Steam status (this also prevents Steam from shutting down properly when a user quits Steam).

I think it's great that Steam tracks child processes in the way that it does, but I think that not allowing developers to override this tracking has caused a ton of problems with little to no upside. Facepunch put it this way:

Steamworks.SteamClient.Shutdown(); Steam won't actually show that you've stopped playing the game at this point. It doesn't do that until the exe and any child processes are closed. It sucks, but that's the way it is.

Source: https://wiki.facepunch.com/steamworks/Installing_For_Unity

I have to agree with Facepunch here: it does "suck", at least for my use case. It also seems to cause a ton of problems for other devs too, and I can't think of a single upside to this. Please correct me if there's an upside Im not seeing. (I did consider security, but not initializing steamworks is a way around this whole thing anyways?)

My proposed solution is to add something like SteamAPI.ForceShutdown, which stops all tracking of child processes, and stops Steam from seeing the game/app as "in-game". I am open to hearing other ideas about how to solve this issue.

If Valve devs are reading this: thank you for the hard work you do! :)

rlabrecque commented 3 years ago

I actually think ForceShutdown would be a generally great addition, not really something I can help with unfortunately though.

Part of the reason why this is the case is for things like game-specific launchers/downloaders where it opens up a spot where you login before the game launches, or can change your graphics settings before launch like Unity games. Unreal games also have multiple executables that steam needs to keep track of, where the first one does some dependency checks. It's also important to note that this functionality exists whether using the Steamworks API or not, as this is functionality in the Steam client itself. Valve does omit certain child proccesses from having games get stuck open, but that list is global for things like if your game opens explorer.exe, or the printing dialog.