StackTraceStutterFix
Fixes stutters on late-game levels by disabling stack tracing for logs.
模組介紹 作者原文
StackTraceStutterFix
A small mod that targets a specific kind of stutter, one that mostly shows up on levels like The Kiln, The Citadel, [REDACTED] etc.
It monitors stack trace settings every frame, disabling stack tracing for all log types, while leaving a partial trace (ScriptOnly) only for Exception errors, so mod developers can still track where those occurred.
Research Background (AI-Assisted)
This investigation was conducted with the help of AI. Initially, we considered rewriting CharacterStats.Downsample entirely, since that's where the error spam originates. However, I wasn't satisfied with that approach.
PerfView showed that Debug.LogError was consuming a huge amount of CPU time (not Downsample itself), so the AI went further to understand why.
Eventually, with the AI's help, we concluded that the game recently started generating a full stack trace every time Debug.LogError is called. The solution turned out to be simple: tell the game not to generate a stack trace.
AI Research Summary
The issue is not that errors became more frequent, but that every error now carries a full call stack. In earlier versions of PEAK, the stack for Error was disabled or partially collected. In newer versions, the settings changed, leading to a catastrophic performance drop.
Solution: disable stack traces for LogType.Error via Application.SetStackTraceLogType(LogType.Error, StackTraceLogType.None).
Compatibility
This mod does not modify any game logic, assets, or other mods. It only applies stack trace rules for log messages. It should not break any existing mods.
AI Disclosure
The investigation and a single line of code (Application.SetStackTraceLogType(LogType.Error, StackTraceLogType.None)) were assisted by AI. The plugin structure and logic were written by the author.
安裝與使用 安裝:BepInEx 外掛
- 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
- 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
- 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
- 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。
帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。
下面這些內容需要先安裝,否則該模組不會生效: