F1 settings menu, frame generation 2x-6x live, no frame rate cap, FPS line

On readmet3xt-lab/foxhound 02fc18a, which becomes this fork's base.

- host/menu.rs: the F1 settings menu, in every build (it was in the
  diagnostics build only): DLSS mode and model, frame generation, frame
  rate cap, console profile, picture size, the light estimates and the
  main speed switches. Saved to victory-settings.txt, applied by the
  launcher at the next start; "save and restart" from the menu. The title
  gets no keyboard while it is shown (gameinput.rs).
- host/font.rs: the dot letters, moved out of the diagnostics panel so
  that the menu has them in every build.
- streamline.rs: VICTORY_FRAMEGEN_X=2..6, the frames shown for each one
  rendered (no more than the state says this card generates); 0: ready
  but off. The amount and off/on change while the title runs
  (set_framegen, from the menu). Result 39, "warning: out of VRAM", is
  taken as set: asked again at every present it showed no generated
  frame at all (1,828 times in one run on a full 12 GB card).
- The frame rate at the top left of the picture while the menu is closed:
  frames rendered a second, and with frame generation those shown
  (VICTORY_FPS_LINE=0: not). The window's caption says both too.
- scripts/play-foxhound.ps1: applies what the menu saved; -FrameGenX;
  -Fps defaults to 1000 (no cap: VICTORY_FRAME_INTERVAL_US=1000); frame
  generation is made ready at every start with Streamline so that the
  menu can switch it (-NoFrameGenReady: not), with a share of the card's
  memory held back for it (VICTORY_TEXTURE_ROOM_PERCENT 80 on, 86 ready);
  NVIDIA's files are looked for in nvidia-sdk\ here; builds the layer when
  it is not built. scripts/play-nvidia.ps1 is the same launcher under
  this fork's old name.
- Get-NVIDIA-DLSS.cmd / scripts/get-nvidia-sdks.ps1: fetch the eight
  NVIDIA files that are loaded (about 70 MB) out of NVIDIA's Streamline
  release into nvidia-sdk\ (git-ignored). They are NVIDIA's, under
  NVIDIA's licences, and are not part of this repository.
- README for this fork; foxhound's own is kept as docs/README-foxhound.md.

Measured on an RTX 5070 (Series X, native 2560x1440, DLSS Quality,
opening rooms): mostly 26-30 frames a second rendered; in Streamline's
own check 2x, 4x and 6x show exactly 2, 4 and 6 frames for each one
rendered.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
This commit is contained in:
trustno1-coderandClaude Fable 5.2 committed 2026-11-26 19:41:59 -08:00
1 parent 02fc18a20a
commit 22c6be2e76
14 files changed
+1321 -224

No files matched your search

+136
View File
@@ -0,0 +1,136 @@
# Fetches the NVIDIA files DLSS and DLSS frame generation need (about 70 MB) from NVIDIA's own GitHub into
# nvidia-sdk\Streamline\bin\x64 here (git-ignored), where scripts\play-foxhound.ps1 looks for them. They are
# NVIDIA's, under NVIDIA's licences (saved beside them: read them); this repository does not and may not carry
# them, so each person gets them from NVIDIA directly. Get-NVIDIA-DLSS.cmd in the repository's folder runs this.
# Nothing of NVIDIA's is needed to build the layer: the files are loaded when the game runs.
param(
[string]$StreamlineTag = 'v2.14.16'
)
$ProgressPreference = 'SilentlyContinue' # Invoke-WebRequest's progress bar makes it many times slower
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12
$root = (Resolve-Path (Join-Path $PSScriptRoot '..')).Path
$sdk = Join-Path $root 'nvidia-sdk'
$sl = Join-Path $sdk 'Streamline'
$bin = Join-Path $sl 'bin\x64'
# What is loaded when the game runs: Streamline's interposer and plugins, DLSS and the frame generation model.
$dlls = 'sl.interposer.dll', 'sl.common.dll', 'sl.dlss.dll', 'sl.dlss_g.dll', 'sl.reflex.dll', 'sl.pcl.dll', 'nvngx_dlss.dll', 'nvngx_dlssg.dll'
# One file from a URL, with curl's progress line where Windows has curl (it has since Windows 10 1803).
function Get-File([string]$Url, [string]$To) {
New-Item -ItemType Directory -Force (Split-Path $To) | Out-Null
$part = "$To.part"
if (Get-Command curl.exe -ErrorAction SilentlyContinue) {
& curl.exe --location --fail --silent --show-error --progress-bar --output $part $Url
if ($LASTEXITCODE -ne 0) { Remove-Item $part -ErrorAction SilentlyContinue; throw "could not get $Url" }
} else {
Invoke-WebRequest -Uri $Url -OutFile $part -UseBasicParsing -ErrorAction Stop
}
Move-Item $part $To -Force
}
# Bytes first..last of a URL.
function Get-Range([string]$Url, [long]$First, [long]$Last) {
$q = [Net.HttpWebRequest]::Create($Url)
$q.UserAgent = 'get-nvidia-sdks'
$q.AddRange($First, $Last)
$r = $q.GetResponse()
try {
if ([int]$r.StatusCode -ne 206) { throw 'the server does not give parts of the file' }
$m = New-Object IO.MemoryStream
$r.GetResponseStream().CopyTo($m)
, $m.ToArray()
} finally { $r.Close() }
}
# Takes the named files out of a zip on a server without downloading the whole zip: its directory is at
# its end, and each file in it can be asked for by its place. $Want: a regex on the paths in the zip.
# Each goes into $Into under the part of its path after the SDK's top folder.
function Get-FromZip([string]$Url, [string]$Want, [string]$Into) {
# Where the file really is (the download address redirects), and how long it is.
$h = [Net.HttpWebRequest]::Create($Url); $h.Method = 'HEAD'; $h.UserAgent = 'get-nvidia-sdks'
$r = $h.GetResponse(); $real = $r.ResponseUri.AbsoluteUri; $length = $r.ContentLength; $r.Close()
$tailLen = [Math]::Min($length, 2MB)
$tail = Get-Range $real ($length - $tailLen) ($length - 1)
$end = -1
for ($i = $tail.Length - 22; $i -ge 0; $i--) {
if ($tail[$i] -eq 0x50 -and $tail[$i + 1] -eq 0x4b -and $tail[$i + 2] -eq 5 -and $tail[$i + 3] -eq 6) { $end = $i; break }
}
if ($end -lt 0) { throw 'no zip directory found' }
$dirSize = [BitConverter]::ToUInt32($tail, $end + 12)
$dirAt = [BitConverter]::ToUInt32($tail, $end + 16)
if ($dirAt -eq [uint32]::MaxValue) { throw 'a zip64 archive' }
$dir = if ($dirAt -ge $length - $tailLen) {
$from = [int]($dirAt - ($length - $tailLen)); , $tail[$from..($from + $dirSize - 1)]
} else { Get-Range $real $dirAt ($dirAt + $dirSize - 1) }
$got = 0
$at = 0
while ($at + 46 -le $dir.Length -and [BitConverter]::ToUInt32($dir, $at) -eq 0x02014b50) {
$method = [BitConverter]::ToUInt16($dir, $at + 10)
$packed = [BitConverter]::ToUInt32($dir, $at + 20)
$size = [BitConverter]::ToUInt32($dir, $at + 24)
$nameLen = [BitConverter]::ToUInt16($dir, $at + 28)
$extraLen = [BitConverter]::ToUInt16($dir, $at + 30)
$noteLen = [BitConverter]::ToUInt16($dir, $at + 32)
$headerAt = [BitConverter]::ToUInt32($dir, $at + 42)
$name = [Text.Encoding]::UTF8.GetString($dir, $at + 46, $nameLen)
$at += 46 + $nameLen + $extraLen + $noteLen
if ($name -notmatch $Want) { continue }
# The file's own header (its extra field may be longer than the directory's), then its bytes.
$piece = Get-Range $real $headerAt ($headerAt + 30 + $nameLen + 2048 + $packed - 1)
if ([BitConverter]::ToUInt32($piece, 0) -ne 0x04034b50) { throw "no file header for $name" }
$dataAt = 30 + [BitConverter]::ToUInt16($piece, 26) + [BitConverter]::ToUInt16($piece, 28)
if ($dataAt + $packed -gt $piece.Length) { throw "the header of $name is longer than expected" }
$out = [IO.MemoryStream]::new()
if ($method -eq 0) { $out.Write($piece, $dataAt, [int]$packed) }
elseif ($method -eq 8) {
$in = [IO.MemoryStream]::new($piece, $dataAt, [int]$packed)
$z = [IO.Compression.DeflateStream]::new($in, [IO.Compression.CompressionMode]::Decompress)
$z.CopyTo($out); $z.Close()
} else { throw "$name is packed in a way this script does not know ($method)" }
if ($out.Length -ne $size) { throw "$name came out $($out.Length) bytes long, not $size" }
$rel = ($name -replace '^.*?(?=(bin/x64/|license\.txt$))', '') -replace '/', '\'
$to = Join-Path $Into $rel
New-Item -ItemType Directory -Force (Split-Path $to) | Out-Null
[IO.File]::WriteAllBytes($to, $out.ToArray())
Write-Host (" {0} {1:N1} MB" -f $rel, ($size / 1MB))
$got++
}
$got
}
Write-Host "NVIDIA Streamline $StreamlineTag with DLSS and frame generation, from github.com/NVIDIA-RTX/Streamline (about 70 MB):"
$missing = @($dlls | Where-Object { -not (Test-Path (Join-Path $bin $_)) })
if (-not $missing) {
Write-Host " all there already: $bin"
} else {
$url = "https://github.com/NVIDIA-RTX/Streamline/releases/download/$StreamlineTag/streamline-sdk-$StreamlineTag.zip"
$names = ($dlls | ForEach-Object { [regex]::Escape($_) }) -join '|'
$want = "(^|/)bin/x64/($names|[^/]*license[^/]*\.txt)$|^([^/]+/)?license\.txt$"
try { [void](Get-FromZip $url $want $sl) }
catch { Write-Host " Taking the files out of the archive in place did not work ($($_.Exception.Message))." }
if (@($dlls | Where-Object { -not (Test-Path (Join-Path $bin $_)) })) {
# The whole archive then (263 MB).
Write-Host ' Getting the whole archive instead (263 MB) ...'
$zip = Join-Path $sdk "streamline-sdk-$StreamlineTag.zip"
Get-File $url $zip
$into = Join-Path $sdk 'streamline-unpacked'
Expand-Archive -Path $zip -DestinationPath $into -Force -ErrorAction Stop
$found = Get-ChildItem $into -Recurse -Filter 'sl.interposer.dll' |
Where-Object { $_.FullName -match '\\bin\\x64\\sl\.interposer\.dll$' -and $_.FullName -notmatch '\\development\\' } |
Select-Object -First 1
if (-not $found) { throw 'The Streamline archive has no bin\x64\sl.interposer.dll.' }
$top = Split-Path (Split-Path (Split-Path $found.FullName))
New-Item -ItemType Directory -Force $bin | Out-Null
Get-ChildItem (Join-Path $top 'bin\x64') -File |
Where-Object { $dlls -contains $_.Name -or $_.Name -match 'license.*\.txt$' } |
Copy-Item -Destination $bin -Force
Copy-Item (Join-Path $top 'license.txt') $sl -Force -ErrorAction SilentlyContinue
Remove-Item $into -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item $zip -Force
}
}
$still = @($dlls | Where-Object { -not (Test-Path (Join-Path $bin $_)) })
if ($still) { throw "Not there after all: $($still -join ', ')" }
Write-Host " licences: $(Join-Path $sl 'license.txt') (Streamline) and the *.license.txt files in $bin (DLSS, Reflex)"
Write-Host ''
Write-Host 'Done. scripts\play-foxhound.ps1 uses them from its next start.'
+69 -7
View File
@@ -8,6 +8,10 @@
# .\scripts\play-foxhound.ps1 -Exe ... -Build diag diagnostics build (slower; captures, timelines)
# .\scripts\play-foxhound.ps1 -Exe ... -More @{VICTORY_AMBIENT_SPECULAR='0'} add or override switches
#
# In the game, F1 opens a settings menu (arrow keys pick and change, Enter does it). What it saves goes to
# victory-settings.txt in the repository's folder and is applied here at every start, over the options above;
# delete that file to go back to them.
#
# Build first (README). Run from a normal window, not as administrator. Each run writes a log to
# %LOCALAPPDATA%\victory\logs. Every VICTORY_... switch is described in a comment where the code reads it.
param(
@@ -21,11 +25,38 @@ param(
[ValidateSet('off', 'dlaa', 'quality', 'balanced', 'performance')][string]$Dlss = 'quality',
# DLSS Frame Generation (RTX 40 or later, hardware-accelerated GPU scheduling on); needs DLSS.
[switch]$FrameGen,
# Frames begin every 1/Fps s whatever the title asks (it asks 1/30); the frame time is the layer's limit.
[ValidateRange(1, 1000)][int]$Fps = 0,
# Frames shown for each one rendered with -FrameGen: 2 to 6 (more than 2 needs an RTX 50; the layer asks the
# driver how many this card does and gives no more).
[ValidateRange(2, 6)][int]$FrameGenX = 2,
# Frame generation is made ready at every start with Streamline, on or off, so that the F1 menu switches it
# and changes its amount while playing. -NoFrameGenReady: only with -FrameGen, as before.
[switch]$NoFrameGenReady,
# Frames begin every 1/Fps s whatever the title asks (it asks 1/30). 1000, the default: no cap, a frame
# begins as soon as the last is done. 30: the title's own rate.
[ValidateRange(1, 1000)][int]$Fps = 1000,
[hashtable]$More = @{}
)
$repo = Split-Path $PSScriptRoot -Parent
# What the F1 menu saved: its own choices (VICTORY_MENU_...) stand in for this script's options, and its
# switches go over the settings below. An empty value unsets a switch.
$menuFile = Join-Path $repo 'victory-settings.txt'
$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() }
}
}
$fpsWanted = $Fps
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_DLSS'] -in 'off', 'dlaa', 'quality', 'balanced', 'performance') { $Dlss = $menu['VICTORY_MENU_DLSS'] }
$timesWanted = $FrameGenX
if ($menu.Contains('VICTORY_MENU_FRAMEGEN')) {
# 0: off; 2 to 6: that many frames shown for each one rendered (1, from an older file: 2).
$FrameGen = $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_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 = @{
# Submission and copy machinery
VICTORY_THIN = '1'; VICTORY_JOIN_PARTS = '8'; VICTORY_RELAY = '2'; VICTORY_RELAY_COPY = '1'; VICTORY_WIDE_BACK = '1'
@@ -58,20 +89,51 @@ if (-not $SeriesS) {
elseif ($Res -eq '1080to1440') { $settings.VICTORY_RENDER_1080P = '1' }
}
if ($Dlss -ne 'off') {
$sl = if ($env:VICTORY_STREAMLINE_DIR) { $env:VICTORY_STREAMLINE_DIR } else { 'C:\dev\sdk\streamline-sdk-v2.14.16\bin\x64' }
# NVIDIA's files: where VICTORY_STREAMLINE_DIR says, else where Get-NVIDIA-DLSS.cmd puts them.
$sl = if ($env:VICTORY_STREAMLINE_DIR) { $env:VICTORY_STREAMLINE_DIR } else { Join-Path $repo 'nvidia-sdk\Streamline\bin\x64' }
if (Test-Path (Join-Path $sl 'sl.interposer.dll')) {
$settings.VICTORY_DLSS = '1'; $settings.VICTORY_DLSS_MODE = $Dlss; $settings.VICTORY_STREAMLINE_DIR = $sl
if ($FrameGen) { $settings.VICTORY_FRAMEGEN = '1' }
if ($FrameGen) { $settings.VICTORY_FRAMEGEN = '1'; $settings.VICTORY_FRAMEGEN_X = [string]$timesWanted }
elseif (-not $NoFrameGenReady) { $settings.VICTORY_FRAMEGEN = '1'; $settings.VICTORY_FRAMEGEN_X = '0' } # ready, off
# Frame generation takes 1.5 to 2 GB of the card's memory, which the layer otherwise fills with textures up
# to nine tenths of its budget (on a 12 GB card it then ran out: no generated frames). On from the start, it
# is left a fifth of the budget; ready but off, a little less is held back.
if ($settings.VICTORY_FRAMEGEN -eq '1') { $settings.VICTORY_TEXTURE_ROOM_PERCENT = if ($FrameGen) { '80' } else { '86' } }
} else {
Write-Host "No NVIDIA Streamline in $sl (set VICTORY_STREAMLINE_DIR, see README): running without DLSS."
Write-Host "No NVIDIA files in ${sl}: running without DLSS and frame generation. Get-NVIDIA-DLSS.cmd in the"
Write-Host "repository folder fetches them from NVIDIA once (about 70 MB); VICTORY_STREAMLINE_DIR names another folder."
}
}
if ($Fps -gt 0) { $settings.VICTORY_FRAME_INTERVAL_US = [string][int][math]::Round(1000000 / $Fps) }
if ($fpsWanted -gt 0) { $settings.VICTORY_FRAME_INTERVAL_US = [string][int][math]::Round(1000000 / $fpsWanted) }
foreach ($k in $menu.Keys) {
if ($k -like 'VICTORY_MENU_*') { continue }
if ($menu[$k]) { $settings[$k] = $menu[$k] } else { $settings.Remove($k) }
}
foreach ($k in $More.Keys) { $settings[$k] = $More[$k] }
$console = if ($SeriesS) { 'series-s' } else { 'series-x' }
# For the menu: what it shows as the current choices, where it saves, and how it starts the game again
# (-More is not carried over a restart from the menu).
$settings.VICTORY_MENU_CONSOLE = $console
$settings.VICTORY_MENU_RES = $Res
$settings.VICTORY_MENU_DLSS = if ($settings.VICTORY_DLSS -eq '1') { $Dlss } else { 'off' }
$settings.VICTORY_MENU_FRAMEGEN = if ($settings.VICTORY_FRAMEGEN -eq '1') { [string]$settings.VICTORY_FRAMEGEN_X } else { '0' }
$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 "'", "''")' -Build $Build$(if ($NoFrameGenReady) { ' -NoFrameGenReady' })"
$victory = Join-Path $repo "target\$Build\victory.exe"
if (-not (Test-Path $victory)) { Write-Host "No $victory. Build it first (README)."; return }
if (-not (Test-Path $victory)) {
# Not built yet: built here, once.
if (-not (Get-Command cargo -ErrorAction SilentlyContinue)) { Write-Host "No $victory, and no cargo to build it with: install Rust (README), then start this again."; return }
Write-Host 'Building the layer (a few minutes the first time) ...'
Push-Location $repo
try {
if ($Build -eq 'diag') { cargo build --locked --profile diag -p victory --features diagnostics }
else { cargo build --release --locked -p victory }
} finally { Pop-Location }
if (-not (Test-Path $victory)) { Write-Host "The build did not make $victory."; return }
}
if (-not (Test-Path -LiteralPath $Exe)) { Write-Host "No $Exe."; return }
# Switches left over in this window are cleared; path settings stay (victory.toml gives them otherwise).
$paths = 'VICTORY_CONFIG', 'VICTORY_GAME_DIR', 'VICTORY_CACHE_DIR', 'VICTORY_DATA_DIR', 'VICTORY_STREAMLINE_DIR'
+4
View File
@@ -0,0 +1,4 @@
# The launcher under the name this fork has always had: everything goes on to play-foxhound.ps1 (its options
# are described at its top).
# scripts\play-nvidia.ps1 -Exe <path of your own copy's executable>
& "$PSScriptRoot\play-foxhound.ps1" @args