Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support passing launcher information to mods #178

Conversation

keton
Copy link
Contributor

@keton keton commented Jan 15, 2024

This change together with praydog/uevr-frontend#9 will allow one click 'launch to VR' from within Rai Pal. This also introduces proper division of responsibility where Rai Pal knows what to launch and UEVRInjector knows how to launch it.

On top of the code change UEVR rai-pal-manifest.json needs to look like this:

{
  "version": "1.03",
  "runnable": {
    "path": "UEVRInjector.exe",
    "args": [
      "--attach={{ExecutablePath}}", "--delay=30", "--launch={{StartCommand}}", "--launch_args={{StartCommandArgs}}"
    ]
  },
  "engine": "Unreal",
  "unityBackend": null
}

PS. this is the first thing I wrote in Rust ever. Feel free to treat it as a suggestion and provide better version instead.

Closes #111

@keton keton force-pushed the feat/support_passing_start_command_to_programs branch 3 times, most recently from 3337a12 to 5b20906 Compare January 15, 2024 18:04
@keton keton changed the title Support passing game.start_command to mods Support passing launcher information to mods Jan 15, 2024
@keton keton marked this pull request as ready for review January 15, 2024 18:06
@Raicuparta
Copy link
Owner

My only issue with this is it being on by default. There are a lot of people who never used UEVR without Rai Pal, and those people might miss that there are options to select before starting the game, like the OpenVR/OpenXR toggle. Plus I don't want UEVR to kinda fade away into the background and make it seem like Rai Pal is actually doing all the work (I already see some people using Rai Pal, UEVR, and UUVR interchangeably).

It would be pretty annoying to implement a setting on the Rai Pal side to make this configurable in a generic way, but it might be useful for future tools anyway. The manifest would need to be changed so you could have different togglable groups of arguments. Plus I haven't added any backend persisted settings to Rai Pal so far, so that functionality would need to be created (I was gonna do that eventually anyway).

Or an easier alternative, we could have a persisted checkbox on the UEVR frontend side like "allow game auto-start", that's off by default.

Maybe @praydog has some strong opinion about this? Maybe it doesn't really matter as much as I think, and can be on by default?

@keton
Copy link
Contributor Author

keton commented Jan 16, 2024

I'm all for having a discussion. I'm even open for situation where you guys decide it's not a good feature at all.

However I'm looking for a good UX flow, potentially one click, for non technical user and this is working really nicely. (Sad) truth is people don't care how it's done, they want an easy solution to play their favorite game in 3d.

For UEVRInjector to be in a launch flow enables streamlining it even more. Big pain point for my test user was deleting VR plugins from game folder ('I'm afraid/don't know what to do' kind of response).

Delaying game launch to the point controlled by UEVR frontend so it can handle the deletion and pointing it on a target using Rai Pal is solving that really well. This could be passed to Rai Pal but should it know about UEVR requirements and internals?

To sum up guys please guide me. I can always leave it on my private fork and use it like that.

@Raicuparta
Copy link
Owner

This is a feature I wanted to have anyway, in fact I already had issue #111 for this. I was just imagining that it would be a "launch game after runnable mod is launched" option in Rai Pal, completely independent of UEVR. So in this case Rai Pal would launch UEVR, then immediately start the game. No changes to UEVR needed, other than the delay parameter. UEVR could still use the delay parameter in this case, right?

@keton
Copy link
Contributor Author

keton commented Jan 16, 2024

UEVR could still use the delay parameter in this case, right?

yes but then things that require game not to be launched won't be possible. Currently that's dealing with VR plugins. But if that's not needed then solution where Rai Pal starts the game and UEVR does not touch that is also ok.

@Raicuparta
Copy link
Owner

yes but then things that require game not to be launched won't be possible. Currently that's dealing with VR plugins.

Not sure I understand. Could you expand on this, or explain why your solution doesn't have that problem?

@keton
Copy link
Contributor Author

keton commented Jan 16, 2024

Sure.

Problem to solve: Non savvy user does not know how to delete OpenVR/OpenXR plugins from game directory. There are games like The Entropy Center that simply will refuse to inject unless you delete those. Basically anything with OpenXR plugin on OpenXR renderer.

Current state: When UEVRInjector starts game is already running and those files are locked. Or game is not yet running but there's no way to tell launcher like Rai Pal 'plugins are deleted. Launch the game'

Proposed solution: Move launching the game under control of UEVRInjector, give it enough information and let it figure it out. This way there's guaranteed point in launch flow where we can check game folder but the game is not running yet. Also after plugins are taken care of we can continue because launcher details have been passed by Rai Pal to UEVRInjector.

I hope that's clear enough.

@Raicuparta
Copy link
Owner

Ok I understand now. In that case, it makes sense to use your implementation, just not on by default. If you change your UEVR PR to have the toggle then I'd be happy with this, otherwise better wait for me to implement some stuff for better Rai Pal settings

@keton
Copy link
Contributor Author

keton commented Jan 16, 2024

So Rai Pal will pass those parameters but UEVRInjector will have a switch user has to throw, off by default?

@Raicuparta
Copy link
Owner

So Rai Pal will pass those parameters but UEVRInjector will have a switch user has to throw, off by default?

Yeah, and persist that value of course. I think that would be the safest approach. If the switch is off UEVR just ignores those parameters.

@keton
Copy link
Contributor Author

keton commented Jan 16, 2024

Ok but let's remove it when Rai Pal will start to support multiple launch configurations. I'm afraid most people this will have biggest impact on won't be inclined to fiddle with the settings.

@Raicuparta
Copy link
Owner

If you have some other solution to the problem of first time players not seeing the available options / not recognizing UEVR's existence then of course give it a try. For instance I can imagine some dialog screen popping up the first time you run UEVR with these new parameters, as an alternative to the switch toggle.

@keton
Copy link
Contributor Author

keton commented Jan 16, 2024

That might be a good idea to try 🤔

@keton
Copy link
Contributor Author

keton commented Jan 16, 2024

So I did a quick doodle and this is first time auto launch dialog:
image

Even if user will check 'hide this warning' they can still opt-out by disabling 'Autostart game' toggle, and re-enable later:
image

Looks good?

EDIT: to be clear this wont pop up unless something passes --launch= to the injector so all preexisting tools won't trigger this.

@Raicuparta
Copy link
Owner

Nice, that's pretty much exactly what I had in mind. Maybe the text on the buttons needs some tuning to make it clearer, but not sure exactly how. Maybe instead of "change settings" it should be "I'll start the game myself" or something like that? But yeah I'd say go ahead with that :)

One more thing to keep in mind: Rai Pal gives users the option to start a game via Steam/GOG/Epic (default), or directly via exe, by using the dropdown next to the "start game" button. With this PR, you can't really control that anymore if you're using UEVR, you'd need to disable auto-start. Probably not worth doing anything about it, just wanted to point it out in case it's an important detail.

@Raicuparta
Copy link
Owner

Oh and either way I'll wait for it to be merged in uevr before going forward with this PR of course.

@keton
Copy link
Contributor Author

keton commented Jan 16, 2024

image

I've also made 'remember my choice' + 'I'll start myself' sticky. So if that's what user wants he'll never need to deal with it again.
I'll let you know when UEVR injector change is merged.

@keton keton force-pushed the feat/support_passing_start_command_to_programs branch from 5b20906 to d8db19c Compare January 22, 2024 08:09
@keton
Copy link
Contributor Author

keton commented Jan 24, 2024

@Raicuparta sorry for offtopic but would you be interested in integrating something like this: https://github.com/keton/chihuahua ?

I was trying to get my non technical VR explorers into UEVR here and now and what started as a simple .bat file evolved into quite reliable tool.

keton added a commit to keton/chihuahua that referenced this pull request Feb 1, 2024
keton added a commit to keton/chihuahua that referenced this pull request Feb 1, 2024
@keton keton force-pushed the feat/support_passing_start_command_to_programs branch from d8db19c to 56e9a48 Compare February 26, 2024 13:05
This change together with praydog/uevr-frontend#9 will allow one click 'launch to VR' from within Rai Pal.
This also introduces proper division of responsibility where Rai Pal knows what to launch and UEVRInjector knows how to launch it.

On top of the code change UEVR `rai-pal-manifest.json` needs to look like this:
```json
{
  "version": "1.03",
  "runnable": {
    "path": "UEVRInjector.exe",
    "args": [
      "--attach={{ExecutableName}}", "--delay=30", "--launch={{StartCommand}}", "--launch_args={{StartCommandArgs}}"
    ]
  },
  "engine": "Unreal",
  "unityBackend": null
}
```
@keton keton force-pushed the feat/support_passing_start_command_to_programs branch from 56e9a48 to cf6c289 Compare June 17, 2024 13:24
@Raicuparta Raicuparta changed the base branch from main to dev June 23, 2024 13:01
@Raicuparta Raicuparta merged commit 39aec94 into Raicuparta:dev Jun 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Auto launch game after launching UEVR?
2 participants