PEAK
Install with App

Details

Latest version
0.1.0
Last Updated
First Uploaded
Downloads
295
Likes
0
Size
76KB
Dependants

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.

Thunderstore development is made possible with ads. Please consider making an exception to your adblock.