Detect and locate VRChat and Proton out of the box#9
Conversation
|
This is going to take me a while to review, sorry about that.
Also, could you clarify this? |
| "description": "Patches the VRChat Avatars SDK to work properly on Linux.", | ||
| "vpmDependencies": { | ||
| "com.vrchat.avatars": "^3.8.2", | ||
| "com.vrchat.avatars": "^3.10.3", |
There was a problem hiding this comment.
Is Bumping the VRC SDK version required here?
If not, I'd prefer it not be bumped
There was a problem hiding this comment.
I bumped VRCSDK in response to this, but I misremembered the details:
VRC now requires SDK 3.9.0+ on newly-uploaded avatars, but I forgot the conditional words on that: newly, uploaded, and avatars. But beyond that, I have not tested old SDKs so the patches may or may not apply. If you'd like, we can un-bump, and cross that bridge when we come to it?
There was a problem hiding this comment.
I would prefer not to bump if the patches work for older versions of the SDK, but bumping to 3.9.0 would be okay
If I build-and-test with 2 clients, both windows come up, but the second one stays black, even after closing the first. Maybe a fluke or PEBCAK, I don't know. |
|
Is the problem with this PR is that it's so large or monolithic? If it's the latter, I could try to break it up a little more, but then again it does rewrite just about everything... What should be done? |
|
I just need to pull myself together to review the whole thing, it's just been a bit daunting. |
DeltaNeverUsed
left a comment
There was a problem hiding this comment.
Wow, great work!
Sorry it's taken me forever to get around to this
| private static void OnGUIRowCustomProton() | ||
| { | ||
| var customProtonPath = LinuxVrcEditorPrefs.CustomProtonPath; | ||
| EditorGUILayout.LabelField("Custom Proton: ", customProtonPath ?? ""); |
There was a problem hiding this comment.
Maybe add a comment saying that it'll auto-detect the path when blank or some way of saying it's allowed to be empty.
| var steamRoot = SteamLocator.FindSteamRoot(); | ||
| if (steamRoot == null || !SteamLocator.IsValidSteamRoot(steamRoot)) |
There was a problem hiding this comment.
| var steamRoot = SteamLocator.FindSteamRoot(); | |
| if (steamRoot == null || !SteamLocator.IsValidSteamRoot(steamRoot)) | |
| var steamRoot = SteamLocator.FindSteamRoot(); | |
| if (steamRoot == null) |
Why check twice here?
SteamLocator.FindSteamRoot already runs SteamLocator.IsValidSteamRoot
| // Q: the "internal name" inside "compatibilitytool.vdf"? | ||
| // A: I think so! This is as expected in all my Proton versions. | ||
| // The file "toolmanifest.vdf" has nothing relevant. | ||
|
|
||
| return (from toolDir in Directory.GetDirectories(toolsDir) | ||
| let compatToolVdfPath = Path.Combine(toolDir, "compatibilitytool.vdf") | ||
| where File.Exists(compatToolVdfPath) | ||
| let compatToolVdfContents = File.ReadAllText(compatToolVdfPath) | ||
| // I could parse this file, but why bother lol | ||
| where compatToolVdfContents.Contains(compatToolName) |
There was a problem hiding this comment.
Also ends up matching "display_name" which is desirable here.
Adding that to the comment above would be nice
| namespace BefuddledLabs.LinuxVRChatSdkPatch.Base.Editor.Locators | ||
| { | ||
| /// <summary> | ||
| /// Data extracted from appcache.vdf on 2026-04-17 using a one-off script using new-vdf-parser[1] |
There was a problem hiding this comment.
Do you mean appinfo.vdf?
| public static class OfficialCompatToolData | ||
| { | ||
| private static readonly CompatTool Proton9 = new( | ||
| "proton_9", | ||
| "2805730", | ||
| "proton-9.0-4pin".Split(","), | ||
| "Proton 9.0 (Beta)" | ||
| ); | ||
|
|
||
| private static readonly CompatTool Proton10 = new( | ||
| "proton_10", | ||
| "3658110", | ||
| "proton-9,proton-9.0-1RC,proton-stable,proton-next,proton_next,proton-7.0-1,proton-7.0-2,proton-7.0-3,proton-7.0-4,proton-7.0-5,proton-7.0-6,proton-8.0-1,proton-8.0-2,proton-8.0-3,proton-8.0-4,proton-8.0-5,proton-8.0RC,proton-9.0-2RC,proton-9.0-3RC,proton-9.0-4RC,proton-10,proton-10.0-beta,proton-10.0-3RC" | ||
| .Split(","), | ||
| "Proton 10.0" | ||
| ); | ||
|
|
||
| private static readonly CompatTool Proton11 = new( | ||
| "proton_11", | ||
| "4628710", | ||
| "proton-11.0-beta".Split(","), | ||
| "Proton 11.0" | ||
| ); | ||
|
|
||
| private static readonly CompatTool ProtonHotfix = new( | ||
| "proton_hotfix", | ||
| "2180100", | ||
| "proton-hotfix".Split(","), | ||
| "Proton Hotfix" | ||
| ); | ||
|
|
||
| private static readonly CompatTool ProtonExperimental = new( | ||
| "proton_experimental", | ||
| "1493710", | ||
| "proton-experimental".Split(","), | ||
| "Proton - Experimental" | ||
| ); | ||
|
|
||
| public static readonly CompatTool[] All = { Proton9, Proton10, Proton11, ProtonHotfix, ProtonExperimental }; | ||
| } |
There was a problem hiding this comment.
This isn't a request to change anything.
Preferably this wouldn't be hardcoded, but parsing that file would be quite annoying.
| - Fixes the Build and Test button, allowing for multiple clients to test a world in offline mode. | ||
| - Adds some UI in VRCSDK Settings tab to select a different Proton to use instead of what's set in Steam. | ||
| - Show a one-time dialog to ask for votes on the Canny for Linux support. | ||
| - Add debugging helpers to the **Tools → Linux VRChat SDK Patch** menu. |
There was a problem hiding this comment.
Is this worth pointing out as a feature?
We're doing it "the right way". It autodetects your preferred Proton from Steam, locates the compatdata and LocalLow dirs, locates VRChat installation dir from Steam, if unset, allows you to set a custom VRChat.exe and/or a custom proton version, the Harmony patches are a bit cleaner organized, there's a lot of logging and defensive error handling, nullable context is on, almost supports multiple test clients, and has lots of docs.
But it is huge, sorry. I did write it by hand tho.
Fixes #1 and #8.