Files
VIctory-xmem/README.md
goldfishdev 07e9727677 docs: put VICTORY_BENCH after the mode
run.sh clears inherited VICTORY_* variables, so the prefix form does not work.
2026-12-02 21:26:18 -06:00

18 KiB
Raw Blame History

VIctory xmem

VIctory on Linux with an AMD card. A patched RADV maps the title's memory straight into the GPU, the way the console shares it, so nothing is copied back and forth every frame.

This repository contains source code only. See the notice under Run.

Status

Project owner is currently working on a rewrite in a new repo (private ATM). xmem is still maintained and will continue to improve.

Run

Before you start. By following these steps you agree to use only copies of the program that you obtained lawfully, and you confirm that you own or are otherwise authorised to use the copy you point this build at. The project does not help you obtain it and does not support unlawfully obtained copies. If that is not the case, do not continue.

./setup.sh
# The first run asks for your game folder and writes run.conf (or write GAME=/path/to/your/dump in it)
./run.sh shaders
./run.sh play

setup.sh fetches and builds Mesa, vkd3d-proton, a wineserver for your Wine, the Windows SDK and VIctory itself. It names any tool it misses. Saves, caches and logs stay in local/.

The first play prepares every pipeline from your dump before the game opens: several minutes and about 6 GiB of cache. If you interrupt it, run play again and it resumes. With VICTORY_WARM=0 the game opens at once instead and each pipeline is made the first time it is drawn: missing geometry and stutter at first, less each run as the cache fills.

Settings go after the mode, or in run.conf. VICTORY_* variables put on the shell line before run.sh are cleared; put them after the mode instead:

Setting Effect
CONSOLE=series-s Series S profile
VICTORY_OUTPUT=2560x1440 Output size: 1280x720, 1664x936, 1920x1080, 2560x1440 or 3840x2160. 2560x1440 by default; with FSR 4, 3840x2160 unless set
VICTORY_FULLSCREEN=1 Borderless full screen
VICTORY_FULLSCREEN_RES=2560x1440 Its size, if not the screen's
VICTORY_FRAME_INTERVAL_MS=33.333 Frame interval in ms: 33.333 for a 30 fps cap, 16.667 for 60, 0 for no wait; unset follows the title
VICTORY_KBM_PC=1 PC-style keyboard and mouse controls (see Controls)
VICTORY_DUALSENSE=1 A DualSense on USB: the PS5 build's light bar, adaptive triggers and haptics (see Controls)
VICTORY_DUALSHOCK=1 A DualShock 4 on USB or Bluetooth: light bar colours only (no adaptive triggers or haptics)
VICTORY_RUMBLE_GAIN=2 Sony pad rumble strength, 0.5 to 8
VICTORY_DUALSENSE_RUMBLE=0 Leave a Sony pad's rumble motors alone
VICTORY_HAPTICS_GAIN_DB=8 DualSense haptics gain in dB (default 8)
VICTORY_PILLARBOX=1 With VICTORY_FULLSCREEN=1, black bars on a screen that is not 16:9 (ultrawide); uses a little more VRAM
VICTORY_BVH_BUILDER=0 No ray tracing
VICTORY_BVH_HARDWARE=0 Ray tracing without the card's own node test
VICTORY_AMBIENT_ALPHA=1 Dust and particles indoors: their light volume is held to this multiple of the light around, so the walls' sky light does not turn them into white specks and haze (0: the title's own)
VICTORY_PAGES=0 Title memory stays where it starts, RAM or card
VICTORY_PAGE_PASS_MS, VICTORY_PAGE_MOVE_MB Paging interval and pass budget, default 400 ms and 32 MiB
VICTORY_PAGE_ADAPTIVE=1 Adjust the discretionary page budget using migration time and render-thread present intervals
VICTORY_PAGE_SAMPLE=1, VICTORY_LOOP_PROBE=<shader hash prefix> Sample pages visited by a selected BVH traversal shader in a diagnostics build
VICTORY_POOL_MOVE=1 Drain occupied texture blocks under VRAM pressure
VICTORY_CARD_PULL=0 The CPU reads title memory on the card itself; 1: always by the card's copies. Unset, copies only where the CPU reads it under 1000 MB/s (the log's unified memory: the CPU reads line says how fast)
VICTORY_PAGES_SEEN=1 Also move to the card title pages it was only shown, never read hot (off: they filled VRAM at 8 MB/s)
KEEP_FREE=4096 MiB of RAM left to the rest of the system (default 8192); the game gets what is available less this, and stutters under 12 GiB
VICTORY_FSR_4K=performance FSR 4 (quality, balanced or performance) to VICTORY_OUTPUT, 4K unless set, after ./setup.sh fsr4
VICTORY_FIDELITYFX_FRAMEGEN=1 AMD frame generation (FSR 3.1) on top of VICTORY_FSR_4K. An interface the title presents on a plane of its own stays sharp; otherwise it is interpolated with the scene
VICTORY_FIDELITYFX_FRAMEGEN_DIRECT=1 With VICTORY_FIDELITYFX_FRAMEGEN=1: frame generation without AMD's proxy swap chain. The frames are generated and presented on VIctory's own queue, the real one about half a frame after the generated one, so the proxy's second queue does not share the card's only graphics queue with the game (RADV). Off by default; the log's stats: fg_direct line counts the presents and where the real frames landed
VICTORY_FIDELITYFX_FRAMEGEN_DEBUG=7 AMD's frame generation overlays, summed: 1 tear lines, 2 reset indicators, 4 debug view, 16 pacing lines (the proxy only)
VICTORY_UI_PLANE=3840x2160 Separate 4K HUD plane, including with host FSR
VICTORY_FSR_HOST=1 FSR 4 for the title's own upscaling at its own sizes, any profile (Series S: 720p to 1080p), after ./setup.sh fsr4
VICTORY_PRESENT_TIMING=1 Log time spent in Present, successful render presents, SDK-generated frames and DXGI display timestamps where available
VICTORY_LATE_FENCE=1 Submit behind in-flight cross-queue fences instead of draining on the CPU; helps some 1% lows
VICTORY_LOD_SCALE=0.35 How far detailed models reach: 1.0 (the title's) is 1,000 m, 0.1 is 145 m. 0.05 to 1.0; fewer draws, more pop-in
VICTORY_SMALL_CULL=2.5 Small objects go sooner the higher it is (the title's 1.0; 0.25 to 128)
VICTORY_VEHICLE_LOD_BIAS=0.5 Simpler distant vehicles the higher it is (the title's 0.0; -2 to 4)
VICTORY_SKIP_BINK=1 Skip the title's movies that play once (logos, intro); all skips the looping menu backgrounds too (they stay dark). Off by default
VICTORY_SKIP_INTRO=1 Skip only the intro movie, straight to the menu (the other movies play)
VICTORY_WARM=0 Open the game without preparing pipelines first; they are made at first use
VICTORY_WARM_JOBS=32 Processes that prepare the pipelines (1 to 64; default two thirds of the logical processors, at most 16)
VICTORY_WARM_SYNC=1 Sync each prepared pipeline's file to the disk as it is written, as before (slower)
VICTORY_PLACED_COPIED=1 Share GPU-written mips with compatible placed views, including views made after a copy. Off by default
VICTORY_KEEP_GPU_WRITTEN=1 Preserve individual GPU-written mips through deferred title uploads. Enabled by VICTORY_PLACED_COPIED=1 unless explicitly set to 0
VICTORY_GLASS_DITHER_OFF=1 House window glass: stop the stripes that blink every other frame
VICTORY_GLASS_DIRT_OPACITY=0.4 House window glass: the dirt opacity that removes the grey vertical drips; 0.4 keeps the panes' average brightness
VICTORY_KILL_CONTINUE=1 Keep killed pixels in their quad, for the frosted-glass blinking lines
VICTORY_PANEL=full Performance panel: full (everything), compact (graph and a summary line), fps (just the frame rate) or off. F3 hides it, Shift+F3 steps through the modes; the in-game menu changes it at once
VICTORY_LOG=warn How much VIctory logs: info (default), warn, error or off; quieter runs format and write less text. Also takes a filter such as victory_gpu=warn,info. VERBOSE=1 turns the Wine, vkd3d-proton and DXVK lines back on
VICTORY_PRESET=medium Settings preset: potato, low, medium, high or ultra (see Presets); individual settings override it
VICTORY_MENU=0 In-game settings menu on F1 (on by default; 0 turns it off): Up/Down select, Left/Right change, Del clear. It shows and edits the settings of this table in run.conf (commented or missing: not set), saves them at once, and they apply at the next start (the menu's "Save and restart game" row restarts for you, "Quit game" closes it). Every setting, with its description and default, is listed in run.conf.default: add a switch there and it appears in the menu
MUTE=1 No sound
LSFGVK_PROFILE=<profile> lsfg-vk 2.x frame generation with that profile of its conf.toml (LSFG_PROCESS=<entry> for lsfg-vk 1.0). Off by default

Presets

VICTORY_PRESET=potato|low|medium|high|ultra applies one of the presets in presets/<preset>.conf. The F1 menu lists the same five. Settings in run.conf or after the mode on the command line override the preset:

./run.sh play VICTORY_PRESET=medium

Presets do not change VICTORY_OUTPUT; choose the output size separately.

Preset Target Ray tracing FSR 4 Detail
potato 8 GB cards, slow CPUs off performance minimum LOD, shadows and volumetrics
low 8–12 GB cards off performance low LOD, shadows and foliage
medium 12–16 GB cards off balanced reduced LOD and shadow distance
high 16 GB cards off quality near-stock LOD without ray tracing, 1024 shadows, 2 cascades
ultra 16 GB+ cards on quality the title's own detail, ray tracing on

potato and low trade visible LOD and shadow pop for frame time; medium is the first profile that keeps tree and foliage detail close to stock.

Example in-world results on an RX 9070 XT 16 GB, Ryzen 7 7800X3D, 32 GB, 1920×1080 setup, from 3–5 minute runs. These are rough: the route and sample count differed between runs, and “min 5 s” is the worst 5-second window, not a per-frame 1% low.

Preset Avg FPS Median Min 5 s Look
potato 45.0 45.0 15.7 very visible LOD and shadow pop
low 39.5 40.9 23.2 some pop, much less than potato
medium 35.8 36.1 14.9 clean tree/foliage detail
high 34.8 34.8 21.2 clean, higher detail, no RT
ultra 28.5 27.4 15.8 stock detail, ray tracing on

The preset files are examples as well: copy their lines into run.conf, or select a preset in F1 and change individual rows afterwards. To compare runs, tools/session-fps.sh [log] [min-draws] summarises the in-world stats: frame samples (average, median, min, max and preparation/copy time).

The residency log includes the duration of the last pass and the number of pages demoted after a CPU access within two seconds of promotion. Use VICTORY_RT_STAMPS=1 in a diagnostics build to compare GPU dispatch timings between runs. The BVH page samples locate shader accesses and report residency at readback time. Compare runs with fixed paging settings to measure benefit.

Present timing reports successful render-thread calls and the SDK's generated count for the current generator. DXGI timestamps are optional and one sample can cover several display presents. Compare at the same save, output size and refresh rate. At 60 Hz with one generated frame per rendered frame, the target render interval is about 33.3 ms.

With VICTORY_NATIVE_GRAPHICS=1, native 0x1c8 pipelines cache variants by bound target formats, depth, sample count and topology. The NGG translator accepts fixed, directly drawn procedural triangles with a three-vertex, one-primitive allocation and literal connectivity (0, 1, 2).

To compare raw SRV load reuse across branches, use VICTORY_SHADER_OPT=63 for the default passes and VICTORY_SHADER_OPT=191 to add the experimental pass. The shader cache keys include this setting. Compare the same capture with warm pipelines and check both the resulting image and GPU frame time.

Compare an Xbox frame with a Victory recording

The diagnostics build can compare the images in a completed VICTORY_RECORD capture with SDR PNGs from the console. Match the game build, scene, camera, output dimensions, SDR color space and frame order before comparing. For one present, pass one opaque 8-bit RGB PNG. For a sequence captured with VICTORY_RECORD_FRAMES=N, pass a directory containing frame-1.png through frame-N.png, one Xbox reference per recorded present.

victory replay compare-xbox capture-1 xbox-frames --out comparison

Open comparison/index.html to see the Xbox reference, recorded Victory image and difference mask for each present. By default any RGB difference counts. --threshold 3 highlights a pixel when any channel differs by more than three 8-bit values. The report directory must be new.

The replay traces up to six regional peak differences per frame. Click an image for coordinates, or select exact output pixels on a new run with --pixel 640,360 --pixel 900,500. The table shows the last observed change at each probe. The command log records list and command indices, pipeline names where available, and raw texel values before and after each change. These probes observe the presented texture. A final copy can lead back to an intermediate texture through the ordinary replay --pixel tool. Writes of identical values have no observable change. Each traced present reports whether its replay reproduced the recorded RGB image. Image comparison also works when GPU replay is unavailable. The comparison uses the capture and reference PNGs independently of a game installation.

Benchmark

./run.sh play VICTORY_BENCH=rt (or nort for no ray tracing) runs a PortWatch benchmark: Series X, FSR 4 Quality to 3840x2160, no frame generation, intro skipped, full panel. It presses Enter through the first minute, closes after VICTORY_BENCH_MINUTES (5 by default, 1 to 240), saves screenshot.png and bench_stats.txt under local/benchmark/<date>-rt|nort/, writes bench_results.txt, and restarts with your settings. A crash writes the results and restarts too.

Put these after the mode like other settings, or in run.conf; a VICTORY_...=... ./run.sh prefix is cleared.

Controls

Input: a gamepad connected or the keyboard as a pad while the window has focus:

Keys Pad
W A S D / I J K L left / right stick
arrows D-pad
Enter, Backspace, X, Y A, B, X, Y
Q / E, Z / C shoulders, triggers
F / H stick clicks
Esc, Tab Menu, View

With VICTORY_KBM_PC=1 (off by default), the keyboard and mouse use a PC-style layout:

Input Pad
W A S D left stick
I J K L right stick fallback (mouse look when locked)
mouse right stick; F2 or the backtick/tilde key locks/unlocks; Esc/P unlocks
left mouse / right mouse RT / LT
Left Shift / Right Shift, Enter A (sprint, confirm)
Space, X X (jump, climb, vault)
R, Backspace B (reload/melee, back/cancel)
F Y (enter/exit vehicle)
Tab LB (weapon wheel)
Q RB (cover/handbrake)
Left Ctrl / Right Ctrl L3 (crouch/stealth/horn)
C, Caps Lock, H, middle mouse R3 (look behind/special)
E, Right arrow D-pad Right (interact/talk)
Up arrow, M D-pad Up (phone/menu)
Down arrow, Z D-pad Down (character wheel/minimap)
Left arrow, G D-pad Left (throw/context left)
Esc Menu (also unlocks mouse look)
P Pause/Map (also unlocks mouse look)
V View

VICTORY_MOUSE_SENS scales mouse look; VICTORY_MOUSE_INVERT_Y=1 inverts Y.

With VICTORY_DUALSENSE=1 (off by default), a DualSense shows what the PS5 build of the game sends it: the light bar's colours, the adaptive triggers' effects, and the haptics on its actuators. Rumble stays as it is and adds to the haptics, as on the PS5. The light bar and triggers are written to the controller's /dev/hidrawN, which must be writable by you (Steam's udev rules do that); the haptics play on channels 3 and 4 of its USB audio device. Wired (USB) only: the light bar and triggers over Bluetooth are untested, and the haptics need USB. VICTORY_HAPTICS_GAIN_DB sets the haptics' strength (8 by default); VICTORY_HAPTICS_LOG=1 logs their levels.

With VICTORY_DUALSHOCK=1 (off by default), a DualShock 4 on USB or Bluetooth shows the PS5 build's light bar colours. It has no adaptive triggers or actuator haptics; those need a DualSense.

VICTORY_RUMBLE_GAIN scales either pad's motors (2 by default); VICTORY_DUALSENSE_RUMBLE=0 leaves them alone.

Wine

A crash in ntdll.dll (RtlWakeAddressSingle, a read near null) or a freeze at a random moment, minutes or hours in, is Wine's wait-on-address wake race, fixed in Wine by 81e52628b (2026-10-14). tools/wake-race.sh tells whether the Wine or Proton you run on has it; if it does, use one that has that commit.

Patches

patches/ holds what changes in Mesa, vkd3d-proton and Wine (<name>.<submodule>.patch: in a submodule of it). Edit under deps/<name>, rebuild with ./setup.sh <name>, save with tools/patch.sh <name>.

Repacks and third-party distributions

This project does not collaborate with, endorse or support groups that repackage it with proprietary code, assets, keys or cracks. A package that bundles any of those is not this project, and problems caused by one are out of scope. Do not ask for, link to or distribute such packages here.

If you share a build, share this repository's source and let each user supply their own copy. Do not put proprietary files in a release archive.

Credits

VIctory by Marvisak and contributors, through avatarmanz, fxceless, DexNom, Belobug, FQY55kai, myokex, triippywhale, trustno1-coder, PastiiJay, Geckomacabre, cxy0072019-sketch and gassy for being a larper

License

GPL-3.0-or-later. See LICENSE.