File information

Last updated

Original upload

Created by

33void

Uploaded by

33Void

Virus scan

Safe to use

Tags for this mod

About this mod

Skyrim Runtime Optimizer is a tool that intercepts the game's file loading calls to use the optimized assets that the mod creates.

Requirements
Permissions and credits
The Skyrim Runtime Optimizer is a sophisticated plugin that aims to improve the performance of Skyrim, given the use of SSE NIF Optimizer It achieves this by dynamically optimizing NIF (NetImmerse File, used for 3D models) and DDS (DirectDraw Surface, used for textures) files and intercepting the game's file loading calls to use these optimized versions.


Here's a breakdown of its core functionalities:
  • Asset Optimization:
    • Background Scanning and Processing: The plugin initiates a background thread (g_OptimizationThread) after the game's data has loaded (SKSE::MessagingInterface::kDataLoaded). This thread scans the game's Data directory for .nif and .dds files.
    • External Tool Integration: It leverages external command-line tools, SSE NIF Optimizer.exe and Magick.exe, which are expected to be present in the game's installation directory.
      • .nif files are batch-processed using SSE NIF Optimizer to optimize the 3D models.
      • .dds files (textures) are converted to the BC7/DX10 format, and resized by 50% using Magick, which is a modern and efficient compression format for textures, aiming to reduce VRAM usage and potentially improve loading times.
    • Optimized Asset Storage: Optimized versions of the NIF and DDS files are saved to a dedicated OptimizedAssets folder within a user-configurable save directory (defaulting to C:\SkyrimLogs\OptimizedAssets). This keeps the original game files untouched.
    • Caching System: To avoid re-optimizing files unnecessarily, the plugin maintains a cache (g_OptimizedFileCache). It stores the last modification timestamp of original files. If a file's timestamp hasn't changed since the last optimization, it's skipped. This significantly speeds up subsequent game launches. The cache is saved to and loaded from RuntimeOptimizerCache.dat.
  • Runtime File Redirection (Hooking):
    • The plugin uses MinHook to intercept Windows API calls related to file I/O, specifically CreateFileW and CreateFileA.
    • When the game attempts to open a .nif or .dds file, the plugin checks if an optimized version of that file exists in its OptimizedAssets directory.
    • If an optimized version is found, the plugin redirects the game's file request to the optimized file instead of the original. This ensures the game uses the performance-enhanced assets.
  • In-Game User Interface (ImGui Integration):
    • The plugin integrates the Dear ImGui library to provide a lightweight, in-game overlay.
    • It hooks into the DirectX 11 Present function to render this UI.
    • The UI (RenderUI) displays the current status of the optimization process (g_ScanStatus), indicates when the scan is complete, and shows the paths for the optimized assets and the configuration file.
    • Users can toggle the visibility of this UI by pressing the F1 key.
  • Configuration and Logging:
    • Settings are loaded from and saved to Data/SKSE/Plugins/RuntimeOptimizer.ini. The primary configurable setting is the sSavePath for logs, cache, and optimized assets.
    • Comprehensive logging (Log function) is implemented, writing timestamped messages to RuntimeOptimizer.log within the configured save directory. This is crucial for debugging and monitoring the plugin's operations.



    • How is this different from other traditional optimizers?
               This program aims to facilitate optimizing game files by conveniently redirecting and intercepting file requests from the game over to the optimized versions (if it exists)

    •     This optimizer is different in that it doesn't overwrite your original game files at all, and doesn't have to be in the same instance as for example mod organizer to overwrite the pre existing assets as many optimizers require.


       NOTE: PLEASE RUN SKYRIM RUNTIME OPTIMIZER FIRST THEN SKYRIM RUNTIME REDIRECTOR,

      IMPORTANT: DO NOT RUN BOTH AT THE SAME TIME OTHERWISE THEY WILL CLASH WITH EACH OTHER.
      IMPORTANT: PLEASE READ THE README.TXT THAT IS PROVIDED WITH SKYRIM RUNTIME OPTIMIZER FOR INSTRUCTIONS.