Skip to content

Keep the runtime's files in the game directory when a launcher starts elsewhere - #117

Merged
sambvfx merged 1 commit into
NVIDIAGameWorks:mainfrom
sambvfx:runtime-home-game-directory
Nov 20, 2026
Merged

sambvfx merged 1 commit into
NVIDIAGameWorks:mainfrom
sambvfx:runtime-home-game-directory

Conversation

@sambvfx

@sambvfx sambvfx commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator

With the Microsoft launcher and a custom Game Directory, the game process
starts in the default .minecraft folder, not in the game directory. The
runtime looks up rtx.conf, dxvk.conf, its rtx-remix/ folder, its caches
and its dump files in the process working directory, while the mod extracts
its payload into the game directory. The packaged rtx.conf was therefore
never read, the runtime ran on its own defaults, and its log went to a folder
nobody was told to look in. One missing setting,
rtx.materials.enableUvBoundsLooping, is what scrambles block faces under a
pack with height maps, as reported in #115.

When the working directory is not the game directory, the mod now points the
runtime at the game directory through the environment variables the runtime
already reads each location from: DXVK_RTX_CONFIG_FILE, DXVK_CONFIG_FILE,
DXVK_LOG_PATH, DXVK_CAPTURE_PATH, DEFAULT_MODS_DIR,
DXVK_STATE_CACHE_PATH, DXVK_METRICS_PATH, DXVK_AFTERMATH_DUMP_PATH and
DXVK_SCREENSHOT_PATH. RuntimeHome in renderer-core decides the values,
and the JNI bridge sets them in the process before it loads the runtime,
because the runtime reads DXVK_METRICS_PATH while it loads. The bridge's
own crash\ folder is now always under the game directory instead of the
working directory at the time of the crash.

Decisions

  • Nothing is overridden when the working directory is the game directory, so
    Prism, the default Microsoft launcher profile and every install that works
    today keep the runtime's own relative lookup. The runtime reads an explicit
    location through a narrower path: a 260-character buffer whose overflow it
    treats as unset, and for three of the variables the system code page.
  • A variable the process started with is left as it is, so the benchmark
    runner's DXVK_RTX_CONFIG_FILE and a player's own override still win.
  • A value the runtime would misread is left unset and logged: one longer than
    259 characters, or a conf path containing a comma, which the runtime treats
    as a list separator.
  • The process working directory is not changed. Java and other mods resolve
    relative paths against it, and moving it mid-session would split their
    files between two folders.

Not covered

  • user.conf and imgui.ini: the runtime has no variable for them and keeps
    reading and writing them in the working directory. The mod logs a warning
    when the game directory holds a user.conf that will not be read. Moving
    them needs a runtime change.
  • Minecraft's own logs\latest.log and the JVM's hs_err_pid*.log follow the
    working directory; they are not the mod's files.
  • Two defects found while testing, both present in 0.1.1 and unrelated to the
    working directory: the runtime writes no remix-dxvk.log when the game
    directory path has a non-ASCII character, and the bridge DLL fails to load
    from a path with characters outside the Windows system code page.

Testing

  • Reproduced on the 0.1.1 release JAR: started with a working directory that
    is not --gameDir, the runtime log says No config file found at: rtx.conf,
    its log, cache and rtx-remix/ folders land in the working directory, and
    terrain under RTX Remix Materials 0.61.0 shows the reported streaks.
  • The same launch with the packaged Fabric JAR from this branch: the log says
    Using config paths from DXVK_RTX_CONFIG_FILE and Found config file: <game directory>\rtx.conf, terrain renders correctly, the runtime's log,
    cache, metrics and rtx-remix/ folders are in the game directory, and only
    Minecraft's logs\latest.log is left in the working directory.
  • A normal launch (working directory equal to the game directory) sets no
    variable and logs the same relative rtx.conf lookup as before.
  • A game directory with an accented character, started from another folder:
    rtx.conf loads and terrain renders correctly; a user.conf placed in the
    game directory produces the warning.
  • The bridge's crash handler, exercised by faulting a native thread after
    loading the runtime from another working directory, wrote its report and
    minidump into the configured folder, including one with an accented path.
  • RuntimeHomeTest covers the decisions above.
  • gradlew.bat build test for Fabric, Forge and NeoForge, and
    tools\rtx.bat check --tests.
  • Not tested: the Microsoft launcher itself (the mismatch was produced by
    starting the client from the command line), and Forge and NeoForge in game;
    they share this code path.

Closes #115

🤖 Generated with Claude Code

… elsewhere

With the Microsoft launcher and a custom Game Directory, the game process
starts in the default .minecraft folder, not in the game directory. The
runtime looks up rtx.conf, dxvk.conf, its rtx-remix/ folder, its caches and
its dump files in the process working directory, while the mod extracts its
payload into the game directory. The packaged rtx.conf was therefore never
read, the runtime ran on its own defaults, and its log went to a folder
nobody was told to look in. One missing setting,
rtx.materials.enableUvBoundsLooping, is what scrambles block faces under a
pack with height maps.

When the working directory is not the game directory, RuntimeHome now names
the game directory's location for everything the runtime lets a host move,
as the environment variables the runtime reads them from, and the JNI bridge
sets them in the process before it loads the runtime. A variable the process
started with is left alone, and a value the runtime would misread (longer
than 259 characters, or a conf path with a comma) is left unset and logged.
Nothing is overridden when the working directory is the game directory, so
installs that work today keep the runtime's own relative lookup.

The bridge's crash folder is now always under the game directory instead of
the working directory at the time of the crash.

user.conf and imgui.ini have no variable in the runtime and stay in the
working directory; a user.conf in the game directory that will not be read
is logged.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Sam Bourne <sbourne@nvidia.com>
@sambvfx
sambvfx merged commit c19ad3c into NVIDIAGameWorks:main Nov 20, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enabling RTX-Remix-Materials-0.61.0.zip completely corrupts all block rendering (UV/texture scrambling and colored triangular artifacts)

1 participant