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

Implement launcher integration #9

Closed
wants to merge 3 commits into from

Conversation

keton
Copy link
Contributor

@keton keton commented Jan 14, 2024

Proposed change allows UEVR frontend to be in charge how game is launched an injected while other tool like Rai Pal tells it what to launch. This in turn enables one click 'launch to VR' flow.

For that end 3 new command line options are added:

  • --launch=<game.exe or launcher URI> to specify game to launch
  • --launch_args=<space separated list of game.exe arguments> optional, mainly for Gog Galaxy integration
  • --delay=<number of seconds> to wait before injection for games that have problems with injecting right away

Summary example (put this into Windows shortcut):

UEVRInjector.exe "--launch=com.epicgames.launcher://apps/da36711940d4460da57d8d6ad67236a4%3Aa1afcdb1d2344232954be97d4b86b9a8%3Acfbbc006f3ee4ba0bfff3ffa46942f90?action=launch" --attach=CosmicShake-Win64-Shipping --delay=30

This will automatically:

  1. start SpongeBob Cosmic Shake on EGS.
  2. upon detection of game process wait 30s for the player to get into the game
  3. inject and refocus game window

From user perspective all he/she does is to click the shortcut and magic will happen.

Alternatively launcher like Rai Pal can invoke options above.

@praydog
Copy link
Owner

praydog commented Jan 14, 2024

Is there a reason why the brackets were all placed on one line? It makes the commit harder to filter. I get that this is standard C# coding style, but still. If there is an issue with a style that should be in a separate commitPR

@keton
Copy link
Contributor Author

keton commented Jan 14, 2024

There's no issue. I simply assumed that auto formatter is set correctly. For now I'll revert everything to the old style. Probably it would be good to add formatting rules that are in line with project code style in separate PR.

@keton keton force-pushed the feat/launcher_flow branch from 82bf7a5 to 335d597 Compare January 14, 2024 12:34
@keton
Copy link
Contributor Author

keton commented Jan 14, 2024

reverted code formatting to the old style

keton added 2 commits January 15, 2024 14:52
`--launch=` option accepts both executable paths and URIs for launcher
compatibility.

Some games like Sackboy or Telltale Expanse Series on Epic
will fail to launch correctly if .exe path is used directly. Instead they
require proper launcher URI.

This change will allow UEVR fronted to act as a launcher for games.

Example. Creating shortcut to:
```
UEVRInjector.exe "--launch=com.epicgames.launcher://apps/da36711940d4460da57d8d6ad67236a4%3Aa1afcdb1d2344232954be97d4b86b9a8%3Acfbbc006f3ee4ba0bfff3ffa46942f90?action=launch&silent=true" --attach=CosmicShake-Win64-Shipping
```

Will allow to automatically launch and inject Sponge Bob: Cosmic Shake on EGS
Some games don't respond well to be injected directly on boot.
Intro movies, menus, loading screens can appear broken or as a black
screen.

This commit augments `--attach` mode with `--delay` parameter allowing
UEVR injector to wait upon detecting target application. This gives user
time to get into the game without needing to go back to the injector UI
and pressing inject manually.

Example: `UEVRInjector.exe --attach=CosmicShake-Win64-Shipping --delay=30`
will wait for SpongeBob Cosmic Shake process to spawn, then wait 30s on
top and inject.
@keton keton force-pushed the feat/launcher_flow branch from 335d597 to 4f32ad6 Compare January 15, 2024 13:53
@keton
Copy link
Contributor Author

keton commented Jan 15, 2024

btw. with recent change to rai-pal this could enable 1 click launches straight to VR. All that's needed is 1 line of code there (to get launcher URI) and trivial update in UEVR rai-pal manifest.

EDIT: for example like this: Raicuparta/rai-pal#178

keton added a commit to keton/rai-pal that referenced this pull request 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:
```json
{
  "version": "1.03",
  "runnable": {
    "path": "UEVRInjector.exe",
    "args": [
      "--attach={{ExecutableName}}", "--delay=30", "--launch={{StartCommand}}"
    ]
  },
  "engine": "Unreal",
  "unityBackend": null
}
```
keton added a commit to keton/rai-pal that referenced this pull request 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:
```json
{
  "version": "1.03",
  "runnable": {
    "path": "UEVRInjector.exe",
    "args": [
      "--attach={{ExecutableName}}", "--delay=30", "--launch={{StartCommand}}"
    ]
  },
  "engine": "Unreal",
  "unityBackend": null
}
```
keton added a commit to keton/rai-pal that referenced this pull request 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:
```json
{
  "version": "1.03",
  "runnable": {
    "path": "UEVRInjector.exe",
    "args": [
      "--attach={{ExecutableName}}", "--delay=30", "--launch={{StartCommand}}"
    ]
  },
  "engine": "Unreal",
  "unityBackend": null
}
```
Some launchers, notably GOG Galaxy don't support launching game via
URI. They require command line option `Galaxy.exe /run:gameId`.

This commit adds command line parameter `--launch-args=` thant can accept
space separated argument list as as single string.
keton added a commit to keton/rai-pal that referenced this pull request 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:
```json
{
  "version": "1.03",
  "runnable": {
    "path": "UEVRInjector.exe",
    "args": [
      "--attach={{ExecutableName}}", "--delay=30", "--launch={{StartCommand}}", "--launch_args={{StartCommandArgs}}"
    ]
  },
  "engine": "Unreal",
  "unityBackend": null
}
```
@keton keton changed the title Implement basic launcher flow Implement launcher integration Jan 15, 2024
@keton
Copy link
Contributor Author

keton commented Jan 16, 2024

After discussion with Raicuparata Raicuparta/rai-pal#178 whole flow will be amended. Closing till then.

@keton keton closed this Jan 16, 2024
@keton keton deleted the feat/launcher_flow branch January 16, 2024 17:52
@laulaua3
Copy link

laulaua3 commented Jan 16, 2024

Hello, if you want to simplify argument handling you can use this nuget package which removes substrings and the if https://github.com/commandlineparser/commandline?tab=readme-ov-file
This greatly simplifies command line configuration.
I have been using it for a long time

keton added a commit to keton/rai-pal that referenced this pull request Jan 22, 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:
```json
{
  "version": "1.03",
  "runnable": {
    "path": "UEVRInjector.exe",
    "args": [
      "--attach={{ExecutableName}}", "--delay=30", "--launch={{StartCommand}}", "--launch_args={{StartCommandArgs}}"
    ]
  },
  "engine": "Unreal",
  "unityBackend": null
}
```
keton added a commit to keton/rai-pal that referenced this pull request Feb 26, 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:
```json
{
  "version": "1.03",
  "runnable": {
    "path": "UEVRInjector.exe",
    "args": [
      "--attach={{ExecutableName}}", "--delay=30", "--launch={{StartCommand}}", "--launch_args={{StartCommandArgs}}"
    ]
  },
  "engine": "Unreal",
  "unityBackend": null
}
```
keton added a commit to keton/rai-pal that referenced this pull request Jun 17, 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:
```json
{
  "version": "1.03",
  "runnable": {
    "path": "UEVRInjector.exe",
    "args": [
      "--attach={{ExecutableName}}", "--delay=30", "--launch={{StartCommand}}", "--launch_args={{StartCommandArgs}}"
    ]
  },
  "engine": "Unreal",
  "unityBackend": null
}
```
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.

3 participants