StackTraceStutterFix

v0.1.0·Updated 2026-09-13

Fixes stutters on late-game levels by disabling stack tracing for logs.

About this mod Author’s original text

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.

Install & use Install: BepInEx plugin

  1. The archive from playbuff is the mod itself — usually a BepInEx plugin (a .dll or a plugin folder once unzipped).
  2. Recommended: use a community mod manager (such as r2modman) — pick this game, import the mod, and the manager sets up BepInEx and its dependencies for you.
  3. Manual route: install the BepInEx loader in the game folder, then drop the unzipped .dll or plugin folder into BepInEx/plugins/.
  4. Launch the game — the BepInEx console logs every plugin it loads; seeing this mod in the log means it is installed.

Mods with listed dependencies need those installed too, or they will not load. Options are usually changed in-game or in the plugin's config file.

Dependencies

Install these first, or the mod will not work:

BepInEx-BepInExPack_PEAK

File & checksum

Filename
StackTraceStutterFix-0.1.0.zip
File size
74.4 KiB