Skip to content

Input: PlayStation button prompts and Settings controller picture, served over the title's reads (VICTORY_FILE_PATCH) - #937

Closed
abilliontokens wants to merge 3 commits into
trustno1-coder:mainfrom
abilliontokens:feat/playstation-prompts
Closed

abilliontokens wants to merge 3 commits into
trustno1-coder:mainfrom
abilliontokens:feat/playstation-prompts

Conversation

@abilliontokens

@abilliontokens abilliontokens commented Nov 28, 2026 •

Copy link
Copy Markdown

What this adds

The Xbox build ships only Xbox button art, so with a PlayStation pad the game still asks for A, B, X and Y. This makes the prompts PlayStation's, and lets the Settings > Controls picture be a DualSense, without writing anything into the game's folder.

  • PLAYSTATION BUTTON ICONS (F1 row, VICTORY_PS_PROMPTS=1): at the next start the prompts are built once from the copy being played and kept in the cache. Face buttons become cross/circle/square/triangle, LB/LT/RB/RT become L1/L2/R1/R2, and View becomes the touchpad. The symbols are Kenney's Input Prompts (CC0), drawn inside the game's own button frames, so the look stays the game's.
  • Settings controller picture: a lavender DualSense render ships as the default (apps/victory/assets/ps5-controller.png, 1024x683, 605 KB). It is the contributor's own work under the repository's licence, and a policy exception in xtask/src/policy.rs gives the reason. VICTORY_PS_PICTURE=<png>, or ps5-controller.png in the home folder, replaces it. It is encoded into the 1024x512 BC7 texture in data\ttdb\ui\platform.ttpf. The built patches (game-derived) are never committed.
  • PLAYSTATION PAD (F1 row for the existing VICTORY_DUALSENSE: AUTO / WITH XBOX PADS / OFF). Reading the pads over HID is unchanged; this only puts the switch in the menu.
  • VICTORY_FILE_PATCH=<list>: the mechanism under both, usable for mods. Each line of the list is <file name> <offset> <blake3 of the original range> <file with the new bytes>. file_patch in dstorage.rs puts those bytes over every DirectStorage read that meets the range. A patch whose hash no longer matches (another game version) is skipped, and the log says so.
  • victory glyphs [--game] [--picture] [--out] builds the same list by hand.

Docs: docs/playstation-prompts.md (switches, list format, log lines, how it works) and a README section.

Why patch reads instead of repacking the archive

data.rpf's table is encrypted, and no repacked RPF9 archive has been shown to load in the game. The rebuilt prompt movie therefore keeps its entry's exact compressed length (9,644 bytes): the movie is compressed with zopfli, then padded with stored blocks (victory_formats::zlib_exact). Archive, table and signature stay as the maker wrote them, and only the bytes the title reads from that range differ. The doc has the details and sources.

Credits

Ported from Marvisak/VIctory PR #3399 by Anoyarou (GPL-3.0-or-later; co-author on the commit). Prompt symbols: Kenney's Input Prompts (CC0).

How it was checked

On 63b902f plus this commit:

Check Result
cargo test --locked -p victory -p victory-hle -p victory-formats -p victory-game all pass, 0 failed
cargo xtask policy 302 files ok (the bundled render is listed as an exception, see docs/asset-policy.md)
cargo clippy --workspace --all-targets -- -D warnings stops at victory-gpu/src/shadow.rs:1708 and victory-shader/src/emit/mod.rs:2768. Those are existing lints on main (#86, #265, #665, #687, #705 fix them); this PR touches neither file. On a base with those lints fixed, this same commit was clippy-clean in both builds (plain and --features diagnostics).
cargo test -p victory-hle connected_playstation_pads -- --ignored a USB DualSense (054C:0CE6) is found and read

In game (1.0.2.1 retail, Windows 11, RTX 5060 Ti 16 GB, diag build):

  • victory glyphs on the real data.rpf: the prompt entry was rebuilt at exactly 9,644 bytes, and it inflates to a valid movie of the original length (28,148 bytes). The picture texture decodes in an independent TTPF viewer.
  • Live runs logged file patch: applies to this file for data.rpf and platform.ttpf, then first read served from it. The title screen and the Settings footer showed △ ▢ ✕. Settings > Control Scheme showed the user's DualSense picture with PlayStation symbols, at 4K output and at 1440p.
  • The 1440p Settings layout needs 1440p Native UI Scaling Fix #541: without it the menus overlap at 1440p whether this PR's prompts are on or off.

Not checked: every screen that shows prompts, the 1080to1440 and Series S profiles, and Linux/Wine.

Notes

  • Cargo.lock gains png and zopfli, which, as any lock change does, makes the shader cache rebuild once (VICTORY_TRANSLATOR).
  • Both launchers keep VICTORY_FILE_PATCH and VICTORY_PS_PICTURE when they clear the other switches.

… patches

- VICTORY_PS_PROMPTS=1 (F1: PLAYSTATION BUTTON ICONS): the game's prompt movie in data.rpf gets PlayStation symbols in its own button frames, rebuilt to its exact entry size (9644 bytes, zopfli), built once at start into the cache
- Settings > Controls picture from a user PNG (VICTORY_PS_PICTURE, else ps5-controller.png in the home folder), BC7 into platform.ttpf
- VICTORY_FILE_PATCH: blake3-guarded byte ranges served over DirectStorage reads; no game file changed on disk
- `victory glyphs` builds the same list by hand; F1: PLAYSTATION PAD row for VICTORY_DUALSENSE
- Checked live: patches served, DualSense connected, title screen shows triangle/square/cross

Ported from Marvisak/VIctory PR #3399.

Co-Authored-By: Anoyarou <anoyarou@tuta.com>
Co-Authored-By: GLM-5.4 via omp <noreply@z.ai>
… controller picture

- apps/victory/assets/ps5-controller.png (1024x683 RGBA, 605 KB): its contributor's own render, under the repository's licence; nothing of the game. Policy exception in xtask/src/policy.rs
- Used when VICTORY_PS_PICTURE and the home folder's ps5-controller.png are absent; written once into the patch folder
- The list now names the picture it was made from (`# picture:`), so a change of picture rebuilds it

Co-Authored-By: GLM-5.4 via omp <noreply@z.ai>
@abilliontokens

Copy link
Copy Markdown
Author

Added in 5b3e566: a DualSense render now ships as the default Settings controller picture (apps/victory/assets/ps5-controller.png, 1024x683 RGBA, 605 KB). It is my own render, released under the repository's licence, and contains nothing from the game. It has an exception entry in xtask/src/policy.rs that gives the reason, like the BCPack tables. VICTORY_PS_PICTURE, or ps5-controller.png in the home folder, still takes precedence. The patch list now records which picture it was built from (# picture: ...), so changing the picture rebuilds it. The built patches themselves (the rebuilt prompt movie and texture) stay out of the repository: they are derived from the game, which the asset policy forbids, and they are built on the user's machine.

Checked: victory glyphs with no --picture on the retail data.rpf builds both patches; the texture decodes in an independent TTPF viewer; the glyphs tests (5) and xtask tests pass; cargo xtask policy: 302 files ok.

…ond exception

- docs/asset-policy.md said bcpack-tables.bin was the one exception; ps5-controller.png (the contributor's own render, under the repository's licence) is now listed with its reason, as in xtask/src/policy.rs

Co-Authored-By: GLM-5.4 via omp <noreply@z.ai>
@trustno1-coder

Copy link
Copy Markdown
Owner

Thanks for this. I'm closing it without merging: it adds new dependencies (png, zopfli) that the offline release build doesn't have, a binary asset, and patches to the title's files, and it conflicts with main. If you'd like the prompts change in, a smaller pull request against the current main without new dependencies would be easier to take.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants