pizzaboxer / bloxstrap

An alternative bootstrapper for Roblox with a bunch of extra features.
MIT License
1.41k stars 224 forks source link

Renaming SteamVR folder on launch? #548

Open sylviiu opened 10 months ago

sylviiu commented 10 months ago

There has been a long-lasting issue with Roblox where regardless if the player has VR mode enabled or disabled, SteamVR would launch with Roblox (even when Steam itself is closed!!), causing an inconvenience to users using lighthouse-based tracking (turning on and off the base stations repeatedly can considerably shorten the lifespan).

This has been reported to Roblox for a while now (like this post on devforum in 2022), but the issue keeps appearing or related fixes causing other regressions with VR support in general.

https://github.com/pizzaboxer/bloxstrap/assets/95180094/fca887ce-79a5-4fbf-badb-0c813a2a90ac

Would it be possible to implement a native toggle for renaming the SteamVR folder on launch? This would especially be useful regardless if you want to use desktop or VR since SteamVR locks the path when running, so you can actually start SteamVR on your own accord.

Thanks in advance.

pizzaboxer commented 10 months ago

Maybe not renaming the folder, I wouldn't expect that to be very reliable. However, you could try setting your rendering mode as Vulkan through the Bloxstrap menu? It wouldn't be the best solution as Roblox would crash when you minimize, but it would work for now. I could take a look into what else can be done.

sylviiu commented 10 months ago

Renaming the folder is what other clients unrelated to Roblox (e.g., BSManager) do, but I can try running on Vulkan.

sylviiu commented 10 months ago

Using Vulkan does fix the issue of launching Roblox without SteamVR, but also seems to break VR functionality altogether. When launching the client, a stretched VR-like loading screen will appear, but then show the desktop view (no output to VR)

image

pizzaboxer commented 10 months ago

but also seems to break VR functionality altogether.

Yeah, I kinda thought that was the goal...

Renaming it may work, but things can become ugly if it's not cleaned up properly, like if Bloxstrap encounters an exception, doesn't exit properly, etc. Also, it would mean for Bloxstrap to stay running in the background until Roblox is closed. I'm sure there's at least some better way to do it.

sylviiu commented 10 months ago

Yeah, I kinda thought that was the goal...

Maaaaaybe for some people, but I do like using Roblox VR sometimes unfortunately 😭

For what it's worth, in my testing renaming the SteamVR folder back to "SteamVR" after the Roblox client itself has launched works fine, even when it goes back into the desktop app view and joining another experience. It's just on initial startup of the Roblox client would the folder need to be renamed. Not sure if that'd help any?

pizzaboxer commented 10 months ago

in my testing renaming the SteamVR folder back to "SteamVR" after the Roblox client itself has launched works fine

Oh, that's great then. My last concern would've been filesystem permissions, but that might not be a problem since all system users appear to have full access to it. Shouldn't be too hard to add this as a feature.

sylviiu commented 10 months ago

Can confirm full control is given to all users.

image

Thank you so much!!

bluepilledgreat commented 5 months ago

This would be a big hack. I'd prefer finding a better solution than going through with this.

pizzaboxer commented 5 months ago

This would be a big hack.

On the other hand, if we can make this approach stable enough then it shouldn't be a problem.

bluepilledgreat commented 5 months ago

This would be a big hack.

On the other hand, if we can make this approach stable enough then it shouldn't be a problem.

I would kill the SteamVR process instead of renaming the SteamVR folder. If Bloxstrap unexpectedly crashes/closes, chances are that the SteamVR folder will not be renamed back.

pizzaboxer commented 5 months ago

The last I looked into this problem, it was that Roblox will launch SteamVR if it's not running, and killing the process for it while it had already registered with Roblox wouldn't cause things to play out nicely. If I'm misremembering or if it's changed now and killing the process doesn't cause any issues, then we'll go with that.

sylviiu commented 5 months ago

killing the process for it while it had already registered with Roblox wouldn't cause things to play out nicely.

That's unfortunately how it is. That's how it works with all VR programs (if I'm not mistaken, the Oculus client does this too for other apps, but otherwise that's definitely how SteamVR functions).

If Bloxstrap crashing is a concern, you can probably make a detached console process that waits a certain amount of time before renaming the folder back? Probably far fetched, but just an idea lol

pizzaboxer commented 5 months ago

We could, but then what if the system unexpectedly shuts down in the middle of gameplay? Then there'll be nothing to change it back afterwards.

Y'know, it's been so long that I've completely forgotten the details of this issue, and so I've completely forgotten that none of this is really an issue, because as you've said:

renaming the SteamVR folder back to "SteamVR" after the Roblox client itself has launched works fine

It would only need to be renamed back like a few seconds after Roblox has launched.

iPixelGalaxy commented 1 month ago

Assuming your SteamVR folder is in it's default location you can make a batch script in the same folder as the roblox folder with this in it, (or adapt the SteamVR path if necessary) and make a shortcut for it on your desktop.

@echo off
cd "C:\Program Files (x86)\Steam\steamapps\common\"
rename SteamVR SteamVR.bak
start "" "%~dp0RobloxPlayerBeta.exe"
timeout /t 5 /nobreak > nul
rename SteamVR.bak SteamVR
exit
sylviiu commented 1 month ago

Assuming your SteamVR folder is in it's default location you can make a batch script in the same folder as the roblox folder with this in it, (or adapt the SteamVR path if necessary) and make a shortcut for it on your desktop.

Thank you so much @iPixelGalaxy, this actually put me in the right direction of a little workaround. I still launch Roblox via Bloxstrap, but Bloxstrap also has its own method of launching external programs in parallel with Roblox image

I went ahead and modified this batch script so it wouldn't launch Roblox, and added an if/else to check if the folder existed in the first place (TIL this was actually a thing with batch scripts).

@echo off
cd "C:\Program Files (x86)\Steam\steamapps\common\"
if exist SteamVR\ (
   rename SteamVR SteamVR.bak
   timeout /t 5 /nobreak > nul
   rename SteamVR.bak SteamVR
   exit
) else (
   echo folder no exist
   exit
)