F1 menu: GAME SETTINGS, the game's own settings.xml with its ranges, steps and defaults #4934

Open
NICKNAMErutschovkonikovan wants to merge 3 commits from upstream-pr/4934 into main
NICKNAMErutschovkonikovan commented 2026-12-01 14:35:44 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by NICKNAMErutschovkonikovan on 2026-12-01T14:35:44Z.


What it changes

Adds an F1 line, GAME SETTINGS (ENTER OPENS, under the Series X/S picture lines). It opens a page with the game's own options, read from and written to <data>\<title id>\storage\settings\settings.xml (new module crate::game_settings). The page follows the F1 menu's #4634 look in the same way as KEY BINDINGS: a title, a help line, a divider, label/value rows with the row highlight, and a footer with three about lines, the note and REPO. It is a new branch in render_menu.

  • Switches change with Left/Right or Enter. Numbers have a slider bar: Left/Right move it along the grid min + k * step, which ends at max and gives the same values both ways (for example frameRateLimit: 0, 30, … 120, 144). Enter opens a typed input. The input takes digits, a leading minus only where the range goes below zero, and one point in a decimal, with at most six places. A comma is refused rather than read as a point. Where the step is the title's own, a value between two steps is refused. Esc cancels the input. A controller's A on a number does not open an input, because a controller cannot type; it changes numbers with Left/Right.
  • Ranges, steps and defaults are the title's own limits for these settings (SPECS, Bound). The footer shows the range and where it comes from. That is the title's limits, or those limits started at the title's default where the default lies below the title's own minimum (two texLodScale_Mat_*), or assumed (decorationResolutionShift). It also shows whether the step is the title's or ours, and the default.
  • ADVANCED levels are written by name, <taa value="High" />, not as a number. In all 257 XML files of the game's data written by the same RAGE parser, an enum member is always its value's name: mostly element text (<MotivationType>FearMotivation</MotivationType>), sometimes the attribute (<eGroundProbeSampleType value="GroundProbeSampleType_Spline" />, common\00223000.xml). No enum anywhere has a numeric value, and a real settings.xml holds no enum member at all, so a number would most likely be ignored. The names (Low, Medium, High, Ultra, Custom, Special) belong to the quality enum aae5818c: their case-kept hashes are in the default instance's enum list, and the lower- and upper-case variants are not. Reading accepts the name as an attribute or as element text, and a number (as the first commit wrote). SAVE and the start rewrite such numbers as names.
  • ADVANCED lists the title's quality settings that its settings.xml does not hold, as named levels within the title's own range only. A setting not in the file shows the title's default and is tagged DEFAULT. Stepping round back to the default is not a change. A level in the file outside the title's enum (from a file made elsewhere) is read as not there. SAVE adds only the ones that changed, each in its group. RESET ADVANCED takes all of them out again. Whether the game reads them from the file is not tested, and the footer says so.
  • SAVE:
    • It reads the file again first, because the game may have written it since the page opened, and changes only the bytes of the changed values. The rest of the file stays byte for byte.
    • It writes a new file, flushes it to the disk and renames it over the old one. The first time it keeps the old file as settings.xml.victory-backup. If any step fails, the file stays as it was. It never writes text that does not parse back as the game's settings file, including empty text.
    • Each value is counted only if it actually went into the file.
    • SAVE also records the values it wrote in victory-game-settings.txt beside victory-settings.txt, even with PERSISTENT off.
  • PERSISTENT ON: at every start, run.rs writes those recorded values back into settings.xml after the save import, because the game rewrites the whole file when it saves its own settings. The console line names the file. VICTORY_GAME_SETTINGS_KEPT=0 skips this for one start; turning PERSISTENT off or deleting the file ends it. A victory-game-settings.txt that exists but cannot be read is reported and left alone, never treated as empty.
  • The page does not offer what the launcher sets itself (uiOverlay, uiResolution, resolutionFullscreen, fsrQuality, videoCardDescription), nor bookkeeping values.
  • Esc or BACK with unsaved changes asks once. A second press leaves and drops the changes; any other key in between clears the warning. F1 closes the menu together with the page at once, without asking, as on every other page.
  • Mouse wheel moves the selection, as on the other pages.

The digit, minus, point, comma and Backspace keys are now watched too. They are dropped everywhere except in this page's input. The menu's own settings file is now located through game_settings::menu_file(), using the same lookup as before, so the recorded values sit beside it. README: a GAME SETTINGS row and section under PICTURE, plus rows for VICTORY_MENU_GAME_SETTINGS and VICTORY_GAME_SETTINGS_KEPT.

Asset policy: please decide

The numbers in SPECS, Bound and ADVANCED (each option's minimum, maximum, step and default, and which ADVANCED levels exist) were read once from the game's executable: they are its settings parser's limits. Only those numbers and the setting names are in the source. There are no bytes, disassembly or files from the game. Six of the ADVANCED names (ambientLightingQuality, directionalShadowQuality, hairSimulationQuality, terrainQuality, imposterQuality, waterTessellationQuality) are not in any file. They are names whose hash matches one the executable uses, and the page says "NAME GUESSED" for them. The values seen in two real settings.xml files (one Series X, one Series S data folder) appear as comments. I am saying this openly so you can decide whether it fits docs/asset-policy.md. If it does not, the ranges can fall back to assumed ones and ADVANCED can be dropped.

How it was tested

  • GPU and profile: the page was used in the game on a combined build that also contains other changes, on an RTX 5090 + Ryzen 7 5800X3D. This branch itself was not run in the game.
  • Before: no way to change the game's own settings.xml from F1.
  • After (commit 98d84fc1):
    • cargo clippy --workspace --all-targets --locked -- -D warnings reports only the 5 errors already on main (5fabb46e): host/font.rs:213, :260 (too_many_arguments), host/menu.rs (manual_is_multiple_of, at :680 here, :667 on main), host/panel.rs:602, :668 (collapsible_if). With those three lints allowed, the whole workspace is clean.
    • cargo test -p victory-gpu --lib --locked -- game_settings menu --test-threads=1: 29 passed (17 in game_settings, 11 in host::menu::game, 1 in save_share). None of them need game files; they use temp folders. They cover:
      • a failed write keeping the old file, and text that does not parse never being written;
      • a file without a final line end;
      • a level outside the enum, with no panic;
      • slider steps anchored at the minimum;
      • SAVE onto a file the game changed meanwhile;
      • a read error on the kept file;
      • off-step typing, the controller's A, and the leave warning;
      • levels written by name, all three read forms, and a legacy number rewritten at the next SAVE and by the start.
    • game_settings::tests::a_real_settings_file_reads_back_byte_for_byte reads a real settings.xml from VICTORY_TEST_GAME_SETTINGS_XML. When that variable points at a real file, the test checks every offered option and that setting each to itself changes no byte. It returns early when the variable is unset, which it was in this run.
    • On the first commit (7b8c1ec9), cargo test --workspace --locked --no-fail-fast showed 10 failures outside this change: host::card_steps::tests::shared_scratch_eliminates_flight_settle_end_to_end and 9 GPU-reference tests in victory-shader (emit::intersect_tests ×4, permlane_rows_and_inactive_sources, a_pixel_mask_draws_only_its_pixels_of_each_quad, edge_flagged_triangles_draw_as_unflagged_ones, quad_neighbours_at_a_triangles_edge_are_read, cndmask_saved_exec_respects_dispatch_x_partial_active). The same 10 also fail on a clean origin/main (5fabb46e) on this machine, and victory-shader does not depend on victory-gpu.
    • cargo build --release --locked -p victory: succeeds.
    • cargo xtask policy: 466 files ok.
  • cargo test passed for the crates it touches: yes for this change's tests. The pre-existing machine-specific failures are listed above.

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. Related: #1981 (PC display settings inside the game's own Settings menu, a different route: it adds rows to the title's menu, this edits settings.xml from F1). No open pull request edits settings.xml.

🤖 Generated with Claude Code

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5587895597 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4934). Originally posted by [NICKNAMErutschovkonikovan](https://github.com/NICKNAMErutschovkonikovan) on 2026-12-01T14:35:44Z. --- ## What it changes Adds an F1 line, **GAME SETTINGS** (`ENTER OPENS`, under the Series X/S picture lines). It opens a page with the game's own options, read from and written to `<data>\<title id>\storage\settings\settings.xml` (new module `crate::game_settings`). The page follows the F1 menu's #4634 look in the same way as KEY BINDINGS: a title, a help line, a divider, label/value rows with the row highlight, and a footer with three about lines, the note and REPO. It is a new branch in `render_menu`. - **Switches** change with Left/Right or Enter. **Numbers** have a slider bar: Left/Right move it along the grid `min + k * step`, which ends at `max` and gives the same values both ways (for example `frameRateLimit`: 0, 30, … 120, 144). Enter opens a typed input. The input takes digits, a leading minus only where the range goes below zero, and one point in a decimal, with at most six places. A comma is refused rather than read as a point. Where the step is the title's own, a value between two steps is refused. Esc cancels the input. A controller's A on a number does not open an input, because a controller cannot type; it changes numbers with Left/Right. - **Ranges, steps and defaults are the title's own** limits for these settings (`SPECS`, `Bound`). The footer shows the range and where it comes from. That is the title's limits, or those limits started at the title's default where the default lies below the title's own minimum (two `texLodScale_Mat_*`), or assumed (`decorationResolutionShift`). It also shows whether the step is the title's or ours, and the default. - **ADVANCED levels are written by name**, `<taa value="High" />`, not as a number. In all 257 XML files of the game's data written by the same RAGE parser, an enum member is always its value's name: mostly element text (`<MotivationType>FearMotivation</MotivationType>`), sometimes the attribute (`<eGroundProbeSampleType value="GroundProbeSampleType_Spline" />`, `common\00223000.xml`). No enum anywhere has a numeric value, and a real `settings.xml` holds no enum member at all, so a number would most likely be ignored. The names (Low, Medium, High, Ultra, Custom, Special) belong to the quality enum `aae5818c`: their case-kept hashes are in the default instance's enum list, and the lower- and upper-case variants are not. Reading accepts the name as an attribute or as element text, and a number (as the first commit wrote). SAVE and the start rewrite such numbers as names. - **ADVANCED** lists the title's quality settings that its `settings.xml` does not hold, as named levels within the title's own range only. A setting not in the file shows the title's default and is tagged `DEFAULT`. Stepping round back to the default is not a change. A level in the file outside the title's enum (from a file made elsewhere) is read as not there. SAVE adds only the ones that changed, each in its group. RESET ADVANCED takes all of them out again. Whether the game reads them from the file is not tested, and the footer says so. - **SAVE**: - It reads the file again first, because the game may have written it since the page opened, and changes only the bytes of the changed values. The rest of the file stays byte for byte. - It writes a new file, flushes it to the disk and renames it over the old one. The first time it keeps the old file as `settings.xml.victory-backup`. If any step fails, the file stays as it was. It never writes text that does not parse back as the game's settings file, including empty text. - Each value is counted only if it actually went into the file. - SAVE also records the values it wrote in `victory-game-settings.txt` beside `victory-settings.txt`, **even with PERSISTENT off**. - **PERSISTENT** ON: at every start, `run.rs` writes those recorded values back into `settings.xml` after the save import, because the game rewrites the whole file when it saves its own settings. The console line names the file. `VICTORY_GAME_SETTINGS_KEPT=0` skips this for one start; turning PERSISTENT off or deleting the file ends it. A `victory-game-settings.txt` that exists but cannot be read is reported and left alone, never treated as empty. - The page does not offer what the launcher sets itself (`uiOverlay`, `uiResolution`, `resolutionFullscreen`, `fsrQuality`, `videoCardDescription`), nor bookkeeping values. - Esc or BACK with unsaved changes asks once. A second press leaves and drops the changes; any other key in between clears the warning. **F1 closes the menu together with the page at once, without asking**, as on every other page. - Mouse wheel moves the selection, as on the other pages. The digit, minus, point, comma and Backspace keys are now watched too. They are dropped everywhere except in this page's input. The menu's own settings file is now located through `game_settings::menu_file()`, using the same lookup as before, so the recorded values sit beside it. README: a GAME SETTINGS row and section under PICTURE, plus rows for `VICTORY_MENU_GAME_SETTINGS` and `VICTORY_GAME_SETTINGS_KEPT`. ### Asset policy: please decide The numbers in `SPECS`, `Bound` and `ADVANCED` (each option's minimum, maximum, step and default, and which ADVANCED levels exist) were read **once from the game's executable**: they are its settings parser's limits. Only those numbers and the setting names are in the source. There are no bytes, disassembly or files from the game. Six of the ADVANCED names (`ambientLightingQuality`, `directionalShadowQuality`, `hairSimulationQuality`, `terrainQuality`, `imposterQuality`, `waterTessellationQuality`) are not in any file. They are names whose hash matches one the executable uses, and the page says "NAME GUESSED" for them. The values seen in two real `settings.xml` files (one Series X, one Series S data folder) appear as comments. I am saying this openly so you can decide whether it fits `docs/asset-policy.md`. If it does not, the ranges can fall back to assumed ones and ADVANCED can be dropped. ## How it was tested - GPU and profile: the page was used in the game on a combined build that also contains other changes, on an RTX 5090 + Ryzen 7 5800X3D. This branch itself was not run in the game. - Before: no way to change the game's own `settings.xml` from F1. - After (commit 98d84fc1): - `cargo clippy --workspace --all-targets --locked -- -D warnings` reports only the 5 errors already on `main` (5fabb46e): `host/font.rs:213`, `:260` (too_many_arguments), `host/menu.rs` (manual_is_multiple_of, at :680 here, :667 on main), `host/panel.rs:602`, `:668` (collapsible_if). With those three lints allowed, the whole workspace is clean. - `cargo test -p victory-gpu --lib --locked -- game_settings menu --test-threads=1`: 29 passed (17 in `game_settings`, 11 in `host::menu::game`, 1 in `save_share`). None of them need game files; they use temp folders. They cover: - a failed write keeping the old file, and text that does not parse never being written; - a file without a final line end; - a level outside the enum, with no panic; - slider steps anchored at the minimum; - SAVE onto a file the game changed meanwhile; - a read error on the kept file; - off-step typing, the controller's A, and the leave warning; - levels written by name, all three read forms, and a legacy number rewritten at the next SAVE and by the start. - `game_settings::tests::a_real_settings_file_reads_back_byte_for_byte` reads a real `settings.xml` from `VICTORY_TEST_GAME_SETTINGS_XML`. When that variable points at a real file, the test checks every offered option and that setting each to itself changes no byte. It returns early when the variable is unset, which it was in this run. - On the first commit (7b8c1ec9), `cargo test --workspace --locked --no-fail-fast` showed 10 failures outside this change: `host::card_steps::tests::shared_scratch_eliminates_flight_settle_end_to_end` and 9 GPU-reference tests in `victory-shader` (`emit::intersect_tests` ×4, `permlane_rows_and_inactive_sources`, `a_pixel_mask_draws_only_its_pixels_of_each_quad`, `edge_flagged_triangles_draw_as_unflagged_ones`, `quad_neighbours_at_a_triangles_edge_are_read`, `cndmask_saved_exec_respects_dispatch_x_partial_active`). The same 10 also fail on a clean `origin/main` (5fabb46e) on this machine, and `victory-shader` does not depend on `victory-gpu`. - `cargo build --release --locked -p victory`: succeeds. - `cargo xtask policy`: 466 files ok. - `cargo test` passed for the crates it touches: yes for this change's tests. The pre-existing machine-specific failures are listed above. ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. Related: #1981 (PC display settings inside the game's own Settings menu, a different route: it adds rows to the title's menu, this edits settings.xml from F1). No open pull request edits settings.xml. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/4934:upstream-pr/4934'
git switch 'upstream-pr/4934'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/4934'
git switch 'upstream-pr/4934'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/4934'
git switch 'upstream-pr/4934'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/4934'
git switch 'main'
git merge --squash 'upstream-pr/4934'
git switch 'main'
git merge --ff-only 'upstream-pr/4934'
git switch 'main'
git merge 'upstream-pr/4934'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
trustno1-coder/VIctory-NVIDIA!4934
No description provided.