2
0

play.ps1 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. # Starts the title with the settings this fork is played with (README.md, "How to run it").
  2. # scripts\play.ps1 -Exe <path of your own copy's executable>
  3. # -Safe without the newer, faster ways (the first thing to try when something is wrong)
  4. # -RayTracing the title's own ray-traced indirect light: lit interiors, about a third slower
  5. # -Build target\diag (the default, the build all measurements are of) or target\release
  6. # -More other settings: -More @{VICTORY_PANEL='1'}
  7. # Run it from a normal window, not as administrator: the driver then keeps its shader cache elsewhere.
  8. param(
  9. [Parameter(Mandatory)][string]$Exe,
  10. [switch]$Safe,
  11. [switch]$RayTracing,
  12. [ValidateSet('diag', 'release')][string]$Build = 'diag',
  13. [hashtable]$More = @{}
  14. )
  15. $settings = @{
  16. VICTORY_TEXTURE_NO_WAIT = '1'; VICTORY_RELAY = '2'; VICTORY_WIDE_BACK = '1'; VICTORY_CARD_REHASH_RUNS = '1'
  17. VICTORY_JOIN_COPIES = '1'; VICTORY_INDIRECT_WINDOW = '1'; VICTORY_RELAY_COPY = '1'; VICTORY_CARD_STEPS = '2'
  18. VICTORY_INDIRECT_BATCH = '2'; VICTORY_MAP_THREADS = '1'; VICTORY_TITLE_PRIORITIES = '0'; VICTORY_CARD_AWAKE = '1'
  19. VICTORY_SHOW_AFTER = '1'; VICTORY_AMBIENT = '0.8'; VICTORY_D3D12_DRED = 'light'; VICTORY_SKIP_PIPELINES = 'none'
  20. }
  21. if ($Safe) {
  22. $settings.VICTORY_UNDER_WIDE = '0'; $settings.VICTORY_LAND_ECHO = '0'
  23. } else {
  24. $settings.VICTORY_THIN = '1'; $settings.VICTORY_JOIN_PARTS = '8'; $settings.VICTORY_UPLOAD_AHEAD = '1'
  25. }
  26. if ($RayTracing) { $settings.VICTORY_BVH_BUILDER = '1' }
  27. foreach ($k in $More.Keys) { $settings[$k] = $More[$k] }
  28. $victory = Join-Path $PSScriptRoot "..\target\$Build\victory.exe"
  29. if (-not (Test-Path $victory)) { Write-Host "No $victory. Build it first (README.md)."; return }
  30. if (-not (Test-Path $Exe)) { Write-Host "No $Exe."; return }
  31. # (Other settings left over in this window go; where your files are stays.)
  32. $paths = 'VICTORY_CONFIG', 'VICTORY_GAME_DIR', 'VICTORY_CACHE_DIR', 'VICTORY_DATA_DIR'
  33. Get-ChildItem Env:VICTORY_* | Where-Object { $_.Name -notin $paths } | ForEach-Object { Remove-Item "Env:$($_.Name)" }
  34. foreach ($k in $settings.Keys) { Set-Item "Env:$k" $settings[$k] }
  35. $Exe = (Resolve-Path $Exe).Path
  36. Push-Location (Join-Path $PSScriptRoot '..') # victory.toml is looked for here
  37. try { & $victory run $Exe --execute } finally { Pop-Location }