Game titles in RPC not the same compared to Windows
epic0421 opened this issue · 13 comments
Using the DELTARUNE demo as an example, the game title when using Proton on Linux is different from how it shows up on Windows. Fallout Shelter and Bloons Monkey City work perfectly fine so not all titles have this issue
it picks the title based on the folder name of the game atm, might change that
it has been good enough for me while i was using it
might update it later to use the game's window title for proton games some how
because thats where discord normally looks at for the steam game names
and finds the icon from their server by matching the name
might update when i have time
@DeepDoge could you enlighten me on how this triggers Discord to see the window?
Reason I ask is that I have written a service that runs in the background and scans for running processes much in the same way you do.
I already have something working that fetches metadata about the process from the steam store, but I use the RPC sdk to connect with Discord. I was wondering how you triggered the actual activity to show up?
@kekonn Alright so, Discord has two different activity system, one is based on running processes(discord only had this before), other one is Discord's RPC, interacted with Discord's SDK/API.
Normally you have to add the running processes manually to the Discord. But Discord automatically adds Steam game processes to the activity when it detects them. (I think in settings it's called Registered Games atm)
So all you have to do is run a process inside .../steamapps/common/
and Discord will detect them as steam games automatically. Discord gets the game name from the window name of the process, and picks an icon from it's own database based on the name of the game, not steam id
or anything, just name.
So if I understand you, this doesn't work for Proton games, because then the actual process source is not from the common folder? And all you do is copy an exe to this folder with the matching name, and that exe draws a zero pixel window?
True, also I didnt use the "matching name" just got the name from the folder of the game, but yeah you can just use the matching name, its way better.
BTW my code also runs for linux games too, because window name of the linux games are not same as on Windows and they look bad. For example, instead of saying "Mount & Blade: Warband" it says "warband_linux". So i also change them.
Also in steamapps/common
there are proton processes too, you have to hide them from Discord, you can do it by moving them out of common
folder and symbolic link it back there. that hides it from Discord.
But shouldn't Discord already detective native linux games anyway? (except for maybe Flatpak discord)
because window name of the linux games are not same as on Windows and they look bad. For example, instead of saying "Mount & Blade: Warband" it says "warband_linux". So i also change them.
This might be handy: https://discord.com/api/v8/applications/detectable
It is a list of all filenames that discord can detect as "verified", which could help solve the issue of names not being the same/ games not appearing verified.
This might be handy: https://discord.com/api/v8/applications/detectable It is a list of all filenames that discord can detect as "verified", which could help solve the issue of names not being the same/ games not appearing verified.
- How did you get that?
- I wonder if you could extend that list or functionality somehow with BetterDiscord
This might be handy: https://discord.com/api/v8/applications/detectable It is a list of all filenames that discord can detect as "verified", which could help solve the issue of names not being the same/ games not appearing verified.
1. How did you get that? 2. I wonder if you could extend that list or functionality somehow with BetterDiscord
@kekonn Apologies for the late reply:
-
I stumbled upon this data when looking into the discord API for figuring out some way to connect the game sdk's windows library to a linux instance of discord, I suspect this is a pretty safe bit of the API but who knows if it will remain that way..
-
What would be interesting to think about would be if you could rewrite the game detection code in the discord client to better search for what game is running (I'm not really that well versed into the Discord client or BetterDiscord's API).
If plugins that aim to inject audio into Linux screenshares are possible with BetterDiscord I don't see how adding/modifying some code in the web client is impossible, might be the best way to go about 'fixing' their game detection logic.
Food for thought:
You could probably have an external relay program or library that replaces the gamesdk dll that intercepts calls to the game SDK that would relay them to the Linux Discord client via Discord RPC or GameSDK (Or an open source reimplementation like https://github.com/EmbarkStudios/discord-sdk).
The 'server' would be running in Wine as some kind of service (or as a DLL) and would accept connections from games, and would talk to the Linux side correctly.
I'm thinking kind of what Steam does with their thin Steam.dll wrapper that essentially just talks directly to the linux client.
You could probably have an external relay program or library that replaces the gamesdk dll that intercepts calls to the game SDK that would relay them to the Linux Discord client via Discord RPC or GameSDK (Or an open source reimplementation like https://github.com/EmbarkStudios/discord-sdk).
The 'server' would be running in Wine as some kind of service (or as a DLL) and would accept connections from games, and would talk to the Linux side correctly.
I'm thinking kind of what Steam does with their thin Steam.dll wrapper that essentially just talks directly to the linux client.
Someone already has done that, but it's a dll you have to copy into every proton instance. Anyway, that's so far above my skill level, that it won't fall on me to do that.
You could probably have an external relay program or library that replaces the gamesdk dll that intercepts calls to the game SDK that would relay them to the Linux Discord client via Discord RPC or GameSDK (Or an open source reimplementation like https://github.com/EmbarkStudios/discord-sdk).
The 'server' would be running in Wine as some kind of service (or as a DLL) and would accept connections from games, and would talk to the Linux side correctly.
I'm thinking kind of what Steam does with their thin Steam.dll wrapper that essentially just talks directly to the linux client.Someone already has done that, but it's a dll you have to copy into every proton instance. Anyway, that's so far above my skill level, that it won't fall on me to do that.
Do you know which project does that by chance? I know there's a Discord RPC client that works, but not one for games that use the GameSDK.
I think it's this project: https://github.com/0e4ef622/wine-discord-ipc-bridge