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

Open
github-bot wants to merge 3 commits from github-bot/gh-4934 into main AGit
Owner

@⁠NICKNAMErutschovkonikovan on GitHub · 2026-12-01 14:35 UTC · original
NICKNAMErutschovkonikovan:pr/game-settings → main · +2447 −10 · 7 files · 3 commits · open

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 #4635 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

**@⁠NICKNAMErutschovkonikovan** on GitHub · 2026-12-01 14:35 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4934) `NICKNAMErutschovkonikovan:pr/game-settings` → `main` · +2447 −10 · 7 files · 3 commits · open ## 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 #4635 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)
A new F1 line, GAME SETTINGS (ENTER OPENS), under the picture lines, opens a page of the
game's own options from <data>\<title id>\storage\settings\settings.xml, drawn as KEY BINDINGS
is (title, keys, divider, label/value rows, highlight, footer with three lines, note, REPO):

- switches: Left/Right or Enter; numbers: a slider bar, Left/Right by the step, Enter opens an
  input (digits, a leading minus only where the range is negative, one point in a decimal, at
  most six places; a comma is refused, not read as a point), Esc cancels it.
- the ranges, steps and defaults are the title's own limits for these settings
  (game_settings::SPECS, Bound); the footer says the range, whether it is the title's or
  assumed, whose step it is, and the default.
- ADVANCED: the title's quality settings its file lacks (game_settings::ADVANCED), as named
  levels; one not in the file shows the title's default (tag DEFAULT). SAVE adds only those
  changed, into their group; RESET ADVANCED takes every one out again.
- SAVE writes only the changed values' bytes (the rest of the file stays byte for byte),
  through a file renamed over it, keeping settings.xml.victory-backup the first time.
  PERSISTENT keeps the saved values in victory-game-settings.txt beside victory-settings.txt,
  and run.rs writes them again at every start after the save import, since the game rewrites
  the whole file when it saves its own settings.
- what the launcher sets itself (uiOverlay, uiResolution, resolutionFullscreen, fsrQuality,
  videoCardDescription) and bookkeeping values are not offered.
- Esc or BACK with changes not saved asks once; the second leaves and drops them.

The digit, minus, point, comma and Backspace keys are watched as well, and dropped everywhere
but in this page's input. The menu's settings file is now found through
game_settings::menu_file, so the kept values sit beside it.

Tests (no game files): the XML splice keeps every other byte, insert/remove of ADVANCED values
round-trips to the same file, typing and range checks, slider steps, the kept file, the start
write, and the page's keys, rows and footer lines (game_settings.rs, host/menu/game.rs).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Review fixes to the page and game_settings.rs:

- Doc::insert/remove change a copy and swap it in only when it parses again; before, a failed
  re-parse left an empty document that SAVE then wrote as a 0-byte settings.xml ("1 SAVED").
  write_xml refuses any text Doc::parse does not read (an empty one too).
- SAVE and RESET ADVANCED read the file again and work on that (the game may have written it
  since the page opened), count only values that went in, put only those into the kept file, and
  touch the page's copy only after the write succeeded.
- write_atomic flushes the new file (File::create, write_all, sync_all) before the rename.
- An ADVANCED level outside the enum in the file (taa="9", a file from elsewhere) is read as not
  there instead of indexing LEVELS out of bounds; ADVANCED offers only the title's own levels
  (no CUSTOM/SPECIAL beyond its maximum); stepping back to the default of a setting the file
  lacks is no change.
- Kept::read returns a read error instead of an empty file, whose write would drop every kept
  value.
- The start names victory-game-settings.txt in its console line, and VICTORY_GAME_SETTINGS_KEPT=0
  skips writing the kept values for one start (README: the page, the file, the switch).
- Slider steps run on the grid min + k * step, ending at max, the same both ways
  (frameRateLimit 0, 30, ... 120, 144); a typed value between two of the title's own steps is
  refused (ONLY STEPS OF ...).
- Page::open tells a missing file from one that cannot be read; the warning before leaving is
  cleared with its note; a controller's A on a number opens no input it cannot fill.
- The footer says where a range comes from, the title's own minimum where the range starts at
  its default below it; the stale range comment in SPECS is corrected.

Tests (no game files): a failed write keeps the old file, a file without a final line end,
an out-of-enum level, slider steps anchored at the minimum, SAVE onto a file the game changed,
the kept file's read error, off-step typing, the pad and the warning.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 14:39:10 +00:00
In all 257 XML files of the title's data, written by the same RAGE parser as settings.xml, an
enum member is always its value's name, never a number: mostly the element's 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
`<taa value="2" />`, as ADVANCED wrote it, would most likely be ignored.

ADVANCED now writes a level by name: `<taa value="High" />` (Low, Medium, High, Ultra, Custom,
Special: the names of the quality enum aae5818c, their case-kept hashes found in the default
instance's enum list, the lower and upper case ones not). Read: the name as attribute or as
element text (Doc reads an element's text inside a group as its value; text right under the
root, videoCardDescription, stays none), and a number, as the first version wrote: SAVE writes
such numbers as names (game_settings::migrate), and the start writes kept values as names.

Tests: names written, all three forms read, a legacy number migrated at the next SAVE and by
the start, an element's text set in its own form.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/host/menu.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/4935/head:github-bot/gh-4934'
git switch 'github-bot/gh-4934'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-4934'
git switch 'github-bot/gh-4934'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-4934'
git switch 'github-bot/gh-4934'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-4934'
git switch 'main'
git merge --squash 'github-bot/gh-4934'
git switch 'main'
git merge --ff-only 'github-bot/gh-4934'
git switch 'main'
git merge 'github-bot/gh-4934'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

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