Opt-in, inert-by-default performance work for 6 GB VRAM / 16 GB RAM PCs: - VICTORY_RAM_PRESSURE_MB: physical-RAM-gated fence-safe idle trims - VICTORY_LIST_ALLOC_CAP_MB: shed D3D12 command-allocator high-water peak - VICTORY_TRIM_MIN_MS: hold back zero-yield heavy sweeps to stop frame spikes - VICTORY_JOIN_FEWER / RELAY_EACH / TABLED_BITS: submission-path latency toggles - diagnostics-only per-frame refresh/read/dip timers (copystat/dipstat) - play-6gb.ps1 + play-6gb.cmd launcher preset (OPT=447, INPLACE=0, the above) The title is referred to only as "the title" throughout.
317 lines
15 KiB
PowerShell
317 lines
15 KiB
PowerShell
<#
|
|
.SYNOPSIS
|
|
Portable launcher tuned for 6-8 GB VRAM GPUs and 16 GB RAM PCs (windowed by default).
|
|
.EXAMPLE
|
|
powershell -ExecutionPolicy Bypass -File scripts\play-6gb.ps1 -Exe 'D:\path\to\your.exe'
|
|
.EXAMPLE
|
|
powershell -ExecutionPolicy Bypass -File scripts\play-6gb.ps1 -Exe 'D:\path\to\your.exe' -NoFrameGen
|
|
.EXAMPLE
|
|
powershell -ExecutionPolicy Bypass -File scripts\play-6gb.ps1 -Exe 'D:\path\to\your.exe' -TuneSettings
|
|
#>
|
|
param(
|
|
[string]$Exe = '',
|
|
[ValidateSet('1080', '936', '720')][string]$Output = '1080',
|
|
[ValidateSet('ultraperformance', 'performance', 'balanced', 'quality', 'dlaa', 'off')][string]$Dlss = 'ultraperformance',
|
|
[ValidateRange(0, 2)][int]$DropMips = 1,
|
|
[switch]$FrameGen,
|
|
[switch]$NoFrameGen,
|
|
[ValidateSet('fsr', 'dlss', 'auto')][string]$FgType = 'fsr',
|
|
[ValidateRange(2, 6)][int]$FrameGenX = 2,
|
|
[switch]$TuneSettings,
|
|
[switch]$Preload,
|
|
[string]$DataDir = '',
|
|
[string]$CacheDir = '',
|
|
[string]$LogFile = ''
|
|
)
|
|
|
|
$ErrorActionPreference = 'Continue'
|
|
$repo = Split-Path -Parent $PSScriptRoot
|
|
$victory = Join-Path $repo 'target\release\victory.exe'
|
|
$homeDir = if ($env:VICTORY_HOME) { $env:VICTORY_HOME } else { Join-Path $env:LOCALAPPDATA 'victory' }
|
|
$cacheDir = if ($CacheDir) { $CacheDir } elseif ($env:VICTORY_CACHE_DIR) { $env:VICTORY_CACHE_DIR } else { Join-Path $homeDir 'cache' }
|
|
$dataDir = if ($DataDir) { $DataDir } elseif ($env:VICTORY_DATA_DIR) { $env:VICTORY_DATA_DIR } else { Join-Path $homeDir 'data' }
|
|
$menuFile = Join-Path $homeDir 'victory-settings.txt'
|
|
$slDir = if ($env:VICTORY_STREAMLINE_DIR) { $env:VICTORY_STREAMLINE_DIR } else { Join-Path $repo 'nvidia-sdk\Streamline\bin\x64' }
|
|
$fxDir = if ($env:VICTORY_FIDELITYFX_DIR) { $env:VICTORY_FIDELITYFX_DIR } else { Join-Path $repo 'amd-sdk\FidelityFX\bin' }
|
|
|
|
# Resolve game file (.exe) from -Exe, VICTORY_GAME_DIR, or victory.toml
|
|
if (-not $Exe -and $env:VICTORY_GAME_DIR -and (Test-Path -LiteralPath $env:VICTORY_GAME_DIR)) {
|
|
$cand = Get-ChildItem -LiteralPath $env:VICTORY_GAME_DIR -Filter '*.exe' -File -ErrorAction SilentlyContinue | Sort-Object Length -Descending | Select-Object -First 1
|
|
if ($cand) { $Exe = $cand.FullName }
|
|
}
|
|
if (-not $Exe) {
|
|
$toml = Join-Path $repo 'victory.toml'
|
|
if (Test-Path -LiteralPath $toml) {
|
|
$m = Select-String -Path $toml -Pattern '^\s*game_dir\s*=\s*"([^"]+)"' | Select-Object -First 1
|
|
if ($m -and (Test-Path -LiteralPath $m.Matches[0].Groups[1].Value)) {
|
|
$cand = Get-ChildItem -LiteralPath $m.Matches[0].Groups[1].Value -Filter '*.exe' -File -ErrorAction SilentlyContinue | Sort-Object Length -Descending | Select-Object -First 1
|
|
if ($cand) { $Exe = $cand.FullName }
|
|
}
|
|
}
|
|
}
|
|
if (-not $Exe -or -not (Test-Path -LiteralPath $Exe)) {
|
|
Write-Host 'Game file (.exe) not found. Pass it with -Exe:'
|
|
Write-Host " powershell -ExecutionPolicy Bypass -File scripts\play-6gb.ps1 -Exe 'D:\path\to\your.exe'"
|
|
exit 1
|
|
}
|
|
|
|
# Build release binary automatically on first run
|
|
if (-not (Test-Path -LiteralPath $victory)) {
|
|
Write-Host 'Building release binary (first run only, takes a few minutes)...'
|
|
Push-Location $repo
|
|
try {
|
|
& cargo build --release --locked -j 4 -p victory
|
|
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
|
|
} finally {
|
|
Pop-Location
|
|
}
|
|
}
|
|
|
|
New-Item -ItemType Directory -Force $cacheDir | Out-Null
|
|
New-Item -ItemType Directory -Force $dataDir | Out-Null
|
|
|
|
# Read saved F1 menu overrides
|
|
$menu = [ordered]@{}
|
|
if (Test-Path -LiteralPath $menuFile) {
|
|
foreach ($line in Get-Content -LiteralPath $menuFile) {
|
|
if ($line -match '^\s*(VICTORY_[A-Z0-9_]+)\s*=(.*)$') {
|
|
$menu[$Matches[1]] = $Matches[2].Trim()
|
|
}
|
|
}
|
|
}
|
|
|
|
$seriesS = $true
|
|
$res = '1080to1440'
|
|
$sRes = if ($Dlss -eq 'ultraperformance') { '360' } elseif ($Dlss -eq 'balanced') { '626' } elseif ($Dlss -eq 'quality') { '720' } elseif ($Dlss -eq 'dlaa') { '1080' } else { '540' }
|
|
$dlssMode = $Dlss
|
|
$fgOn = if ($NoFrameGen) { $false } else { $true }
|
|
$timesWanted = $FrameGenX
|
|
$fgKind = $FgType
|
|
$fpsWanted = 1000
|
|
|
|
if ($menu.Contains('VICTORY_MENU_CONSOLE')) { $seriesS = $menu['VICTORY_MENU_CONSOLE'] -eq 'series-s' }
|
|
if ($menu['VICTORY_MENU_RES'] -in '1440', '1080to1440', '4k') { $res = $menu['VICTORY_MENU_RES'] }
|
|
if ($menu['VICTORY_MENU_S_RES'] -in '1080', '720', '626', '540', '360') { $sRes = $menu['VICTORY_MENU_S_RES'] }
|
|
if ($menu['VICTORY_MENU_DLSS'] -in 'off', 'dlaa', 'quality', 'balanced', 'performance', 'ultraperformance') { $dlssMode = $menu['VICTORY_MENU_DLSS'] }
|
|
if ($seriesS -and $dlssMode -ne 'off' -and $menu.Contains('VICTORY_MENU_S_RES')) {
|
|
$sMap = @{ '1080' = 'dlaa'; '720' = 'quality'; '626' = 'balanced'; '540' = 'performance'; '360' = 'ultraperformance' }
|
|
if ($sMap.ContainsKey($sRes)) { $dlssMode = $sMap[$sRes] }
|
|
}
|
|
if ($menu.Contains('VICTORY_MENU_FRAMEGEN')) {
|
|
$fgOn = $menu['VICTORY_MENU_FRAMEGEN'] -match '^[1-6]$'
|
|
if ($menu['VICTORY_MENU_FRAMEGEN'] -match '^[2-6]$') { $timesWanted = [int]$menu['VICTORY_MENU_FRAMEGEN'] }
|
|
}
|
|
if ($menu['VICTORY_MENU_FG_TYPE'] -in 'auto', 'dlss', 'fsr') { $fgKind = $menu['VICTORY_MENU_FG_TYPE'] }
|
|
if ($menu['VICTORY_MENU_FPS'] -match '^\d+$' -and [int]$menu['VICTORY_MENU_FPS'] -ge 1 -and [int]$menu['VICTORY_MENU_FPS'] -le 1000) {
|
|
$fpsWanted = [int]$menu['VICTORY_MENU_FPS']
|
|
}
|
|
|
|
$settings = [ordered]@{
|
|
VICTORY_CACHE_DIR = $cacheDir
|
|
VICTORY_DATA_DIR = $dataDir
|
|
VICTORY_LOG = 'info'
|
|
|
|
# Shader optimiser level (447 = WATERFALL | HOIST_HANDLES): verified GPU win
|
|
VICTORY_SHADER_OPT = '447'
|
|
# Physical-RAM-pressure trimming for 16 GB PCs (4096 = start eviction ~2 GB ahead of the cliff; A/B paging max -27%)
|
|
VICTORY_RAM_PRESSURE_MB = '4096'
|
|
# Hold back zero-yield (<1 MiB freed) heavy sweeps so churn stops spiking frames (A/B paging churn -4.3x)
|
|
VICTORY_TRIM_MIN_MS = '5000'
|
|
# Submission-path toggles: flatten frame-time spikes (A/B mean 137 -> 120 ms, fewer slow outliers)
|
|
VICTORY_SUBMIT_FRAMES = '3'
|
|
VICTORY_JOIN_FEWER = '1'
|
|
VICTORY_RELAY_EACH = '1'
|
|
VICTORY_TABLED_BITS = '1'
|
|
|
|
# CPU threading & submission (FAST_CORES=0 uses both P+E cores on hybrid CPUs)
|
|
VICTORY_THIN = '1'
|
|
VICTORY_THIN_THREADS = '8'
|
|
VICTORY_LAND_OFF_SUBMIT = '1'
|
|
VICTORY_FAULT_UNLOCKED = '1'
|
|
VICTORY_GUARD_HOT = '50'
|
|
VICTORY_FRESH_OPEN = '0'
|
|
VICTORY_ASYNC_SUBMIT = '1'
|
|
VICTORY_JOIN_PARTS = '8'
|
|
VICTORY_RELAY = '2'
|
|
VICTORY_RELAY_COPY = '1'
|
|
VICTORY_WIDE_BACK = '1'
|
|
VICTORY_CARD_REHASH_RUNS = '1'
|
|
VICTORY_JOIN_COPIES = '1'
|
|
VICTORY_CARD_STEPS = '2'
|
|
VICTORY_CARD_AWAKE = '1'
|
|
VICTORY_CARD_SPANS = '0'
|
|
VICTORY_CARD_BUFFERS_MIN_KB = '64'
|
|
VICTORY_CARD_BUFFERS_MB = '1280'
|
|
VICTORY_CARD_ROOM_FOR_TARGETS_MB = '1024'
|
|
VICTORY_CARD_WINDOWS_MB = '0'
|
|
VICTORY_PORT_CONSTANTS = '1'
|
|
VICTORY_INDIRECT_WINDOW = '1'
|
|
VICTORY_INDIRECT_BATCH = '2'
|
|
VICTORY_UPLOAD_AHEAD = '1'
|
|
VICTORY_SHOW_AFTER = '1'
|
|
VICTORY_MAP_THREADS = '1'
|
|
VICTORY_FAST_CORES = '0'
|
|
# In-place off: A3 showed it places only ~185 MB here and INPLACE=0 keeps the GPU win
|
|
VICTORY_INPLACE = '0'
|
|
VICTORY_TEXSPK_PASS_MS = '8'
|
|
VICTORY_PASSES_HOT = '1'
|
|
VICTORY_HELPER_PRIORITY = '1'
|
|
VICTORY_WC_NO_BACK = '1'
|
|
VICTORY_WC_NO_BACK_MIN_KB = '1024'
|
|
VICTORY_GPU_RO_SKIP = '1'
|
|
VICTORY_SECTION_MB = '2'
|
|
VICTORY_SOFT_VIEWS = 'copies'
|
|
VICTORY_COPY_BESIDE = '1'
|
|
VICTORY_STORE_BESIDE = '1'
|
|
VICTORY_WINDOWS_VRAM_PERCENT = '85'
|
|
|
|
# Texture streaming + 6 GB VRAM mip scale
|
|
VICTORY_TEXTURE_POOL = '1'
|
|
VICTORY_RIPE_BLOCKS = '0'
|
|
VICTORY_TEXTURE_NO_WAIT = '1'
|
|
VICTORY_TEXTURE_CATCHUP = '0'
|
|
VICTORY_TEXTURE_STAGE_MS = '16'
|
|
VICTORY_LEVELS_ON_DEMAND = '0'
|
|
VICTORY_PRELUDE_UPLOADS = '1'
|
|
VICTORY_SHOW_NEW_LATER = '1'
|
|
VICTORY_POOL_SMALL = '0'
|
|
VICTORY_TABLED_REREAD = '1'
|
|
VICTORY_QUEUE_HOST_TEXTURES = '0'
|
|
VICTORY_TEXTURE_DROP_MIPS = [string]$DropMips
|
|
|
|
# Descriptor heap fast sync
|
|
VICTORY_HEAP_SYNC_FIRST = '1'
|
|
VICTORY_SYNC_IN_PLACE = '1'
|
|
VICTORY_SPANS_QUICK = '1'
|
|
VICTORY_SYNC_FINE = '1'
|
|
VICTORY_HEAP_SYNC_AT_SUBMIT = '1'
|
|
|
|
# Visuals (windowed by default; toggleable in F1 menu)
|
|
VICTORY_AMBIENT = '0.8'
|
|
VICTORY_AMBIENT_AIR = '1.5'
|
|
VICTORY_AMBIENT_SHADE = '0.5,0.5'
|
|
VICTORY_AMBIENT_SPECULAR = '1'
|
|
VICTORY_WATER_LIGHT = '1'
|
|
VICTORY_EARLY_DEPTH = '1'
|
|
VICTORY_DEPTH_PLANE_NOW = '1'
|
|
# Heat haze + decal defrag (visually safe)
|
|
VICTORY_LEAVE_OUT = '02384a60fda6f2d0,731a39171b568298'
|
|
|
|
# Pipeline caching + short wait cap to prevent 500 ms shader-compile freezes
|
|
VICTORY_PIPELINE_BOOK = '1'
|
|
VICTORY_PIPELINE_WAIT_MS = '50'
|
|
|
|
# Memory stack (SLOT_EVICT sits just above ROOM% so idle textures evict cleanly when roaming)
|
|
VICTORY_SLOT_EVICT = '1'
|
|
VICTORY_SLOT_EVICT_PERCENT = '92'
|
|
VICTORY_SLOT_EVICT_LOW_PERCENT = '82'
|
|
VICTORY_ALLOCATOR_TRIM = '1'
|
|
VICTORY_BUDGET_PACK = '1'
|
|
# Shed the loading/cutscene command-allocator high-water peak (~GBs) under RAM pressure
|
|
VICTORY_LIST_ALLOC_CAP_MB = '512'
|
|
VICTORY_TEARING = '1'
|
|
VICTORY_FPS_LINE = '1'
|
|
}
|
|
|
|
if ($TuneSettings) {
|
|
$xmlPath = Join-Path $dataDir '7952987A\storage\settings\settings.xml'
|
|
if (Test-Path -LiteralPath $xmlPath) {
|
|
$bak = "$xmlPath.bak"
|
|
if (-not (Test-Path -LiteralPath $bak)) { Copy-Item -LiteralPath $xmlPath -Destination $bak }
|
|
$c = Get-Content -LiteralPath $xmlPath -Raw
|
|
$c = $c -replace '<motionBlur value="true" />','<motionBlur value="false" />'
|
|
$c = $c -replace '<rtDynamicShadows value="true" />','<rtDynamicShadows value="false" />'
|
|
$c = $c -replace '<shadowParticleShadows value="true" />','<shadowParticleShadows value="false" />'
|
|
$c = $c -replace '<ssroSampleCount value="2" />','<ssroSampleCount value="1" />'
|
|
$c = $c -replace '<grassLod value="[^"]+" />','<grassLod value="0.350000" />'
|
|
$c = $c -replace '<lodScale value="[^"]+" />','<lodScale value="0.750000" />'
|
|
$c = $c -replace '<smallCullThreshold value="[^"]+" />','<smallCullThreshold value="2.000000" />'
|
|
$c = $c -replace '<waterReflectionResX value="512" />','<waterReflectionResX value="256" />'
|
|
$c = $c -replace '<waterReflectionResY value="256" />','<waterReflectionResY value="128" />'
|
|
$c = $c -replace '<width value="3840" />','<width value="1920" />'
|
|
$c = $c -replace '<height value="2160" />','<height value="1080" />'
|
|
Set-Content -LiteralPath $xmlPath -Value $c -NoNewline
|
|
}
|
|
}
|
|
|
|
if ($Output -eq '936') { $settings['VICTORY_OUTPUT'] = '1664x936' }
|
|
elseif ($Output -eq '720') { $settings['VICTORY_OUTPUT'] = '1280x720' }
|
|
|
|
if (-not $seriesS) {
|
|
if ($res -eq '1440') { $settings['VICTORY_NATIVE_1440P'] = '1' }
|
|
elseif ($res -eq '1080to1440') { $settings['VICTORY_RENDER_1080P'] = '1' }
|
|
}
|
|
|
|
if ($dlssMode -ne 'off' -and (Test-Path (Join-Path $slDir 'sl.interposer.dll'))) {
|
|
$settings['VICTORY_DLSS'] = '1'
|
|
$settings['VICTORY_DLSS_MODE'] = $dlssMode
|
|
$settings['VICTORY_STREAMLINE_DIR'] = $slDir
|
|
}
|
|
|
|
$barMb = '0'
|
|
# Fixed texture-queue room line (verified winning setting); was DropMips-derived 70/65
|
|
$roomPct = '75'
|
|
|
|
if ($dlssMode -ne 'off' -and $fgOn) {
|
|
if ($fgKind -ne 'dlss' -and (Test-Path (Join-Path $fxDir 'amd_fidelityfx_framegeneration_dx12.dll'))) {
|
|
$settings['VICTORY_FSR_FRAMEGEN'] = '1'
|
|
$settings['VICTORY_FIDELITYFX_DIR'] = $fxDir
|
|
$settings['VICTORY_FRAMEGEN_X'] = [string]$timesWanted
|
|
$settings['VICTORY_TEXTURE_ROOM_PERCENT'] = $roomPct
|
|
$settings['VICTORY_WINDOWS_BAR_MB'] = $barMb
|
|
} elseif ($fgKind -eq 'dlss') {
|
|
$settings['VICTORY_FRAMEGEN'] = '1'
|
|
$settings['VICTORY_FRAMEGEN_X'] = [string]$timesWanted
|
|
$settings['VICTORY_TEXTURE_ROOM_PERCENT'] = $roomPct
|
|
$settings['VICTORY_WINDOWS_BAR_MB'] = $barMb
|
|
}
|
|
} else {
|
|
$settings['VICTORY_TEXTURE_ROOM_PERCENT'] = $roomPct
|
|
$settings['VICTORY_WINDOWS_BAR_MB'] = $barMb
|
|
}
|
|
|
|
$settings['VICTORY_FRAME_INTERVAL_US'] = [string][int][math]::Round(1000000 / $fpsWanted)
|
|
|
|
# Apply saved F1 menu overrides
|
|
foreach ($k in $menu.Keys) {
|
|
if ($k -like 'VICTORY_MENU_*') { continue }
|
|
if ($menu[$k]) { $settings[$k] = $menu[$k] } else { $settings.Remove($k) }
|
|
}
|
|
|
|
$console = if ($seriesS) { 'series-s' } else { 'series-x' }
|
|
$settings['VICTORY_MENU_CONSOLE'] = $console
|
|
$settings['VICTORY_MENU_RES'] = $res
|
|
$settings['VICTORY_MENU_S_RES'] = $sRes
|
|
$settings['VICTORY_MENU_DLSS'] = if ($settings.Contains('VICTORY_DLSS')) { $dlssMode } else { 'off' }
|
|
$settings['VICTORY_MENU_FRAMEGEN'] = if ($settings.Contains('VICTORY_FSR_FRAMEGEN') -or $settings.Contains('VICTORY_FRAMEGEN')) { [string]$timesWanted } else { '0' }
|
|
$settings['VICTORY_MENU_FG_TYPE'] = $fgKind
|
|
$settings['VICTORY_MENU_FPS'] = [string]$fpsWanted
|
|
$settings['VICTORY_MENU_FILE'] = $menuFile
|
|
$settings['VICTORY_MENU_PLAY'] = $MyInvocation.MyCommand.Path
|
|
$settings['VICTORY_MENU_ARGS'] = "-Exe '$($Exe -replace "'", "''")'"
|
|
|
|
Get-ChildItem Env:VICTORY_* -ErrorAction SilentlyContinue | ForEach-Object { Remove-Item "Env:$($_.Name)" }
|
|
foreach ($k in $settings.Keys) { Set-Item "Env:$k" $settings[$k] }
|
|
|
|
Write-Host "Launching VIctory (6 GB VRAM / 16 GB RAM preset)..."
|
|
Write-Host " Window: $(if ($settings['VICTORY_OUTPUT']) { $settings['VICTORY_OUTPUT'] } else { '1920x1080' }) | Console: $console | DLSS: $($settings['VICTORY_MENU_DLSS']) | FG: $($settings['VICTORY_MENU_FRAMEGEN'])x ($fgKind) | DropMips: $($settings['VICTORY_TEXTURE_DROP_MIPS'])"
|
|
Write-Host " Home: $homeDir"
|
|
Write-Host " Tip: Press F1 for Settings Menu, F3 for Stats Panel."
|
|
Write-Host ""
|
|
|
|
Push-Location $repo
|
|
try {
|
|
if ($Preload) {
|
|
Write-Host "Preloading shaders into $cacheDir..."
|
|
& $victory preload ([IO.Path]::GetDirectoryName($Exe))
|
|
}
|
|
if ($LogFile) {
|
|
& $victory run $Exe --console $console --execute 2> $LogFile
|
|
} else {
|
|
& $victory run $Exe --console $console --execute
|
|
}
|
|
exit $LASTEXITCODE
|
|
} finally {
|
|
Pop-Location
|
|
}
|