feat(input): show a notice when a controller's battery is low, when it disconnects and when it connects #1092

Open
lg wants to merge 2 commits from lg/Longshot:feat/controller-notices into main
Contributor

Type: feat · Risk: low · Tested on: Windows 11, RTX 4090 (621.24), a DualSense over Bluetooth · Needs: none

TL;DR

A controller that ran out of battery just stopped answering, and nothing on screen said why. Longshot now shows a short
notice when a controller's battery is low, when it is very low, when a controller disconnects and when one connects,
and the pause menu's System page names the controller with its battery percentage. Checked in the game on Windows with
a DualSense, with new game-free tests, and against main: no frame-rate cost measured (about 80 fps in play and 220 on
the pause page, with and without it).

Breakdown

  • Who it helps: anyone playing with a wireless controller, most of all a DualSense or DualShock 4, which report a real percentage.
  • What was wrong: the game never asks for a controller's battery (on the console the system shows it), and Longshot had nothing in its place.
  • What changes: notices at the top of the screen for a low battery, a very low one, a disconnect and a connect, and the controller's name and battery on the pause menu's System page.
  • What does not change: how controllers are read and bound, saves, settings and caches; HOS_PAD_NOTICE=0 turns all of it off.
  • How it was checked: in the game on Windows 11 with a DualSense (every notice, the pause menu's line through its pages), two new game-free tests, and frame rate against main: within the spread in play and on the pause page.
  • What is still open: nothing is asked for before merge. Not run: a real Xbox or Switch controller (simulated here), Linux and the Steam Deck (it builds for Linux), a battery actually running down, screens that are not 16:9.
  • Risk: low: a controller that misreports its battery could get a warning it should not, and a game version the menu hooks do not fit shows no line on the pause menu.

Why

A controller that runs out of battery just stops answering, and nothing on screen says why. The game never asks for
a controller's battery: on the console the system shows the low-battery notice and the controller screen, and
Longshot had nothing in their place.

No issue asks for this (tracker searched: battery, disconnect, controller connected).

What changed

Longshot now shows a short notice at the top of the screen, in the menu's style and language, when a controller's
battery gets low, when it gets very low, when a controller disconnects (saying if its battery was low) and when one
connects during play. Each shows for 6 to 12 seconds; the game is not paused. The game's own pause menu names the
controller on its System page, under the controller picture of "Basic Controls", with its battery percentage when it
reports a measured one (a DualSense or DualShock 4) and a bolt while it is plugged in. A controller that reports no
battery gets only the connected and disconnected notices, and under Steam Input that is the case whenever the game is
given only Steam's stand-in controller.

  • rules: host/pad_battery.h (pure). Low and very low follow what each controller reports through SDL: DualSense and
    DualShock 4 count in tenths (20% and 10%, the number shown); Xbox controllers warn at 40% and 10% and Switch
    controllers at 25% and 0%, with no number shown (SDL gives them as four and five levels); SDL2 and XInput give four
    steps. Each warning shows once as the battery falls. No new warning while the controller is plugged in, and one on
    screen goes after five readings plugged in (about 5 s through SDL, about 25 s through XInput).
  • host: host/pad_battery.c keeps a queue of notices: a new one replaces the same controller's earlier ones;
    otherwise the one on screen plays out, then the most urgent waiting one. A notice's time counts only while the
    player can be looking: the game's window in front (or an overlay over it), or the controllers set to count in the
    background. pads_poll (host/pad_sdl.c, once a second, through the new hos_sdl_pad_power) and,
    only when SDL's controller support is not there, pads_read (host/nn_hid.c, XInput) report controllers to it.
  • the pause menu's line: host/oot_menu.c finds the System page in front from the game's own menu hooks, on Windows
    and Linux (one of the page's panes took the focus last, and its screen still updates); host/hos_wide_ui.c notes the
    pane that shows the page's panel as it is placed and reads where it is when asked, so the line slides in with the
    page. It hides on the other pages, under a screen opened from the page (Load, Options), under the Insert menu and
    when the menu closes.
  • renderer: MkwVkHost.pad_notice and pad_status (MKWVK_API_VERSION 34); draw_pad_notice and draw_pad_status
    in gpu/vk/vk_menu.cpp; the notice's five texts in each menu language (gpu/vk/menu_i18n.h).
  • tests: tests/test_pad_battery.py and tests/test_pad_panel.py (new); test_fps_overlay_order.py,
    test_pads_after_menu.py and test_hold_toggle.py updated for the changed functions.
  • docs: the README's controller section, docs/development.md, and the guide-image review note.

Limits:

  • No battery reading, so no battery warning: Steam Input's stand-in controllers, the Steam Deck's built-in controls,
    and controllers SDL reads through the plain Linux joystick driver. The log says so once.
  • XInput controllers are reported only when SDL's controller support is not running.
  • A controller SDL first lists more than about 2 s after the game starts is announced as connected.
  • With several controllers, the pause menu names the first one.
  • The pause menu's line needs the supported game version's hooks (those the mouse in the game's menus uses); on a
    wider screen than 16:9 its place follows the menus' fit but was not looked at.
  • At the Large menu size, a long help text reaches up under the banner, and the notice covers the help box's title
    for the seconds it shows (second sheet below).

Measurements

Verdict: it works in the game (screenshots below), and no frame-rate cost was measured: standing still with no notice, main 80.2 / 80.0 fps, this PR 80.5 / 80.6, this PR with the notices off 80.9 / 80.75; on the pause menu's System page, where the controller's line is drawn, main 219.4 / 221.05 fps, this PR 220.9 / 221.5. Through the controller going and coming back, with the disconnected and then the connected notice shown, the six 5 s readings are 79.3 to 80.6 fps on main (median 79.55) and 79.5 to 80.6 here (median 79.85): no difference beyond the noise of so few samples, and the readings cover more than the notices themselves.

Hardware: Windows 11, RTX 4090 24 GB, driver 621.24, Core i9-10900K, 32 GB
Scene: the village, by its gate, daytime, standing still where the save loads; 3840x2160, DLAA, frame generation off, no frame rate cap, V-Sync off, HDR off (read back from each run's log)
Method: the vi: lines of longshot_log.txt (fps over 5 s). Standing still: 60 s from 25 s after the save loaded, main, this PR and this PR with the switch in turn, twice, after a warm-up launch of each build; the median of each run's 12 lines. The controller going and coming back: its device switched off in Windows, 5 s, switched on, 6 s, main and this PR in turn, twice; the three lines that end in that time (each covers 5 s, so they reach back before the disconnect). The System page: the pause menu opened on it, 60 s from 6 s after, main and this PR in turn, twice, after a warm-up of each
How to reproduce: load a save standing still with a controller connected, the settings above, and read the log's vi: lines; HOS_PAD_NOTICE=0 in longshot_env.txt for the third column
Commits: the standing-still and reconnect rows and the sheets are from 9f0dd23, this PR's code commit as it was on main 544229a (its builds named themselves 3938f4c). Rebased since: the two interface members now follow main's newer ones, so the version is 34, not 30; nothing else in the change differs, so those were not taken again. The System page row, the checks and the builds are from that rebase on main ef6038a (its builds named themselves ad35f3b). The head now (a1a3ff6, code bc175f4) is the same change on main 413d63e, one commit further, which touches only the opt-in Tracy profiler build

Before: main @ 544229a After: this PR @ 9f0dd23 After, HOS_PAD_NOTICE=0: this PR @ 9f0dd23
fps standing still, no notice on screen: median (run 1 / run 2) 80.2 / 80.0 80.5 / 80.6 80.9 / 80.75
fps through the controller going and coming back (run 1; run 2) 79.3, 79.5, 80.4; 79.6, 79.5, 80.6 79.5, 79.7, 80.5; 79.7, 80.0, 80.6 (the disconnected, then the connected notice shown) not measured
fps on the pause menu's System page (run 1 / run 2; main @ ef6038a, this PR @ ad35f3b) 219.4 / 221.05 220.9 / 221.5, the controller's line drawn not measured
A controller disconnects or connects nothing shown a notice each nothing shown
Its battery low or very low (from HOS_PAD_BATTERY_TEST; its own reading was 85%, on its battery) nothing shown a notice each nothing shown
The pause menu's System page no controller named DualSense Wireless Controller: 85% under the controller picture no controller named
The log lines
--- main-1 (longshot 544229a), standing still
vi: 12150 frames presented (80.0 fps over the last 5.0 s, interval 1)
vi: 12552 frames presented (80.3 fps over the last 5.0 s, interval 1)
vi: 12953 frames presented (80.1 fps over the last 5.0 s, interval 1)
vi: 13356 frames presented (80.5 fps over the last 5.0 s, interval 1)
vi: 13758 frames presented (80.3 fps over the last 5.0 s, interval 1)
vi: 14159 frames presented (80.1 fps over the last 5.0 s, interval 1)
vi: 14561 frames presented (80.2 fps over the last 5.0 s, interval 1)
vi: 14963 frames presented (80.3 fps over the last 5.0 s, interval 1)
vi: 15361 frames presented (79.5 fps over the last 5.0 s, interval 1)
vi: 15762 frames presented (80.2 fps over the last 5.0 s, interval 1)
vi: 16164 frames presented (80.2 fps over the last 5.0 s, interval 1)
vi: 16566 frames presented (80.3 fps over the last 5.0 s, interval 1)
--- pr-1 (longshot 9f0dd23), standing still
vi: 12410 frames presented (80.1 fps over the last 5.0 s, interval 1)
vi: 12812 frames presented (80.4 fps over the last 5.0 s, interval 1)
vi: 13215 frames presented (80.5 fps over the last 5.0 s, interval 1)
vi: 13618 frames presented (80.5 fps over the last 5.0 s, interval 1)
vi: 14020 frames presented (80.4 fps over the last 5.0 s, interval 1)
vi: 14424 frames presented (80.6 fps over the last 5.0 s, interval 1)
vi: 14828 frames presented (80.6 fps over the last 5.0 s, interval 1)
vi: 15231 frames presented (80.5 fps over the last 5.0 s, interval 1)
vi: 15633 frames presented (80.3 fps over the last 5.0 s, interval 1)
vi: 16038 frames presented (80.8 fps over the last 5.0 s, interval 1)
vi: 16442 frames presented (80.7 fps over the last 5.0 s, interval 1)
vi: 16844 frames presented (80.2 fps over the last 5.0 s, interval 1)
--- off-1 (longshot 9f0dd23, HOS_PAD_NOTICE=0), standing still
vi: 11830 frames presented (80.7 fps over the last 5.0 s, interval 1)
vi: 12234 frames presented (80.8 fps over the last 5.0 s, interval 1)
vi: 12639 frames presented (80.9 fps over the last 5.0 s, interval 1)
vi: 13043 frames presented (80.8 fps over the last 5.0 s, interval 1)
vi: 13449 frames presented (81.2 fps over the last 5.0 s, interval 1)
vi: 13854 frames presented (80.8 fps over the last 5.0 s, interval 1)
vi: 14258 frames presented (80.8 fps over the last 5.0 s, interval 1)
vi: 14663 frames presented (80.9 fps over the last 5.0 s, interval 1)
vi: 15069 frames presented (81.1 fps over the last 5.0 s, interval 1)
vi: 15475 frames presented (81.1 fps over the last 5.0 s, interval 1)
vi: 15881 frames presented (81.1 fps over the last 5.0 s, interval 1)
vi: 16287 frames presented (81.0 fps over the last 5.0 s, interval 1)
--- main-2 (longshot 544229a), standing still
vi: 11131 frames presented (80.0 fps over the last 5.0 s, interval 1)
vi: 11529 frames presented (79.6 fps over the last 5.0 s, interval 1)
vi: 11929 frames presented (79.9 fps over the last 5.0 s, interval 1)
vi: 12330 frames presented (80.2 fps over the last 5.0 s, interval 1)
vi: 12732 frames presented (80.2 fps over the last 5.0 s, interval 1)
vi: 13132 frames presented (80.0 fps over the last 5.0 s, interval 1)
vi: 13533 frames presented (80.1 fps over the last 5.0 s, interval 1)
vi: 13933 frames presented (79.8 fps over the last 5.0 s, interval 1)
vi: 14335 frames presented (80.3 fps over the last 5.0 s, interval 1)
vi: 14737 frames presented (80.3 fps over the last 5.0 s, interval 1)
vi: 15138 frames presented (80.0 fps over the last 5.0 s, interval 1)
vi: 15536 frames presented (79.5 fps over the last 5.0 s, interval 1)
--- pr-2 (longshot 9f0dd23), standing still
vi: 11503 frames presented (80.5 fps over the last 5.0 s, interval 1)
vi: 11904 frames presented (80.1 fps over the last 5.0 s, interval 1)
vi: 12307 frames presented (80.6 fps over the last 5.0 s, interval 1)
vi: 12711 frames presented (80.6 fps over the last 5.0 s, interval 1)
vi: 13116 frames presented (80.8 fps over the last 5.0 s, interval 1)
vi: 13519 frames presented (80.5 fps over the last 5.0 s, interval 1)
vi: 13922 frames presented (80.6 fps over the last 5.0 s, interval 1)
vi: 14325 frames presented (80.5 fps over the last 5.0 s, interval 1)
vi: 14729 frames presented (80.7 fps over the last 5.0 s, interval 1)
vi: 15132 frames presented (80.6 fps over the last 5.0 s, interval 1)
vi: 15536 frames presented (80.6 fps over the last 5.0 s, interval 1)
vi: 15939 frames presented (80.5 fps over the last 5.0 s, interval 1)
--- off-2 (longshot 9f0dd23, HOS_PAD_NOTICE=0), standing still
vi: 12021 frames presented (80.5 fps over the last 5.0 s, interval 1)
vi: 12423 frames presented (80.3 fps over the last 5.0 s, interval 1)
vi: 12827 frames presented (80.7 fps over the last 5.0 s, interval 1)
vi: 13232 frames presented (80.9 fps over the last 5.0 s, interval 1)
vi: 13637 frames presented (80.9 fps over the last 5.0 s, interval 1)
vi: 14042 frames presented (80.9 fps over the last 5.0 s, interval 1)
vi: 14447 frames presented (80.8 fps over the last 5.0 s, interval 1)
vi: 14852 frames presented (81.0 fps over the last 5.0 s, interval 1)
vi: 15253 frames presented (80.0 fps over the last 5.0 s, interval 1)
vi: 15657 frames presented (80.6 fps over the last 5.0 s, interval 1)
vi: 16062 frames presented (80.8 fps over the last 5.0 s, interval 1)
vi: 16465 frames presented (80.4 fps over the last 5.0 s, interval 1)
--- main-g1 (longshot 544229a), the controller going and coming back
vi: 12539 frames presented (79.3 fps over the last 5.0 s, interval 1)
vi: 12937 frames presented (79.5 fps over the last 5.0 s, interval 1)
vi: 13340 frames presented (80.4 fps over the last 5.0 s, interval 1)
--- pr-g1 (longshot 9f0dd23), the controller going and coming back
vi: 12890 frames presented (79.5 fps over the last 5.0 s, interval 1)
vi: 13289 frames presented (79.7 fps over the last 5.0 s, interval 1)
vi: 13692 frames presented (80.5 fps over the last 5.0 s, interval 1)
--- main-g2 (longshot 544229a), the controller going and coming back
vi: 12746 frames presented (79.6 fps over the last 5.0 s, interval 1)
vi: 13144 frames presented (79.5 fps over the last 5.0 s, interval 1)
vi: 13548 frames presented (80.6 fps over the last 5.0 s, interval 1)
--- pr-g2 (longshot 9f0dd23), the controller going and coming back
vi: 12349 frames presented (79.7 fps over the last 5.0 s, interval 1)
vi: 12749 frames presented (80.0 fps over the last 5.0 s, interval 1)
vi: 13152 frames presented (80.6 fps over the last 5.0 s, interval 1)
--- main-p1 (longshot ef6038a), the pause menu's System page
vi: 11498 frames presented (219.7 fps over the last 5.0 s, interval 1)
vi: 12592 frames presented (218.8 fps over the last 5.0 s, interval 1)
vi: 13624 frames presented (206.3 fps over the last 5.0 s, interval 1)
vi: 14703 frames presented (215.7 fps over the last 5.0 s, interval 1)
vi: 15799 frames presented (219.2 fps over the last 5.0 s, interval 1)
vi: 16895 frames presented (219.2 fps over the last 5.0 s, interval 1)
vi: 17992 frames presented (219.4 fps over the last 5.0 s, interval 1)
vi: 19090 frames presented (219.5 fps over the last 5.0 s, interval 1)
vi: 20188 frames presented (219.5 fps over the last 5.0 s, interval 1)
vi: 21285 frames presented (219.2 fps over the last 5.0 s, interval 1)
vi: 22383 frames presented (219.5 fps over the last 5.0 s, interval 1)
vi: 23485 frames presented (220.2 fps over the last 5.0 s, interval 1)
vi: 24584 frames presented (219.7 fps over the last 5.0 s, interval 1)
--- pr-p1 (longshot ad35f3b), the pause menu's System page
vi: 13312 frames presented (220.7 fps over the last 5.0 s, interval 1)
vi: 14418 frames presented (221.0 fps over the last 5.0 s, interval 1)
vi: 15525 frames presented (221.3 fps over the last 5.0 s, interval 1)
vi: 16631 frames presented (221.0 fps over the last 5.0 s, interval 1)
vi: 17739 frames presented (221.6 fps over the last 5.0 s, interval 1)
vi: 18843 frames presented (220.7 fps over the last 5.0 s, interval 1)
vi: 19951 frames presented (221.5 fps over the last 5.0 s, interval 1)
vi: 21056 frames presented (220.9 fps over the last 5.0 s, interval 1)
vi: 22160 frames presented (220.6 fps over the last 5.0 s, interval 1)
vi: 23263 frames presented (220.4 fps over the last 5.0 s, interval 1)
vi: 24368 frames presented (220.9 fps over the last 5.0 s, interval 1)
vi: 25471 frames presented (220.6 fps over the last 5.0 s, interval 1)
--- main-p2 (longshot ef6038a), the pause menu's System page
vi: 13139 frames presented (221.8 fps over the last 5.0 s, interval 1)
vi: 14244 frames presented (221.0 fps over the last 5.0 s, interval 1)
vi: 15350 frames presented (221.1 fps over the last 5.0 s, interval 1)
vi: 16457 frames presented (221.3 fps over the last 5.0 s, interval 1)
vi: 17561 frames presented (220.7 fps over the last 5.0 s, interval 1)
vi: 18667 frames presented (221.0 fps over the last 5.0 s, interval 1)
vi: 19774 frames presented (221.3 fps over the last 5.0 s, interval 1)
vi: 20884 frames presented (221.8 fps over the last 5.0 s, interval 1)
vi: 21988 frames presented (220.6 fps over the last 5.0 s, interval 1)
vi: 23093 frames presented (220.9 fps over the last 5.0 s, interval 1)
vi: 24201 frames presented (221.5 fps over the last 5.0 s, interval 1)
vi: 25306 frames presented (220.9 fps over the last 5.0 s, interval 1)
--- pr-p2 (longshot ad35f3b), the pause menu's System page
vi: 11419 frames presented (218.2 fps over the last 5.0 s, interval 1)
vi: 12526 frames presented (221.2 fps over the last 5.0 s, interval 1)
vi: 13634 frames presented (221.5 fps over the last 5.0 s, interval 1)
vi: 14740 frames presented (221.2 fps over the last 5.0 s, interval 1)
vi: 15849 frames presented (221.6 fps over the last 5.0 s, interval 1)
vi: 16951 frames presented (220.4 fps over the last 5.0 s, interval 1)
vi: 18059 frames presented (221.6 fps over the last 5.0 s, interval 1)
vi: 19169 frames presented (221.8 fps over the last 5.0 s, interval 1)
vi: 20278 frames presented (221.6 fps over the last 5.0 s, interval 1)
vi: 21385 frames presented (221.3 fps over the last 5.0 s, interval 1)
vi: 22495 frames presented (222.0 fps over the last 5.0 s, interval 1)
vi: 23602 frames presented (221.2 fps over the last 5.0 s, interval 1)
vi: 24711 frames presented (221.7 fps over the last 5.0 s, interval 1)

Flags and settings

Two new switches, no menu row (HOS_HEADLESS, HOS_WINDOW_NOACTIVATE, HOS_INPUT_BACKGROUND and HOS_MENU_TRACE in the diff are existing ones, only read).

Flag What it is Before this PR After this PR Effect Helps / doesn't help / untested Recommendation
HOS_PAD_NOTICE=0 Turns the notices off (none) Unset: the notices are on No battery is read; no notices, no battery lines in the log, no controller named on the pause menu Unset and =0: run in the game On by default (unset)
HOS_PAD_BATTERY_TEST=<percent>[,xbox|switch|sony][,plugged] Reads every controller as on its battery at that level, as that kind of controller when one is named; plugged reads it as plugged in (none) Unset Shows the warnings without running a battery down, and another kind of controller's rules without having one 5, 15, 40,xbox and 0,switch: run in the game; plugged: the game-free test only Off: for testing only

Testing

Tested:

  • Game-free, Ubuntu 26.04, gcc 15.2: python -I -B tests/run_all.py: 639 passed, 37 failed, 96 skipped (on ad35f3b: this PR on main ef6038a, one main commit before its head now; the
    checks this PR adds or changes ran again on the head and pass). main ef6038a on
    that PC: 637 passed and the same 37 failed (test_bug_report, test_bug_report_defaults,
    test_compute_warm_apart, test_cpu_report, test_crash_groups, test_crt_options, test_damage_debug_menu,
    test_dev_packs, test_display_startup_failure, test_dlss_feature_size, test_failed_compile_keeps_objects,
    test_guest_imported, test_hardware_report, test_hud_layout_row, test_invalidate_quick,
    test_invalidate_vcore, test_libc_hooks, test_linux_preflight, test_linux_pressure, test_linux_update,
    test_log_open_failure, test_mirror_budget, test_missing_nup, test_mods_size_table,
    test_pending_guest_import, test_pipeline_play_cache, test_present_thread, test_profiling_mode,
    test_psychov35_fsr3_fg, test_readback_timeout_source, test_run_all_changed, test_slow_frames,
    test_switch_table, test_target_image_pool, test_upscaler_rows, test_vcore_escape, test_walk_key).
  • The Windows game cross-built on Linux (RX_TARGET=windows, llvm-mingw 20261104), main and this PR.
  • The whole game built for Linux at ad35f3b (scripts/dev_build.py build --quick, Ubuntu 26.04, tools.lock's tools):
    longshot and longshot_vk.so compile and link. Not run there: that PC has no GPU.
  • In the game on 9f0dd23, Windows 11, RTX 4090 (driver 621.24), one DualSense over Bluetooth on its battery, SDL 3.4.20,
    4K: nothing shown at launch, each notice over the game, the low and very low ones over the open Insert menu, German
    at the Large menu size, an Xbox and a Switch controller simulated (HOS_PAD_BATTERY_TEST=40,xbox and 0,switch:
    the warning with no number), and no notice with HOS_PAD_NOTICE=0 (that the pause menu then names no controller is
    covered by the game-free test only). The low and very low warnings came from
    HOS_PAD_BATTERY_TEST; connecting and disconnecting from switching the controller's device off and on in Windows.
  • The pause menu's line, the same run: on the System page with another of its buttons chosen; gone on the Load screen
    opened from it and back on return; gone on the Items page and back; gone under the Insert menu; gone with the
    controller disconnected and back with it; gone with the menu closed and there when it opens again on that page;
    15% and an Xbox controller's name alone from HOS_PAD_BATTERY_TEST. The presses were sent with HOS_INPUT_LIVE.
  • After the rebase, on ad35f3b, the same PC with its screen switched off (a capture of the desktop is black then): the
    same presses, the log saying the System page in front and no longer in front at each step, and the page as the game
    itself writes it (headless, RX_VK_SHOTS with RX_VK_SHOT_MENU=1): the line with its bolt, the controller then on
    its charger at 100% (third picture below).
  • In the game on earlier builds of this change: the controller on its charger (read as plugged in, its battery at 100%), several notices one after another, and a notice that came up behind another window still there on coming
    back.

Not tested:

  • A real battery falling through 20% and 10% during play, a controller switching itself off, and a cable plugged in
    and pulled on purpose.
  • Any real Xbox, Switch or other controller, two controllers at once, SDL2, and the XInput path on hardware: their
    rules are covered by the game-free test, from SDL 3.4's source, and the Xbox and Switch notices by the simulation.
  • A run on Linux (it builds there, whole), the Steam Deck, and Steam Input: where a controller's driver reports no
    battery there, the code gives the connected and disconnected notices alone, by the game-free test. Also the pause menu's line on a screen that is not
    16:9, and in the game's other languages (the line itself is a name and a number).
  • The translations were written with AI help and not checked by native speakers.

Must be tested: None. No further run is asked for before merge; what was not run is listed under Not tested.

Screenshots

Before: main @ 544229a · After: this PR @ 9f0dd23. The same save, the same spot, 3840x2160. The battery levels are set with HOS_PAD_BATTERY_TEST; the Xbox and Switch controllers are simulated with it on the DualSense. The third picture is the rebased build's (ad35f3b), written by the game itself at 1920x1080 with the screen off.

Controller notices over the game: before and after

The controller on the pause menu (before and after), a notice over the Insert menu, and the caveat

After the rebase: the System page with the controller on its charger, the bolt before its battery

Risks

What could break: a controller that misreports its battery gets a warning it should not; a virtual controller that
reconnects by itself would be announced each time; the pause menu's line reads the game's own menu objects each frame
that page shows (as the mouse in the game's menus does), so a game version they do not fit shows no line.
Cost: none measured. In play a frame asks the host once more (two reads). On the System page the line's reads and
drawing are there every frame: 220.9 / 221.5 fps against main's 219.4 / 221.05 on that page (within the spread between runs).
Turning it off: HOS_PAD_NOTICE=0.
Compatibility: MKWVK_API_VERSION is 34: the game and its renderer must come from the same build, as before. Saves,
longshot_options.ini and the caches are not touched.

Checklist

Everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description) of the status line's type.
  • Why gives the reason plainly and links the issues that fit (the tracker searched).
  • Tested on my own PC where it runs (in the game, for a change the game runs), as Testing's Tested says; what
    can't be run by hand is in Testing's Not testable by hand, with why.
  • Measurements has a verdict, or one line saying why there is nothing to measure.
  • Nothing gets worse that I know of: any cost (speed, latency, memory, a setup that worked before) is measured and
    in Risks. (The pause menu's System page is measured now: Measurements' table and Risks' Cost.)
  • Testing names what was tested, what wasn't, and what must still be tested, where and how.
  • Rebased on current main. (main @ 413d63e)
  • python -I -B tests/run_all.py passes (any failure that also fails on main is named).
  • No game files, dumps, build output or generated files.
  • third_party/ untouched (a new folder with a PROVENANCE.md instead).
  • The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled.

When it applies

  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.
  • Numbers from the same PC, scene and settings, at least 2 interleaved runs each, the median reported.
  • Switches documented (docs/development.md; the README for a menu row) and shipped at their recommended value.
  • Screenshots of the same spot, captioned like the Measurements columns, for a change that shows on screen.
  • A file in docs/tested/ for each new measured run (format in docs/tested-configurations.md).
  • MKWVK_API_VERSION bumped (gpu/vk/vk_api.h's MkwVkHost or MkwVkRenderer changed).
  • A check under tests/ that reads changed source updated in this PR, not weakened.
  • Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths. (Windows: the whole game cross-built. Linux: the whole game built with scripts/dev_build.py build --quick. No path code changed.)
  • Docs updated.

🤖 Generated with Claude Code

**Type:** feat · **Risk:** low · **Tested on:** Windows 11, RTX 4090 (621.24), a DualSense over Bluetooth · **Needs:** none ## TL;DR A controller that ran out of battery just stopped answering, and nothing on screen said why. Longshot now shows a short notice when a controller's battery is low, when it is very low, when a controller disconnects and when one connects, and the pause menu's System page names the controller with its battery percentage. Checked in the game on Windows with a DualSense, with new game-free tests, and against main: no frame-rate cost measured (about 80 fps in play and 220 on the pause page, with and without it). ## Breakdown - **Who it helps:** anyone playing with a wireless controller, most of all a DualSense or DualShock 4, which report a real percentage. - **What was wrong:** the game never asks for a controller's battery (on the console the system shows it), and Longshot had nothing in its place. - **What changes:** notices at the top of the screen for a low battery, a very low one, a disconnect and a connect, and the controller's name and battery on the pause menu's System page. - **What does not change:** how controllers are read and bound, saves, settings and caches; `HOS_PAD_NOTICE=0` turns all of it off. - **How it was checked:** in the game on Windows 11 with a DualSense (every notice, the pause menu's line through its pages), two new game-free tests, and frame rate against main: within the spread in play and on the pause page. - **What is still open:** nothing is asked for before merge. Not run: a real Xbox or Switch controller (simulated here), Linux and the Steam Deck (it builds for Linux), a battery actually running down, screens that are not 16:9. - **Risk:** low: a controller that misreports its battery could get a warning it should not, and a game version the menu hooks do not fit shows no line on the pause menu. ## Why A controller that runs out of battery just stops answering, and nothing on screen says why. The game never asks for a controller's battery: on the console the system shows the low-battery notice and the controller screen, and Longshot had nothing in their place. No issue asks for this (tracker searched: battery, disconnect, controller connected). ## What changed Longshot now shows a short notice at the top of the screen, in the menu's style and language, when a controller's battery gets low, when it gets very low, when a controller disconnects (saying if its battery was low) and when one connects during play. Each shows for 6 to 12 seconds; the game is not paused. The game's own pause menu names the controller on its System page, under the controller picture of "Basic Controls", with its battery percentage when it reports a measured one (a DualSense or DualShock 4) and a bolt while it is plugged in. A controller that reports no battery gets only the connected and disconnected notices, and under Steam Input that is the case whenever the game is given only Steam's stand-in controller. - rules: `host/pad_battery.h` (pure). Low and very low follow what each controller reports through SDL: DualSense and DualShock 4 count in tenths (20% and 10%, the number shown); Xbox controllers warn at 40% and 10% and Switch controllers at 25% and 0%, with no number shown (SDL gives them as four and five levels); SDL2 and XInput give four steps. Each warning shows once as the battery falls. No new warning while the controller is plugged in, and one on screen goes after five readings plugged in (about 5 s through SDL, about 25 s through XInput). - host: `host/pad_battery.c` keeps a queue of notices: a new one replaces the same controller's earlier ones; otherwise the one on screen plays out, then the most urgent waiting one. A notice's time counts only while the player can be looking: the game's window in front (or an overlay over it), or the controllers set to count in the background. `pads_poll` (`host/pad_sdl.c`, once a second, through the new `hos_sdl_pad_power`) and, only when SDL's controller support is not there, `pads_read` (`host/nn_hid.c`, XInput) report controllers to it. - the pause menu's line: `host/oot_menu.c` finds the System page in front from the game's own menu hooks, on Windows and Linux (one of the page's panes took the focus last, and its screen still updates); `host/hos_wide_ui.c` notes the pane that shows the page's panel as it is placed and reads where it is when asked, so the line slides in with the page. It hides on the other pages, under a screen opened from the page (Load, Options), under the Insert menu and when the menu closes. - renderer: `MkwVkHost.pad_notice` and `pad_status` (`MKWVK_API_VERSION` 34); `draw_pad_notice` and `draw_pad_status` in `gpu/vk/vk_menu.cpp`; the notice's five texts in each menu language (`gpu/vk/menu_i18n.h`). - tests: `tests/test_pad_battery.py` and `tests/test_pad_panel.py` (new); `test_fps_overlay_order.py`, `test_pads_after_menu.py` and `test_hold_toggle.py` updated for the changed functions. - docs: the README's controller section, `docs/development.md`, and the guide-image review note. Limits: - No battery reading, so no battery warning: Steam Input's stand-in controllers, the Steam Deck's built-in controls, and controllers SDL reads through the plain Linux joystick driver. The log says so once. - XInput controllers are reported only when SDL's controller support is not running. - A controller SDL first lists more than about 2 s after the game starts is announced as connected. - With several controllers, the pause menu names the first one. - The pause menu's line needs the supported game version's hooks (those the mouse in the game's menus uses); on a wider screen than 16:9 its place follows the menus' fit but was not looked at. - At the Large menu size, a long help text reaches up under the banner, and the notice covers the help box's title for the seconds it shows (second sheet below). ## Measurements **Verdict:** it works in the game (screenshots below), and no frame-rate cost was measured: standing still with no notice, main 80.2 / 80.0 fps, this PR 80.5 / 80.6, this PR with the notices off 80.9 / 80.75; on the pause menu's System page, where the controller's line is drawn, main 219.4 / 221.05 fps, this PR 220.9 / 221.5. Through the controller going and coming back, with the disconnected and then the connected notice shown, the six 5 s readings are 79.3 to 80.6 fps on main (median 79.55) and 79.5 to 80.6 here (median 79.85): no difference beyond the noise of so few samples, and the readings cover more than the notices themselves. Hardware: Windows 11, RTX 4090 24 GB, driver 621.24, Core i9-10900K, 32 GB Scene: the village, by its gate, daytime, standing still where the save loads; 3840x2160, DLAA, frame generation off, no frame rate cap, V-Sync off, HDR off (read back from each run's log) Method: the `vi:` lines of `longshot_log.txt` (fps over 5 s). Standing still: 60 s from 25 s after the save loaded, main, this PR and this PR with the switch in turn, twice, after a warm-up launch of each build; the median of each run's 12 lines. The controller going and coming back: its device switched off in Windows, 5 s, switched on, 6 s, main and this PR in turn, twice; the three lines that end in that time (each covers 5 s, so they reach back before the disconnect). The System page: the pause menu opened on it, 60 s from 6 s after, main and this PR in turn, twice, after a warm-up of each How to reproduce: load a save standing still with a controller connected, the settings above, and read the log's `vi:` lines; `HOS_PAD_NOTICE=0` in `longshot_env.txt` for the third column Commits: the standing-still and reconnect rows and the sheets are from 9f0dd23, this PR's code commit as it was on main 544229a (its builds named themselves 3938f4c). Rebased since: the two interface members now follow main's newer ones, so the version is 34, not 30; nothing else in the change differs, so those were not taken again. The System page row, the checks and the builds are from that rebase on main ef6038a (its builds named themselves ad35f3b). The head now (a1a3ff6, code bc175f4) is the same change on main 413d63e, one commit further, which touches only the opt-in Tracy profiler build | | Before: main @ 544229a | After: this PR @ 9f0dd23 | After, HOS_PAD_NOTICE=0: this PR @ 9f0dd23 | |---|---|---|---| | fps standing still, no notice on screen: median (run 1 / run 2) | 80.2 / 80.0 | 80.5 / 80.6 | 80.9 / 80.75 | | fps through the controller going and coming back (run 1; run 2) | 79.3, 79.5, 80.4; 79.6, 79.5, 80.6 | 79.5, 79.7, 80.5; 79.7, 80.0, 80.6 (the disconnected, then the connected notice shown) | not measured | | fps on the pause menu's System page (run 1 / run 2; main @ ef6038a, this PR @ ad35f3b) | 219.4 / 221.05 | 220.9 / 221.5, the controller's line drawn | not measured | | A controller disconnects or connects | nothing shown | a notice each | nothing shown | | Its battery low or very low (from `HOS_PAD_BATTERY_TEST`; its own reading was 85%, on its battery) | nothing shown | a notice each | nothing shown | | The pause menu's System page | no controller named | `DualSense Wireless Controller: 85%` under the controller picture | no controller named | <details><summary>The log lines</summary> ``` --- main-1 (longshot 544229a), standing still vi: 12150 frames presented (80.0 fps over the last 5.0 s, interval 1) vi: 12552 frames presented (80.3 fps over the last 5.0 s, interval 1) vi: 12953 frames presented (80.1 fps over the last 5.0 s, interval 1) vi: 13356 frames presented (80.5 fps over the last 5.0 s, interval 1) vi: 13758 frames presented (80.3 fps over the last 5.0 s, interval 1) vi: 14159 frames presented (80.1 fps over the last 5.0 s, interval 1) vi: 14561 frames presented (80.2 fps over the last 5.0 s, interval 1) vi: 14963 frames presented (80.3 fps over the last 5.0 s, interval 1) vi: 15361 frames presented (79.5 fps over the last 5.0 s, interval 1) vi: 15762 frames presented (80.2 fps over the last 5.0 s, interval 1) vi: 16164 frames presented (80.2 fps over the last 5.0 s, interval 1) vi: 16566 frames presented (80.3 fps over the last 5.0 s, interval 1) --- pr-1 (longshot 9f0dd23), standing still vi: 12410 frames presented (80.1 fps over the last 5.0 s, interval 1) vi: 12812 frames presented (80.4 fps over the last 5.0 s, interval 1) vi: 13215 frames presented (80.5 fps over the last 5.0 s, interval 1) vi: 13618 frames presented (80.5 fps over the last 5.0 s, interval 1) vi: 14020 frames presented (80.4 fps over the last 5.0 s, interval 1) vi: 14424 frames presented (80.6 fps over the last 5.0 s, interval 1) vi: 14828 frames presented (80.6 fps over the last 5.0 s, interval 1) vi: 15231 frames presented (80.5 fps over the last 5.0 s, interval 1) vi: 15633 frames presented (80.3 fps over the last 5.0 s, interval 1) vi: 16038 frames presented (80.8 fps over the last 5.0 s, interval 1) vi: 16442 frames presented (80.7 fps over the last 5.0 s, interval 1) vi: 16844 frames presented (80.2 fps over the last 5.0 s, interval 1) --- off-1 (longshot 9f0dd23, HOS_PAD_NOTICE=0), standing still vi: 11830 frames presented (80.7 fps over the last 5.0 s, interval 1) vi: 12234 frames presented (80.8 fps over the last 5.0 s, interval 1) vi: 12639 frames presented (80.9 fps over the last 5.0 s, interval 1) vi: 13043 frames presented (80.8 fps over the last 5.0 s, interval 1) vi: 13449 frames presented (81.2 fps over the last 5.0 s, interval 1) vi: 13854 frames presented (80.8 fps over the last 5.0 s, interval 1) vi: 14258 frames presented (80.8 fps over the last 5.0 s, interval 1) vi: 14663 frames presented (80.9 fps over the last 5.0 s, interval 1) vi: 15069 frames presented (81.1 fps over the last 5.0 s, interval 1) vi: 15475 frames presented (81.1 fps over the last 5.0 s, interval 1) vi: 15881 frames presented (81.1 fps over the last 5.0 s, interval 1) vi: 16287 frames presented (81.0 fps over the last 5.0 s, interval 1) --- main-2 (longshot 544229a), standing still vi: 11131 frames presented (80.0 fps over the last 5.0 s, interval 1) vi: 11529 frames presented (79.6 fps over the last 5.0 s, interval 1) vi: 11929 frames presented (79.9 fps over the last 5.0 s, interval 1) vi: 12330 frames presented (80.2 fps over the last 5.0 s, interval 1) vi: 12732 frames presented (80.2 fps over the last 5.0 s, interval 1) vi: 13132 frames presented (80.0 fps over the last 5.0 s, interval 1) vi: 13533 frames presented (80.1 fps over the last 5.0 s, interval 1) vi: 13933 frames presented (79.8 fps over the last 5.0 s, interval 1) vi: 14335 frames presented (80.3 fps over the last 5.0 s, interval 1) vi: 14737 frames presented (80.3 fps over the last 5.0 s, interval 1) vi: 15138 frames presented (80.0 fps over the last 5.0 s, interval 1) vi: 15536 frames presented (79.5 fps over the last 5.0 s, interval 1) --- pr-2 (longshot 9f0dd23), standing still vi: 11503 frames presented (80.5 fps over the last 5.0 s, interval 1) vi: 11904 frames presented (80.1 fps over the last 5.0 s, interval 1) vi: 12307 frames presented (80.6 fps over the last 5.0 s, interval 1) vi: 12711 frames presented (80.6 fps over the last 5.0 s, interval 1) vi: 13116 frames presented (80.8 fps over the last 5.0 s, interval 1) vi: 13519 frames presented (80.5 fps over the last 5.0 s, interval 1) vi: 13922 frames presented (80.6 fps over the last 5.0 s, interval 1) vi: 14325 frames presented (80.5 fps over the last 5.0 s, interval 1) vi: 14729 frames presented (80.7 fps over the last 5.0 s, interval 1) vi: 15132 frames presented (80.6 fps over the last 5.0 s, interval 1) vi: 15536 frames presented (80.6 fps over the last 5.0 s, interval 1) vi: 15939 frames presented (80.5 fps over the last 5.0 s, interval 1) --- off-2 (longshot 9f0dd23, HOS_PAD_NOTICE=0), standing still vi: 12021 frames presented (80.5 fps over the last 5.0 s, interval 1) vi: 12423 frames presented (80.3 fps over the last 5.0 s, interval 1) vi: 12827 frames presented (80.7 fps over the last 5.0 s, interval 1) vi: 13232 frames presented (80.9 fps over the last 5.0 s, interval 1) vi: 13637 frames presented (80.9 fps over the last 5.0 s, interval 1) vi: 14042 frames presented (80.9 fps over the last 5.0 s, interval 1) vi: 14447 frames presented (80.8 fps over the last 5.0 s, interval 1) vi: 14852 frames presented (81.0 fps over the last 5.0 s, interval 1) vi: 15253 frames presented (80.0 fps over the last 5.0 s, interval 1) vi: 15657 frames presented (80.6 fps over the last 5.0 s, interval 1) vi: 16062 frames presented (80.8 fps over the last 5.0 s, interval 1) vi: 16465 frames presented (80.4 fps over the last 5.0 s, interval 1) --- main-g1 (longshot 544229a), the controller going and coming back vi: 12539 frames presented (79.3 fps over the last 5.0 s, interval 1) vi: 12937 frames presented (79.5 fps over the last 5.0 s, interval 1) vi: 13340 frames presented (80.4 fps over the last 5.0 s, interval 1) --- pr-g1 (longshot 9f0dd23), the controller going and coming back vi: 12890 frames presented (79.5 fps over the last 5.0 s, interval 1) vi: 13289 frames presented (79.7 fps over the last 5.0 s, interval 1) vi: 13692 frames presented (80.5 fps over the last 5.0 s, interval 1) --- main-g2 (longshot 544229a), the controller going and coming back vi: 12746 frames presented (79.6 fps over the last 5.0 s, interval 1) vi: 13144 frames presented (79.5 fps over the last 5.0 s, interval 1) vi: 13548 frames presented (80.6 fps over the last 5.0 s, interval 1) --- pr-g2 (longshot 9f0dd23), the controller going and coming back vi: 12349 frames presented (79.7 fps over the last 5.0 s, interval 1) vi: 12749 frames presented (80.0 fps over the last 5.0 s, interval 1) vi: 13152 frames presented (80.6 fps over the last 5.0 s, interval 1) --- main-p1 (longshot ef6038a), the pause menu's System page vi: 11498 frames presented (219.7 fps over the last 5.0 s, interval 1) vi: 12592 frames presented (218.8 fps over the last 5.0 s, interval 1) vi: 13624 frames presented (206.3 fps over the last 5.0 s, interval 1) vi: 14703 frames presented (215.7 fps over the last 5.0 s, interval 1) vi: 15799 frames presented (219.2 fps over the last 5.0 s, interval 1) vi: 16895 frames presented (219.2 fps over the last 5.0 s, interval 1) vi: 17992 frames presented (219.4 fps over the last 5.0 s, interval 1) vi: 19090 frames presented (219.5 fps over the last 5.0 s, interval 1) vi: 20188 frames presented (219.5 fps over the last 5.0 s, interval 1) vi: 21285 frames presented (219.2 fps over the last 5.0 s, interval 1) vi: 22383 frames presented (219.5 fps over the last 5.0 s, interval 1) vi: 23485 frames presented (220.2 fps over the last 5.0 s, interval 1) vi: 24584 frames presented (219.7 fps over the last 5.0 s, interval 1) --- pr-p1 (longshot ad35f3b), the pause menu's System page vi: 13312 frames presented (220.7 fps over the last 5.0 s, interval 1) vi: 14418 frames presented (221.0 fps over the last 5.0 s, interval 1) vi: 15525 frames presented (221.3 fps over the last 5.0 s, interval 1) vi: 16631 frames presented (221.0 fps over the last 5.0 s, interval 1) vi: 17739 frames presented (221.6 fps over the last 5.0 s, interval 1) vi: 18843 frames presented (220.7 fps over the last 5.0 s, interval 1) vi: 19951 frames presented (221.5 fps over the last 5.0 s, interval 1) vi: 21056 frames presented (220.9 fps over the last 5.0 s, interval 1) vi: 22160 frames presented (220.6 fps over the last 5.0 s, interval 1) vi: 23263 frames presented (220.4 fps over the last 5.0 s, interval 1) vi: 24368 frames presented (220.9 fps over the last 5.0 s, interval 1) vi: 25471 frames presented (220.6 fps over the last 5.0 s, interval 1) --- main-p2 (longshot ef6038a), the pause menu's System page vi: 13139 frames presented (221.8 fps over the last 5.0 s, interval 1) vi: 14244 frames presented (221.0 fps over the last 5.0 s, interval 1) vi: 15350 frames presented (221.1 fps over the last 5.0 s, interval 1) vi: 16457 frames presented (221.3 fps over the last 5.0 s, interval 1) vi: 17561 frames presented (220.7 fps over the last 5.0 s, interval 1) vi: 18667 frames presented (221.0 fps over the last 5.0 s, interval 1) vi: 19774 frames presented (221.3 fps over the last 5.0 s, interval 1) vi: 20884 frames presented (221.8 fps over the last 5.0 s, interval 1) vi: 21988 frames presented (220.6 fps over the last 5.0 s, interval 1) vi: 23093 frames presented (220.9 fps over the last 5.0 s, interval 1) vi: 24201 frames presented (221.5 fps over the last 5.0 s, interval 1) vi: 25306 frames presented (220.9 fps over the last 5.0 s, interval 1) --- pr-p2 (longshot ad35f3b), the pause menu's System page vi: 11419 frames presented (218.2 fps over the last 5.0 s, interval 1) vi: 12526 frames presented (221.2 fps over the last 5.0 s, interval 1) vi: 13634 frames presented (221.5 fps over the last 5.0 s, interval 1) vi: 14740 frames presented (221.2 fps over the last 5.0 s, interval 1) vi: 15849 frames presented (221.6 fps over the last 5.0 s, interval 1) vi: 16951 frames presented (220.4 fps over the last 5.0 s, interval 1) vi: 18059 frames presented (221.6 fps over the last 5.0 s, interval 1) vi: 19169 frames presented (221.8 fps over the last 5.0 s, interval 1) vi: 20278 frames presented (221.6 fps over the last 5.0 s, interval 1) vi: 21385 frames presented (221.3 fps over the last 5.0 s, interval 1) vi: 22495 frames presented (222.0 fps over the last 5.0 s, interval 1) vi: 23602 frames presented (221.2 fps over the last 5.0 s, interval 1) vi: 24711 frames presented (221.7 fps over the last 5.0 s, interval 1) ``` </details> ### Flags and settings Two new switches, no menu row (`HOS_HEADLESS`, `HOS_WINDOW_NOACTIVATE`, `HOS_INPUT_BACKGROUND` and `HOS_MENU_TRACE` in the diff are existing ones, only read). | Flag | What it is | Before this PR | After this PR | Effect | Helps / doesn't help / untested | Recommendation | |---|---|---|---|---|---|---| | `HOS_PAD_NOTICE=0` | Turns the notices off | (none) | Unset: the notices are on | No battery is read; no notices, no battery lines in the log, no controller named on the pause menu | Unset and `=0`: run in the game | On by default (unset) | | `HOS_PAD_BATTERY_TEST=<percent>[,xbox\|switch\|sony][,plugged]` | Reads every controller as on its battery at that level, as that kind of controller when one is named; `plugged` reads it as plugged in | (none) | Unset | Shows the warnings without running a battery down, and another kind of controller's rules without having one | `5`, `15`, `40,xbox` and `0,switch`: run in the game; `plugged`: the game-free test only | Off: for testing only | ## Testing **Tested:** - Game-free, Ubuntu 26.04, gcc 15.2: `python -I -B tests/run_all.py`: 639 passed, 37 failed, 96 skipped (on ad35f3b: this PR on main ef6038a, one main commit before its head now; the checks this PR adds or changes ran again on the head and pass). main ef6038a on that PC: 637 passed and the same 37 failed (`test_bug_report`, `test_bug_report_defaults`, `test_compute_warm_apart`, `test_cpu_report`, `test_crash_groups`, `test_crt_options`, `test_damage_debug_menu`, `test_dev_packs`, `test_display_startup_failure`, `test_dlss_feature_size`, `test_failed_compile_keeps_objects`, `test_guest_imported`, `test_hardware_report`, `test_hud_layout_row`, `test_invalidate_quick`, `test_invalidate_vcore`, `test_libc_hooks`, `test_linux_preflight`, `test_linux_pressure`, `test_linux_update`, `test_log_open_failure`, `test_mirror_budget`, `test_missing_nup`, `test_mods_size_table`, `test_pending_guest_import`, `test_pipeline_play_cache`, `test_present_thread`, `test_profiling_mode`, `test_psychov35_fsr3_fg`, `test_readback_timeout_source`, `test_run_all_changed`, `test_slow_frames`, `test_switch_table`, `test_target_image_pool`, `test_upscaler_rows`, `test_vcore_escape`, `test_walk_key`). - The Windows game cross-built on Linux (`RX_TARGET=windows`, llvm-mingw 20261104), main and this PR. - The whole game built for Linux at ad35f3b (`scripts/dev_build.py build --quick`, Ubuntu 26.04, tools.lock's tools): `longshot` and `longshot_vk.so` compile and link. Not run there: that PC has no GPU. - In the game on 9f0dd23, Windows 11, RTX 4090 (driver 621.24), one DualSense over Bluetooth on its battery, SDL 3.4.20, 4K: nothing shown at launch, each notice over the game, the low and very low ones over the open Insert menu, German at the Large menu size, an Xbox and a Switch controller simulated (`HOS_PAD_BATTERY_TEST=40,xbox` and `0,switch`: the warning with no number), and no notice with `HOS_PAD_NOTICE=0` (that the pause menu then names no controller is covered by the game-free test only). The low and very low warnings came from `HOS_PAD_BATTERY_TEST`; connecting and disconnecting from switching the controller's device off and on in Windows. - The pause menu's line, the same run: on the System page with another of its buttons chosen; gone on the Load screen opened from it and back on return; gone on the Items page and back; gone under the Insert menu; gone with the controller disconnected and back with it; gone with the menu closed and there when it opens again on that page; `15%` and an Xbox controller's name alone from `HOS_PAD_BATTERY_TEST`. The presses were sent with `HOS_INPUT_LIVE`. - After the rebase, on ad35f3b, the same PC with its screen switched off (a capture of the desktop is black then): the same presses, the log saying the System page in front and no longer in front at each step, and the page as the game itself writes it (headless, `RX_VK_SHOTS` with `RX_VK_SHOT_MENU=1`): the line with its bolt, the controller then on its charger at 100% (third picture below). - In the game on earlier builds of this change: the controller on its charger (read as `plugged in, its battery at 100%`), several notices one after another, and a notice that came up behind another window still there on coming back. **Not tested:** - A real battery falling through 20% and 10% during play, a controller switching itself off, and a cable plugged in and pulled on purpose. - Any real Xbox, Switch or other controller, two controllers at once, SDL2, and the XInput path on hardware: their rules are covered by the game-free test, from SDL 3.4's source, and the Xbox and Switch notices by the simulation. - A run on Linux (it builds there, whole), the Steam Deck, and Steam Input: where a controller's driver reports no battery there, the code gives the connected and disconnected notices alone, by the game-free test. Also the pause menu's line on a screen that is not 16:9, and in the game's other languages (the line itself is a name and a number). - The translations were written with AI help and not checked by native speakers. **Must be tested:** None. No further run is asked for before merge; what was not run is listed under Not tested. ## Screenshots Before: main @ 544229a · After: this PR @ 9f0dd23. The same save, the same spot, 3840x2160. The battery levels are set with `HOS_PAD_BATTERY_TEST`; the Xbox and Switch controllers are simulated with it on the DualSense. The third picture is the rebased build's (ad35f3b), written by the game itself at 1920x1080 with the screen off. ![Controller notices over the game: before and after](https://git.magicbean.dev/attachments/6c25e31b-f671-411c-8934-25c277bdadb3) ![The controller on the pause menu (before and after), a notice over the Insert menu, and the caveat](https://git.magicbean.dev/attachments/77853f33-8ea6-42c7-9fab-5caa71530e3a) ![After the rebase: the System page with the controller on its charger, the bolt before its battery](https://git.magicbean.dev/attachments/5761dad7-a48f-4102-a76a-ddf3e9881ebb) ## Risks **What could break:** a controller that misreports its battery gets a warning it should not; a virtual controller that reconnects by itself would be announced each time; the pause menu's line reads the game's own menu objects each frame that page shows (as the mouse in the game's menus does), so a game version they do not fit shows no line. **Cost:** none measured. In play a frame asks the host once more (two reads). On the System page the line's reads and drawing are there every frame: 220.9 / 221.5 fps against main's 219.4 / 221.05 on that page (within the spread between runs). **Turning it off:** `HOS_PAD_NOTICE=0`. **Compatibility:** `MKWVK_API_VERSION` is 34: the game and its renderer must come from the same build, as before. Saves, `longshot_options.ini` and the caches are not touched. ## Checklist ### Everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`) of the status line's type. - [x] Why gives the reason plainly and links the issues that fit (the tracker searched). - [x] Tested on my own PC where it runs (in the game, for a change the game runs), as Testing's Tested says; what can't be run by hand is in Testing's Not testable by hand, with why. - [x] Measurements has a verdict, or one line saying why there is nothing to measure. - [x] Nothing gets worse that I know of: any cost (speed, latency, memory, a setup that worked before) is measured and in Risks. (The pause menu's System page is measured now: Measurements' table and Risks' Cost.) - [x] Testing names what was tested, what wasn't, and what must still be tested, where and how. - [x] Rebased on current `main`. (main @ 413d63e) - [x] `python -I -B tests/run_all.py` passes (any failure that also fails on `main` is named). - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [x] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. ### When it applies - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. - [x] Numbers from the same PC, scene and settings, at least 2 interleaved runs each, the median reported. - [x] Switches documented (docs/development.md; the README for a menu row) and shipped at their recommended value. - [x] Screenshots of the same spot, captioned like the Measurements columns, for a change that shows on screen. - [x] A file in `docs/tested/` for each new measured run (format in `docs/tested-configurations.md`). - [x] `MKWVK_API_VERSION` bumped (`gpu/vk/vk_api.h`'s `MkwVkHost` or `MkwVkRenderer` changed). - [x] A check under `tests/` that reads changed source updated in this PR, not weakened. - [x] Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths. (Windows: the whole game cross-built. Linux: the whole game built with `scripts/dev_build.py build --quick`. No path code changed.) - [x] Docs updated. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
lg added 2 commits 2026-11-16 07:51:05 +00:00
The game never asks for a controller's battery: on the console the system shows the low-battery notice and the
controller screen. Nothing stood in for it, so a controller that ran out just stopped answering.

host/pad_battery.c keeps a short queue of notices the renderer draws over the game (MkwVkHost.pad_notice, API
version 25): battery low, battery very low, disconnected (and whether the battery was low), connected. The readers
only report pads opening, their battery readings and their going: host/pad_sdl.c for SDL's pads, host/nn_hid.c for
XInput's when SDL's controller support is not there. Where low and very low lie follows what each family reports
(host/pad_battery.h). The menu's Controls screens name the controller and its battery (MkwVkHost.pad_status).
HOS_PAD_NOTICE=0 turns it all off.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
docs(tested): the controller notices' measured runs
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval waiting for a BigBean's 👍 on the request
PR description / Description follows the template (pull_request_target) Successful in 3s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
904aba71fc
Ten runs on one PC (Windows 11, RTX 4090, a DualSense over Bluetooth), main 0691f81 against this change at 0922406:
standing still with no notice (main, this change, this change with HOS_PAD_NOTICE=0, twice in turn), and the
controller going and coming back (main and this change, twice in turn).

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Author
Contributor

Tested in game: RTX 4090, driver 621.24, Windows 11, one DualSense over Bluetooth, 3840x2160: the village by its gate. Each notice showed over the game (battery low, very low, disconnected, disconnected with its battery low, connected), the low and very low ones over the open menu too; the Controls tab named the controller with 100% and the charging bolt; nothing showed with HOS_PAD_NOTICE=0. The low levels and the Xbox and Switch cases were set with HOS_PAD_BATTERY_TEST; connecting and disconnecting by switching the controller's device off and on in Windows. Run on 0922406, this branch's code commit before its last rebase over commits the game does not run (the builder and scripts).

Tested in game: RTX 4090, driver 621.24, Windows 11, one DualSense over Bluetooth, 3840x2160: the village by its gate. Each notice showed over the game (battery low, very low, disconnected, disconnected with its battery low, connected), the low and very low ones over the open menu too; the Controls tab named the controller with 100% and the charging bolt; nothing showed with HOS_PAD_NOTICE=0. The low levels and the Xbox and Switch cases were set with HOS_PAD_BATTERY_TEST; connecting and disconnecting by switching the controller's device off and on in Windows. Run on 0922406, this branch's code commit before its last rebase over commits the game does not run (the builder and scripts).
Author
Contributor

@Beanstalk on Linux: build this PR and start the game, with a controller connected if one is at hand; play a minute. Check that the build succeeds, that no controller notice shows at the start, and report the log's hid: lines about the controller (its battery reading, or "no battery reading from it so far"). A picture of the Insert menu's Controls tab, please.

@Beanstalk on the Steam Deck: start the game and play a minute with the Deck's own controls. Check that no controller notice shows over the game, and report the log's hid: lines about the controller ("no battery reading from it so far" is expected). A picture of the game, please.

@Beanstalk on Linux: build this PR and start the game, with a controller connected if one is at hand; play a minute. Check that the build succeeds, that no controller notice shows at the start, and report the log's `hid:` lines about the controller (its battery reading, or "no battery reading from it so far"). A picture of the Insert menu's Controls tab, please. @Beanstalk on the Steam Deck: start the game and play a minute with the Deck's own controls. Check that no controller notice shows over the game, and report the log's `hid:` lines about the controller ("no battery reading from it so far" is expected). A picture of the game, please.
Member

@lg only members of BigBeans can start the farm.

One of them can approve this request by reacting 👍 to it. This request was for 904aba7, and the PR has changed since (d59d240), so a 👍 no longer approves it. Comment @Beanstalk again to ask for the new commit.

@lg only members of `BigBeans` can start the farm. ~~One of them can approve this request by reacting 👍 to it.~~ This request was for `904aba7`, and the PR has changed since (`d59d240`), so a 👍 no longer approves it. Comment `@Beanstalk` again to ask for the new commit.
lg force-pushed feat/controller-notices from 904aba71fc
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval waiting for a BigBean's 👍 on the request
PR description / Description follows the template (pull_request_target) Successful in 3s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
to d59d240006
Some checks failed
beanstalk/approval changed since the request: ask again
PR description / Description follows the template (pull_request_target) Successful in 3s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
2026-11-16 17:12:40 +00:00
Compare
Author
Contributor

Rebased onto main 55e8fbd (cc194ad, d59d240). main's microphone test took interface version 25, so this change's two members now follow it and the version is 26; the two audio checks that pinned 25 and the last member are updated. The whole game now builds for Linux too (scripts/dev_build.py build --quick, Ubuntu 26.04): that box is ticked. The rebased change ran in the game again (RTX 4090, 621.24, Windows 11, a DualSense): the disconnected, connected and low notices, the Controls tab's line, and main's new Audio rows beside them. The frame-rate numbers and the two sheets are from before the rebase (main 0691f81 against 0922406), and were not taken again: the change itself is the same but for the version.

Rebased onto main 55e8fbd (cc194ad, d59d240). main's microphone test took interface version 25, so this change's two members now follow it and the version is 26; the two audio checks that pinned 25 and the last member are updated. The whole game now builds for Linux too (scripts/dev_build.py build --quick, Ubuntu 26.04): that box is ticked. The rebased change ran in the game again (RTX 4090, 621.24, Windows 11, a DualSense): the disconnected, connected and low notices, the Controls tab's line, and main's new Audio rows beside them. The frame-rate numbers and the two sheets are from before the rebase (main 0691f81 against 0922406), and were not taken again: the change itself is the same but for the version.
lg changed title from WIP: feat(input): show a notice when a controller's battery is low, when it disconnects and when it connects to feat(input): show a notice when a controller's battery is low, when it disconnects and when it connects 2026-11-16 17:12:56 +00:00
lg changed title from feat(input): show a notice when a controller's battery is low, when it disconnects and when it connects to WIP: feat(input): show a notice when a controller's battery is low, when it disconnects and when it connects 2026-11-17 05:38:10 +00:00
Author
Contributor

Back to work in progress. The controller's name and battery are moving from the Insert menu's Controls screens to the game's own pause menu: its System page, above the controller picture under "Basic Controls". The change is written and has game-free checks, but it has not run in the game yet, and the description, its pictures and its Testing section still describe the Insert menu's line. Ready again once it has run in the game and those are redone.

Back to work in progress. The controller's name and battery are moving from the Insert menu's Controls screens to the game's own pause menu: its System page, above the controller picture under "Basic Controls". The change is written and has game-free checks, but it has not run in the game yet, and the description, its pictures and its Testing section still describe the Insert menu's line. Ready again once it has run in the game and those are redone.
lg force-pushed feat/controller-notices from d59d240006
Some checks failed
beanstalk/approval changed since the request: ask again
PR description / Description follows the template (pull_request_target) Successful in 3s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
to 974550ed92
Some checks failed
beanstalk/approval changed since the request: ask again
PR description / Description follows the template (pull_request_target) Successful in 5s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
2026-11-17 07:06:17 +00:00
Compare
Author
Contributor

The controller's name and battery now show on the game's own pause menu instead of the Insert menu: on the System page, under the controller picture at the foot of the "Basic Controls" panel (it was tried under the title first: crowded). host/oot_menu.c finds that page in front from the game's menu hooks and host/hos_wide_ui.c reads where the panel is, so the line slides in with the page; it hides on the other pages, under a screen opened from the page, under the Insert menu and when the menu closes. Rebased onto main 544229a (9f0dd23, 974550e); the interface version is 30 now, after main's 29. Everything was run again on these commits on the same PC (RTX 4090, 621.24, Windows 11, a DualSense): the pictures, the frame rate (main 80.2 / 80.0 fps, this PR 80.5 / 80.6, notices off 80.9 / 80.75), the reconnect comparison and the pause menu; the run files under docs/tested/ are the new runs'. It builds whole for Windows and Linux.

The controller's name and battery now show on the game's own pause menu instead of the Insert menu: on the System page, under the controller picture at the foot of the "Basic Controls" panel (it was tried under the title first: crowded). host/oot_menu.c finds that page in front from the game's menu hooks and host/hos_wide_ui.c reads where the panel is, so the line slides in with the page; it hides on the other pages, under a screen opened from the page, under the Insert menu and when the menu closes. Rebased onto main 544229a (9f0dd23, 974550e); the interface version is 30 now, after main's 29. Everything was run again on these commits on the same PC (RTX 4090, 621.24, Windows 11, a DualSense): the pictures, the frame rate (main 80.2 / 80.0 fps, this PR 80.5 / 80.6, notices off 80.9 / 80.75), the reconnect comparison and the pause menu; the run files under docs/tested/ are the new runs'. It builds whole for Windows and Linux.
lg changed title from WIP: feat(input): show a notice when a controller's battery is low, when it disconnects and when it connects to feat(input): show a notice when a controller's battery is low, when it disconnects and when it connects 2026-11-17 07:06:47 +00:00
TrashPanda left a comment

A controller's low battery, a disconnect and a connect show a short notice, and the pause menu's System page names the controller. I read head 974550ed. It applies onto current main. Unset, the notices are on. HOS_PAD_NOTICE=0 reads no battery and names no controller. The page is found from the menu hooks, and a pointer outside the guest window is not followed. MKWVK_API_VERSION goes from 29 to 30 for pad_notice and pad_status. #1034 and #1358 also take 30, so whichever lands second renumbers. The notice strings sit beside #1318 and #1349: keep all of them.

On Windows a DualSense showed each notice, and standing still stayed at about 80 fps. An Xbox controller, a Switch controller, a Linux DualSense, and the Deck's own controls are still open. The earlier farm ask was for an older commit and never started.

A controller's low battery, a disconnect and a connect show a short notice, and the pause menu's System page names the controller. I read head `974550ed`. It applies onto current main. Unset, the notices are on. `HOS_PAD_NOTICE=0` reads no battery and names no controller. The page is found from the menu hooks, and a pointer outside the guest window is not followed. `MKWVK_API_VERSION` goes from 29 to 30 for `pad_notice` and `pad_status`. https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1034 and https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1358 also take 30, so whichever lands second renumbers. The notice strings sit beside https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1318 and https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1349: keep all of them. On Windows a DualSense showed each notice, and standing still stayed at about 80 fps. An Xbox controller, a Switch controller, a Linux DualSense, and the Deck's own controls are still open. The earlier farm ask was for an older commit and never started.
Owner

Brought up to the ready-for-review standard (#1454): the checklist's Everyone list has two new boxes, added here from what this PR's description and comments show (please check they match what you know).

  • Tested on my own PC: ticked: Testing's Tested: an in-game run on Windows 11, RTX 4090 (driver 621.24) with a DualSense over Bluetooth.
  • Nothing gets worse that I know of: not ticked: Risks names a per-frame menu read on the pause page, but no measurement covers that page. Measure that cost and state it in Risks, then tick it.
Brought up to the [ready-for-review standard](https://git.magicbean.dev/MagicBeanDev/Longshot/src/branch/main/CONTRIBUTING.md#ready-for-review-out-of-wip) (#1454): the checklist's Everyone list has two new boxes, added here from what this PR's description and comments show (please check they match what you know). - *Tested on my own PC*: ticked: Testing's Tested: an in-game run on Windows 11, RTX 4090 (driver 621.24) with a DualSense over Bluetooth. - *Nothing gets worse that I know of*: not ticked: Risks names a per-frame menu read on the pause page, but no measurement covers that page. Measure that cost and state it in Risks, then tick it.
lg changed title from feat(input): show a notice when a controller's battery is low, when it disconnects and when it connects to WIP: feat(input): show a notice when a controller's battery is low, when it disconnects and when it connects 2026-11-18 03:28:29 +00:00
Author
Contributor

Back to work in progress for two things: the rebase onto current main (the interface is at 33 there, so this becomes 34), and a measurement of the pause menu's System page with and without the controller's line, for the open checklist box. The stale Test Farm request will be asked again on the rebased commit.

Back to work in progress for two things: the rebase onto current main (the interface is at 33 there, so this becomes 34), and a measurement of the pause menu's System page with and without the controller's line, for the open checklist box. The stale Test Farm request will be asked again on the rebased commit.
lg force-pushed feat/controller-notices from 974550ed92
Some checks failed
beanstalk/approval changed since the request: ask again
PR description / Description follows the template (pull_request_target) Successful in 5s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
to a1a3ff6707
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval waiting for a BigBean's 👍 on the request
PR description / Description follows the template (pull_request_target) Successful in 3s
2026-11-18 04:08:13 +00:00
Compare
Author
Contributor

Rebased onto main 413d63e (bc175f4, a1a3ff6). The interface is at 33 on main now, so this change's two members follow as 34; whichever of the pull requests that take a version lands later renumbers, as the review says. The notice strings are kept beside main's new ones.

The open checklist box: the pause menu's System page is measured now, where the controller's line reads the game's menu and is drawn every frame. Main ef6038a 219.4 / 221.05 fps, this PR (built as ad35f3b) 220.9 / 221.5, two runs a side in turn after a warm-up of each: within the spread. It is in Measurements' table and in Risks' Cost, with four new files under docs/tested/, and the box is ticked.

Also in the description: the TL;DR and Breakdown the template has now, and a third picture, the System page on the rebased build with the controller on its charger (the bolt before the battery), which had not been seen on that page. The standing-still numbers and the two sheets are from before this rebase (main 544229a against 9f0dd23): the change itself differs only in the version number. Checks on ad35f3b: 639 passed, the same 37 failed as main ef6038a's 637. It builds whole for Windows and Linux.

Rebased onto main 413d63e (bc175f4, a1a3ff6). The interface is at 33 on main now, so this change's two members follow as 34; whichever of the pull requests that take a version lands later renumbers, as the review says. The notice strings are kept beside main's new ones. The open checklist box: the pause menu's System page is measured now, where the controller's line reads the game's menu and is drawn every frame. Main ef6038a 219.4 / 221.05 fps, this PR (built as ad35f3b) 220.9 / 221.5, two runs a side in turn after a warm-up of each: within the spread. It is in Measurements' table and in Risks' Cost, with four new files under docs/tested/, and the box is ticked. Also in the description: the TL;DR and Breakdown the template has now, and a third picture, the System page on the rebased build with the controller on its charger (the bolt before the battery), which had not been seen on that page. The standing-still numbers and the two sheets are from before this rebase (main 544229a against 9f0dd23): the change itself differs only in the version number. Checks on ad35f3b: 639 passed, the same 37 failed as main ef6038a's 637. It builds whole for Windows and Linux.
lg changed title from WIP: feat(input): show a notice when a controller's battery is low, when it disconnects and when it connects to feat(input): show a notice when a controller's battery is low, when it disconnects and when it connects 2026-11-18 04:08:38 +00:00
Author
Contributor

@Beanstalk on Linux: build this PR and start the game, with a controller connected if one is at hand; play a minute, then open the pause menu and go to its System page. Check that the build succeeds, that no controller notice shows at the start, and report the log's hid: lines about the controller (its battery reading, or "no battery reading from it so far"). A picture of the pause menu's System page, please: the controller's name should be under the controller picture.

@Beanstalk on the Steam Deck: start the game and play a minute with the Deck's own controls, then open the pause menu's System page. Check that no controller notice shows over the game, and report the log's hid: lines about the controller ("no battery reading from it so far" is expected). A picture of the System page, please.

@Beanstalk on Linux: build this PR and start the game, with a controller connected if one is at hand; play a minute, then open the pause menu and go to its System page. Check that the build succeeds, that no controller notice shows at the start, and report the log's `hid:` lines about the controller (its battery reading, or "no battery reading from it so far"). A picture of the pause menu's System page, please: the controller's name should be under the controller picture. @Beanstalk on the Steam Deck: start the game and play a minute with the Deck's own controls, then open the pause menu's System page. Check that no controller notice shows over the game, and report the log's `hid:` lines about the controller ("no battery reading from it so far" is expected). A picture of the System page, please.
Member

@lg only members of BigBeans can start the farm. One of them can approve this request by reacting 👍 to it or to this comment.

@lg only members of `BigBeans` can start the farm. One of them can approve this request by reacting 👍 to it or to this comment.
Author
Contributor

The two Test Farm requests above are withdrawn: no run on Linux or the Steam Deck is asked for, and none should be started for this pull request. The description's Must be tested is None now: no further run is asked for before merge, and what was not run (a real Xbox or Switch controller, Linux, the Steam Deck) is listed under Not tested, with what stands in for it. From the author's side this is ready to merge.

The two Test Farm requests above are withdrawn: no run on Linux or the Steam Deck is asked for, and none should be started for this pull request. The description's Must be tested is None now: no further run is asked for before merge, and what was not run (a real Xbox or Switch controller, Linux, the Steam Deck) is listed under Not tested, with what stands in for it. From the author's side this is ready to merge.
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval waiting for a BigBean's 👍 on the request
PR description / Description follows the template (pull_request_target) Successful in 3s
This pull request doesn't have enough approvals yet. 0 of 1 approvals granted.
Some workflows are waiting to be reviewed.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'feat/controller-notices:lg-feat/controller-notices'
git switch 'lg-feat/controller-notices'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
4 participants
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!1092
No description provided.