Game: a Builder update (or any window-less run) re-chooses Auto (this PC) for no screen and lowers the player's resolution #165

Closed
opened 2026-11-13 08:32:56 +00:00 by d4nkn3ss · 1 comment
Contributor

What happened

Updating a game folder with the Builder lowered the player's output resolution: longshot_options.ini went from output_res=2560x1440 (Auto's own choice for a 2560x1440 165 Hz screen) to output_res=2048x1152, with a new auto_for= fingerprint and auto_tuned= dropped. The player only ran the update; nothing was changed in the menu.

Any run without a real window does it the same way, so it isn't specific to the update: a headless start of the game (HOS_HEADLESS=1) from that folder rewrote the same three lines again a few minutes later.

Why (from the source at main 434712bb)

auto_settings::fingerprint() (gpu/vk/auto_settings.h) includes the screen's size (h.screen_w, h.screen_h). The Builder's shader preparation (--prepare-shaders, no window) and a headless start see no real screen, so the fingerprint differs from the one the options file keeps (auto_for=). menu_auto_for_gpu then chooses again for that "screen" and writes it into the player's options file (auto_for = auto_fp, auto_tuned = 0, a new output_res).

A normal windowed start afterwards sees the real screen again, so its fingerprint matches whatever was there before, and it keeps what the window-less run wrote. Restoring the old file fixes it: with the real window, the log says vk: Auto (this PC): the settings chosen for this PC before (NVIDIA GeForce RTX 3080, 10051 MB of video memory, dedicated, screen 2560x1440 at 165 Hz, ...) and nothing changes.

Steps

  1. A game folder with Quality preset "Auto (this PC)" (the default), started once normally so longshot_options.ini has auto_for= and output_res for your screen.
  2. Update it with the Builder (I used nightly-34-545618fc's folder and nightly-46-434712bb's setup with --cli --nup <file> --out <folder>), or start the game once with HOS_HEADLESS=1.
  3. Compare longshot_options.ini: output_res, auto_for and auto_output have changed and auto_tuned is gone.
-output_res=2560x1440
+output_res=2048x1152
-auto_for=744c6a1e8b5735b7
-auto_tuned=744c6a1e8b5735b7
-auto_output=2560x1440
+auto_for=65cf663444a98857
+auto_output=2048x1152

Where in the game

Not in the game: the Builder's update (its shader preparation) and any window-less start.

Hardware and version

RTX 3080 10 GB, NVIDIA 621.14, i9-12900K, 64 GB RAM, Windows 11; main screen 2560x1440 at 165 Hz. nightly-34-545618fc updated to nightly-46-434712bb.

A fix that seems natural

Don't choose Auto again (and don't write the options file's Auto lines) in a run with no window: the preparation and headless starts. Either skip auto_profile() there, or leave the screen size out of the fingerprint when it isn't a real screen. Players who update otherwise lose their resolution silently, and with "Auto" still shown in the menu.

### What happened Updating a game folder with the Builder lowered the player's output resolution: `longshot_options.ini` went from `output_res=2560x1440` (Auto's own choice for a 2560x1440 165 Hz screen) to `output_res=2048x1152`, with a new `auto_for=` fingerprint and `auto_tuned=` dropped. The player only ran the update; nothing was changed in the menu. Any run without a real window does it the same way, so it isn't specific to the update: a headless start of the game (`HOS_HEADLESS=1`) from that folder rewrote the same three lines again a few minutes later. ### Why (from the source at main 434712bb) `auto_settings::fingerprint()` (`gpu/vk/auto_settings.h`) includes the screen's size (`h.screen_w`, `h.screen_h`). The Builder's shader preparation (`--prepare-shaders`, no window) and a headless start see no real screen, so the fingerprint differs from the one the options file keeps (`auto_for=`). `menu_auto_for_gpu` then chooses again for that "screen" and writes it into the player's options file (`auto_for = auto_fp`, `auto_tuned = 0`, a new `output_res`). A normal windowed start afterwards sees the real screen again, so its fingerprint matches whatever was there before, and it keeps what the window-less run wrote. Restoring the old file fixes it: with the real window, the log says `vk: Auto (this PC): the settings chosen for this PC before (NVIDIA GeForce RTX 3080, 10051 MB of video memory, dedicated, screen 2560x1440 at 165 Hz, ...)` and nothing changes. ### Steps 1. A game folder with Quality preset "Auto (this PC)" (the default), started once normally so `longshot_options.ini` has `auto_for=` and `output_res` for your screen. 2. Update it with the Builder (I used nightly-34-545618fc's folder and nightly-46-434712bb's setup with `--cli --nup <file> --out <folder>`), or start the game once with `HOS_HEADLESS=1`. 3. Compare `longshot_options.ini`: `output_res`, `auto_for` and `auto_output` have changed and `auto_tuned` is gone. ``` -output_res=2560x1440 +output_res=2048x1152 -auto_for=744c6a1e8b5735b7 -auto_tuned=744c6a1e8b5735b7 -auto_output=2560x1440 +auto_for=65cf663444a98857 +auto_output=2048x1152 ``` ### Where in the game Not in the game: the Builder's update (its shader preparation) and any window-less start. ### Hardware and version RTX 3080 10 GB, NVIDIA 621.14, i9-12900K, 64 GB RAM, Windows 11; main screen 2560x1440 at 165 Hz. nightly-34-545618fc updated to nightly-46-434712bb. ### A fix that seems natural Don't choose Auto again (and don't write the options file's Auto lines) in a run with no window: the preparation and headless starts. Either skip `auto_profile()` there, or leave the screen size out of the fingerprint when it isn't a real screen. Players who update otherwise lose their resolution silently, and with "Auto" still shown in the menu.
Author
Contributor

Taking this. The cause is narrower than I wrote: on Windows auto_profile() (gpu/vk/vk_main.cpp) reads the screen only through the game's window (if (main_window && GetMonitorInfoW(MonitorFromWindow(main_window, MONITOR_DEFAULTTOPRIMARY), ...))), so a run with no window fingerprints a 0x0 screen, which never matches auto_for=. MonitorFromWindow(NULL, MONITOR_DEFAULTTOPRIMARY) gives the primary monitor, so the plan is to drop the main_window &&: the preparation and a headless start then fingerprint the player's real primary screen and leave the options alone. Linux reads the size through the window too (desktop_size); I'll say in the PR what that path does with no window.

Taking this. The cause is narrower than I wrote: on Windows `auto_profile()` (gpu/vk/vk_main.cpp) reads the screen only through the game's window (`if (main_window && GetMonitorInfoW(MonitorFromWindow(main_window, MONITOR_DEFAULTTOPRIMARY), ...))`), so a run with no window fingerprints a 0x0 screen, which never matches `auto_for=`. `MonitorFromWindow(NULL, MONITOR_DEFAULTTOPRIMARY)` gives the primary monitor, so the plan is to drop the `main_window &&`: the preparation and a headless start then fingerprint the player's real primary screen and leave the options alone. Linux reads the size through the window too (`desktop_size`); I'll say in the PR what that path does with no window.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot#165
No description provided.