StackTraceStutterFix
Fixes stutters on late-game levels by disabling stack tracing for logs.
By Murka124
| Date uploaded | 2 days ago |
| Version | 0.1.0 |
| Download link | Murka124-StackTraceStutterFix-0.1.0.zip |
| Downloads | 339 |
| Dependency string | Murka124-StackTraceStutterFix-0.1.0 |
This mod requires the following mods to function
BepInEx-BepInExPack_PEAK
BepInEx pack for PEAK. Preconfigured and ready to use.
Preferred version: 5.4.75301README
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.
CHANGELOG
[0.1.0]
- Initial release