summaryrefslogtreecommitdiff
path: root/README.md
blob: dff417c8ea6ab6f5914bf5c7b09c13894c90ce09 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# Decky Framegen

[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/B0B71HZTAX)

Decky Framegen now treats OptiScaler as a **prefix-managed per-game runtime** instead of a game-folder mod installer.

## What changed

The plugin no longer needs to copy OptiScaler into the game install directory.

Instead, it:

- installs a shared OptiScaler runtime under `~/fgmod`
- stages OptiScaler into `compatdata/<appid>/pfx/drive_c/windows/system32` at launch time
- keeps a writable per-game config under `compatdata/<appid>/optiscaler-managed`
- restores the original Wine/Proton proxy DLL on cleanup
- parses the bundled OptiScaler template INI to expose real config sections/settings in Decky UI
- autosaves config changes immediately
- mirrors config changes into the live prefix copy while the selected game is running

That makes the integration:

- non-invasive
- reversible
- per-game
- much closer to a launcher/runtime feature than a file-drop mod installer

## Current default behavior

Default copied launch command:

```bash
~/fgmod/fgmod %command%
```

Cleanup command:

```bash
~/fgmod/fgmod-uninstaller.sh %command%
```

Proxy selection order inside the wrapper is:

1. `OPTISCALER_PROXY` / `DLL` env override if present
2. saved per-game preferred proxy
3. fallback `winmm`

## How to use

1. Install the plugin zip through Decky Loader.
2. Open Decky Framegen.
3. Press **Install Prefix-Managed Runtime**.
4. Enable a game from the **Steam game integration + live config** section, or copy the launch command manually.
5. Launch the game.
6. Press **Insert** in-game to open the OptiScaler menu.
7. If you want to change config while the game is open, open Decky and edit the selected running game there.

## Steam game integration + live config

The plugin can now:

- detect the current running Steam game
- pick any installed Steam game from a dropdown
- enable the generic prefix-managed launch option automatically
- disable a game and clean its compatdata-managed OptiScaler state
- read the selected game's managed or live `OptiScaler.ini`
- persist per-game proxy preference
- browse parsed OptiScaler config sections
- render section settings with Decky dropdowns, sliders, and text fields
- autosave changes immediately
- push config changes into the currently staged live prefix copy while the game is running

Enable writes this launch option:

```bash
~/fgmod/fgmod %COMMAND%
```

## Config persistence

Per-game config lives here:

```text
compatdata/<appid>/optiscaler-managed/OptiScaler.ini
```

During launch the wrapper copies that INI into:

```text
compatdata/<appid>/pfx/drive_c/windows/system32/OptiScaler.ini
```

When the game exits, the staged INI is synced back to the managed location.

## Live editing caveat

The plugin can write directly into the live prefix INI while the game is running.

That means:

- the file is updated immediately
- persistence is preserved
- some settings may still require OptiScaler or the game to reload/relaunch before they fully take effect, depending on what OptiScaler hot-reloads internally

So: **live file update is supported**, but **live behavioral reload still depends on OptiScaler/game behavior**.

## Supported proxy values

- `winmm`
- `dxgi`
- `version`
- `dbghelp`
- `winhttp`
- `wininet`
- `d3d12`

## Environment-driven INI updates

The wrapper still supports environment-based INI overrides. Example:

```bash
Dx12Upscaler=fsr31 FrameGen_Enabled=true ~/fgmod/fgmod %command%
```

## Technical summary

At launch the runtime:

1. resolves `STEAM_COMPAT_DATA_PATH`
2. creates `compatdata/<appid>/optiscaler-managed`
3. preserves the original selected proxy DLL as `<proxy>-original.dll`
4. stages OptiScaler and helper DLLs into prefix `system32`
5. sets `WINEDLLOVERRIDES=<proxy>=n,b`
6. launches the game
7. syncs `OptiScaler.ini` back to the managed directory on exit

## Build notes

Local frontend build:

```bash
pnpm build
```

Decky zip build:

```bash
bash .vscode/build.sh
```

If Decky CLI is missing, run:

```bash
bash .vscode/setup.sh
```

## Credits

- [Nukem9](https://github.com/Nukem9/dlssg-to-fsr3)
- [OptiScaler / cdozdil](https://github.com/optiscaler/OptiScaler)
- [Artur Graniszewski / DLSS Enabler](https://github.com/artur-graniszewski/DLSS-Enabler)
- [FakeMichau](https://github.com/FakeMichau)
- Deck Wizard and the DLSS2FSR community