Files
cool_fox_newer/scripts/play.ps1
DoubleGhosty 970dc2bc33 RDNA 2 on Windows: the relay all off by default, as VICTORY_RELAY=0; play.ps1 sets the poke
79b07f21 turned off only the relay thread (host::relay). shadow::relay
stayed on when VICTORY_RELAY is unset, so late_stage picked stage 3 from
it, and on an RX 6750 XT under Windows that half-off state still lost the
device about 20 s into the world, where VICTORY_RELAY=0 runs 14 minutes
(Kr4tzin, #139). Under Wine (RADV, RX 6600) the half-off state keeps the
device and is about 30% faster than all off (japel, #139), so it stays
there. The host is asked which card it is before the choice is made.

scripts/play.ps1 still set VICTORY_RELAY=2, and it clears every
VICTORY_* variable but the paths, so VICTORY_POKE never reached its runs
and the title's watchdog ended them at world entry (KingKaom, #161). It
no longer sets the relay and sets the launchers' poke.
2026-11-29 14:50:02 +01:00

78 lines
4.7 KiB
PowerShell

# Starts the title with the settings this fork is played with (README.md, "How to run it").
# scripts\play.ps1 -Exe <path of your own copy's executable>
# -Safe without the newer, faster ways (the first thing to try when something is wrong)
# -RayTracing the title's own ray-traced indirect light: lit interiors, about a third slower
# -SkipRayWork without -RayTracing: also skips the passes that only prepare for it (scripts/rt_work_off_hashes.txt)
# -Build target\diag (the default, the build all measurements are of) or target\release
# -More other settings: -More @{VICTORY_PANEL='1'}
# -Record writes down the pipelines the title creates (VICTORY_PIPELINE_BOOK=1), for -Warm
# -Warm with the same settings, makes the pipelines earlier runs drew with (victory warm --used), no title
# -Shaders with the same settings, translates these shader archives (victory shaders <paths>), no title
# Run it from a normal window, not as administrator: the driver then keeps its shader cache elsewhere.
[CmdletBinding(DefaultParameterSetName = 'Run')]
param(
[Parameter(Mandatory, ParameterSetName = 'Run')][string]$Exe,
[Parameter(Mandatory, ParameterSetName = 'Warm')][switch]$Warm,
[Parameter(Mandatory, ParameterSetName = 'Shaders')][string[]]$Shaders,
[switch]$Record,
[switch]$Safe,
[switch]$RayTracing,
[switch]$SkipRayWork,
[ValidateSet('diag', 'release')][string]$Build = 'diag',
[hashtable]$More = @{}
)
$settings = @{
VICTORY_TEXTURE_NO_WAIT = '1'; VICTORY_WIDE_BACK = '1'; VICTORY_CARD_REHASH_RUNS = '1'
VICTORY_JOIN_COPIES = '1'; VICTORY_INDIRECT_WINDOW = '1'; VICTORY_RELAY_COPY = '1'; VICTORY_CARD_STEPS = '2'
VICTORY_INDIRECT_BATCH = '2'; VICTORY_MAP_THREADS = '1'; VICTORY_TITLE_PRIORITIES = '0'; VICTORY_CARD_AWAKE = '1'
VICTORY_SHOW_AFTER = '1'; VICTORY_AMBIENT = '0.8'; VICTORY_D3D12_DRED = 'light'; VICTORY_SKIP_PIPELINES = 'none'
VICTORY_LEVELS_ON_DEMAND = '1'; VICTORY_CARD_BUFFERS_MIN_KB = '64'
VICTORY_PORT_GUARD = '1'; VICTORY_PORT_JOURNAL = '1'
VICTORY_LIBRARY_STORE_LATER = '1'; VICTORY_PIPELINE_WAIT_MS = '0'
# The title's 30 s watchdog held while frames are slow (#80), as the launchers do.
VICTORY_POKE = 'b99f876b74d4a77f@71b6330:1'
}
if ($Safe) {
$settings.VICTORY_UNDER_WIDE = '0'; $settings.VICTORY_LAND_ECHO = '0'
$settings.VICTORY_PORT_GUARD = '0'; $settings.VICTORY_PORT_JOURNAL = '0'
} else {
$settings.VICTORY_THIN = '1'; $settings.VICTORY_JOIN_PARTS = '8'; $settings.VICTORY_UPLOAD_AHEAD = '1'
}
if ($RayTracing) { $settings.VICTORY_BVH_BUILDER = '1' }
# Skinning for the acceleration structures and the probes' gather copy run whether or not anything traces rays:
# 73 of 128 ms of the card's frame on an RTX 3050 Laptop 4 GB (Dathinel/victory-4gb). Not with -RayTracing, which reads them.
if ($SkipRayWork -and -not $RayTracing) {
$list = Join-Path $PSScriptRoot 'rt_work_off_hashes.txt'
if (-not (Test-Path -LiteralPath $list)) { Write-Host "No $list."; exit 1 }
$settings.VICTORY_SKIP_PIPELINES = (Get-Content -LiteralPath $list -Raw).Trim()
}
if ($Record) { $settings.VICTORY_PIPELINE_BOOK = '1' }
foreach ($k in $More.Keys) { $settings[$k] = $More[$k] }
$victory = Join-Path $PSScriptRoot "..\target\$Build\victory.exe"
if (-not (Test-Path -LiteralPath $victory)) { Write-Host "No $victory. Build it first (README.md)."; exit 1 }
if ($PSCmdlet.ParameterSetName -eq 'Run' -and -not (Test-Path -LiteralPath $Exe)) { Write-Host "No $Exe."; exit 1 }
# (Other settings left over in this window go; where your files are stays.)
$paths = 'VICTORY_CONFIG', 'VICTORY_GAME_DIR', 'VICTORY_CACHE_DIR', 'VICTORY_DATA_DIR'
Get-ChildItem Env:VICTORY_* | Where-Object { $_.Name -notin $paths } | ForEach-Object { Remove-Item "Env:$($_.Name)" }
foreach ($k in $settings.Keys) { Set-Item "Env:$k" $settings[$k] }
# An archive as written first (shader[1].rpf), else a pattern (stage*.rpf); one that matches nothing stops here.
if ($Shaders) {
$Shaders = @(foreach ($s in $Shaders) {
if (Test-Path -LiteralPath $s) { $found = @(Resolve-Path -LiteralPath $s) }
else { $found = @(try { Resolve-Path $s -ErrorAction Stop } catch {}) }
if (-not $found) { Write-Host "No $s."; exit 1 }
$found.Path
})
}
if ($Exe) { $Exe = (Resolve-Path -LiteralPath $Exe).Path }
Push-Location -LiteralPath (Join-Path $PSScriptRoot '..') # victory.toml is looked for here
try {
switch ($PSCmdlet.ParameterSetName) {
'Warm' { & $victory warm --used; $code = $LASTEXITCODE }
'Shaders' { & $victory shaders @Shaders; $code = $LASTEXITCODE }
default { & $victory run $Exe --execute; $code = $LASTEXITCODE }
}
} catch { Write-Host "$victory did not run: $_"; $code = 1 } finally { Pop-Location }
exit $code