Display settings at run time: window mode toggle, fps limit and an in-game settings menu (design, phased) #727
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from fxceless/victory-fork. Originally posted by Revens2 on 2026-11-25T05:48:25Z.
Problem
Display and frame settings can only be changed before a run (config file or environment variables) and, for the window, not at all yet. A player who wants to switch between windowed, borderless and fullscreen, pick a resolution, turn vsync on or off, or cap the frame rate has to quit, edit
victory.tomland start again. There is no in-game way to do it, and nothing to open one with.This is a feature request and a design for it. It is not a bug report and it does not depend on any title data.
Related work (checked 2026-11-25,
gh issue list --state allandgh pr list --state all, searches: fullscreen, borderless, menu, overlay, window, vsync, fps limit)No open or closed issue asks for this. Open PRs that overlap in part:
[window] sizeinvictory.toml(title,<w>x<h>,fullscreenas a borderless popup), per-monitor DPI awareness, closing the presenting window ends the title. Start-up configuration only; no runtime switch, no menu.host.rs). It conflicts in intent with #433'stitlemode; one of the two should win.[controls]). Touches the same input path a menu would have to take over.This issue proposes the interactive layer on top of those. It should not duplicate them; where a phase below is already in one of them, the phase says so.
Current state of the code (
origin/mainat310c6eb)Host::presenterincrates/victory-gpu/src/host.rsusestitle_window()(the first visible top-level window of the process) and otherwisewindow(w, h), which starts avictory-windowthread runningmake_window(classVIctory,WS_OVERLAPPEDWINDOW | WS_VISIBLE, default position) and a bare message pump;window_procisDefWindowProcWonly. Per #433, the title keeps its own windows hidden, so in practice the presenting window is ours (this is read from #433's description andtitle_window's filter on visibility; not re-measured).IDXGISwapChain3,DXGI_SWAP_EFFECT_FLIP_DISCARD,BUFFERS = 2, sized to the title's frame (Width/Heightof the presented texture), made withCreateSwapChainForHwnd.ResizeBuffersis called when the presented size or format changes (aftersettle_now(WHY_SYNC)). Each present copies the title's texture into the back buffer (CopyResource) and callsPresent(0, 0).present. That is the place an interactive menu would draw too.crates/victory-hle/src/modules/gameinput.rspollsGetAsyncKeyStatefor virtual keys0x08..=0xFEwhile the process has focus and hands them to the title as a keyboard device; the same keys drive the stand-in gamepad (FALLBACK_BUTTONS: Esc, Tab, Enter, Backspace, X, Y, arrows, Q, E, F, H, plus W/A/S/D, I/J/K/L, Z, C). There is no filter between the OS and the title: any key reaches it. A menu key would therefore also reach the title unless the input module is told to stop.victory-core/src/config.rsholds paths only (game_dir,cache_dir,data_dir,test_titles); display settings are not part ofConfigon main (#433 adds[window]).Present(0, 0)has no limiter of its own. The only pacing is the title's own clock (crates/victory-gpu/src/frame.rs), which is a separate topic (see the frame pacing issue).Proposal, in deliverable phases
SetWindowPosover the monitor the window is on; remember the windowed rectangle). Builds on #433 (start-up mode) and replaces #131. The swap chain keeps the title's size and the DXGI scaler stretches it (as #433 documents), so aspect handling is a decision to make here: either keep stretching or letterbox to the title's aspect ratio. Acceptance below. Small enough for one PR.[display] fps_limit(0 = off) applied inpresentbeforePresent, with a sleep-then-spin wait on a monotonic clock. No change to the title's frame clock. Also small enough for one PR. Effect is only visible when frames are faster than the limit; in the world today frames are far slower (many reports in this repository measure 0.4 to 5 fps), so this is useful in menus and videos first. Not verified for any other case.[display]table invictory.toml(mode, size, vsync, fps_limit) withVICTORY_*overrides, parsed invictory-core, shared byvictory-gpu. Coordinate with #433's[window]so there is one table, not two.gameinputhands the title an idle keyboard and pad (no keys, no stand-in pad), then returns to normal on close; the key that opened the menu is also masked. Needs a shared flag betweenvictory-gpu(owner of the menu) andvictory-hle(owner of input); the direction of that dependency is a design choice to make before coding.victory.tomlonly on an explicit "save".Risks and open points
late_free_present) must go throughsettle_nowthe wayResizeBuffersalready does; not tested.victory-window) must be marshalled to that thread or useSetWindowPos/ShowWindowthat are safe cross-thread; not verified.SetFullscreenState) is not proposed: flip-model borderless is enough, and a mode switch on a device that can be removed is a new failure mode.Acceptance criteria (measurable)
GetWindowRectbefore and after); nodevice removed, no swap-chain error in the log across 20 toggles in a run that reaches the first menu; the frame counter keeps increasing after each toggle.fps_limit = 60on a scene that exceeds 60 fps without the limit, the mean present interval over 10 s is 16.7 ms +/- 1 ms and the standard deviation is below 1 ms (from the present timestamps #717/bench.ps1already record); with0the interval is unchanged from main.cargo test --workspace --lockedstays green; each phase adds a unit test for its parsing and state machine.Not verified
victory-window) beyond #433's statement.ResizeBuffersafter a style change while presents are in flight.Next step
Phases 1 and 2 are simple and independent of the title. If there is no objection, a PR for phase 1 (stacked on #433 if it is merged first, otherwise rebased on
main) and a separate PR for phase 2 will follow.Imported from fxceless/victory-fork. Originally posted by Revens2 on 2026-11-25T05:48:37Z.
Sibling issues opened together: #727 (settings/menu), #728 (frame pacing and latency), #729 (Reflex), #730 (upscaling), #731 (frame generation). Overlaps are named in each body; this set should stay split by subject.
Imported from fxceless/victory-fork. Originally posted by AwkGrep256 on 2026-11-27T12:50:01Z.
@Revens2 I saw CernyMuzCZ’s borderless and FPS cap commit linked here. I’ve been working on the menu side upstream. The draft adds VIctory controls to the game’s own Settings → Graphics tab, using its existing keyboard and controller navigation. I’ve tested changing the Upscaler there, saving to
victory.toml, and launching with AMD FSR on the next run.Would you be up for trying the FPS cap as a first shared setting? Your code could handle applying the cap live, and I can help wire up the native row. The same settings API could host window mode once we’ve tested how that behaves from the menu.
Prototype PR · Design discussion