sd805 / l4d2vr

Left 4 Dead 2 VR mod
369 stars 35 forks source link

Add application manifest and capsule images + update default binding name/description #73

Closed elvissteinjr closed 1 year ago

elvissteinjr commented 1 year ago

This might be me getting ahead of myself considering the prototype stage (very playable though!), but it makes SteamVR treat the mod as less of a second-class citizen. Adds title and logo presence instead having of the generic placeholders and makes it looks like just any other installed game. The capsule images are just taken from the Left 4 Dead 2 store assets. I refrained from slapping a "VR" on with the Future Rot font for now. Someone else with artistic ability can come up with a logo later I guess.

The way how the application manifest defines how to run the game is a compromise. What's in the commit is a launch via Steam URL. This respects the command line set by the user in Steam, but causes the Big Picture interface to pop up in the SteamVR dashboard. An alternative way would be to launch left4dead2.exe directly with the recommended arguments (avoids Big Picture). That would make launching the game via SteamVR UI and Steam different though, which might not be desirable.

Manifest to do that would look like this:

{ "source" : "builtin", "applications": [{ "app_key": "l4d2vr", \ "launch_type": "binary", "binary_path_windows": "../left4dead2.exe", "arguments": "-novid -insecure -window -novid +mat_motion_blur_percent_of_screen_max 0 +crosshair 0 -w 1280 -h 720 +mat_queue_mode 0 +mat_vsync 0 +mat_antialias 0 +mat_grain_scale_override 0", "action_manifest_path" : "SteamVRActionManifest/action_manifest.json", "image_path" : "l4d2vr_capsule_main.png", \ "strings": { "en_us": { "name": "Left 4 Dead 2 VR", "description": "Left 4 Dead 2 VR Mod" } } }] }

The manifest also changes the app key for the mod (using IdentifyApplication() in the code). This isn't strictly necessary and has drawbacks, such as previously saved binding not loading anymore. On the other hand I thought that the mod maybe shouldn't use the key "left4dead2"/"steam.app.550" for itself (autogenerated from executable/Steam AppID). Prefixing this with your username might be an idea too, but I left it without in the commit.

The code installs the manifest as a permanent manifest in SteamVR, so the mod appears in the Recently Played list and video/controller settings even when not running. The manifest is removed automatically by SteamVR if the file can no longer be found, so there's no need to worry about uninstalling it.

Alongside these prettifications I also adjusted the names & descriptions of the default bindings. Nothing much, just blanking the description as it's redundant (appears right below name in the UI) and using the naming scheme of SteamVR's default bindings.

As you can see, some stuff up for debate in this one. Curious of your thoughts there.

sd805 commented 1 year ago

I think I prefer the first option for the application manifest since it keeps the SteamVR and Steam launches consistent, and I don't think the Big Picture pop up is a big deal.

I'd like to keep the existing community bindings if that's possible. I tried using "steam.app.550" as the app key for the manifest (and in VR.cpp) but then the game doesn't show up in the SteamVR library. Do you know if there's a way to keep the community bindings and have it show in the library? If there's no way around it then I'm fine with using a new app key.

sd805 commented 1 year ago

I may have found a jank workaround to keep the community bindings: in IdentifyApplication() use "steam.app.550", but for the vrmanifest file give it a custom app_key. The only side effect I've noticed is that when you reopen the SteamVR menu after launching the game, the game title/thumbnail are the same as the old versions. Not a bad tradeoff I think (unless there's more side effects).

elvissteinjr commented 1 year ago

I've changed the manifest app key to "steam.app.550" now. It actually works fine this way. SteamVR just needs a restart to fully refresh the manifests from what I can tell (removed the old manifest first to check fresh setup).

The URL change in that commit is just something I saw when snooping around Steam's manifests. I don't think it makes any difference in practice, though.

It wouldn't be impossible to dismiss the dashboard automatically on launch btw... but it would mean to reach for commands meant for debugging as apps are not meant to be able to control dashboard visibility. Kinda don't want to go there, but wanted to mention it.

sd805 commented 1 year ago

Nice! We can just leave the dashboard as is. If people start getting confused and reporting that the game isn't loading, then we could dismiss it on launch.