WhySoLaggy
Diagnose lag and unusual network activity with mod profilers, RPC monitoring, CSV/JSONL logs, and Harmony patch diagnostics.
About this mod Machine translation
WhySoLaggy
Find out which mod is making your game lag, and who is bombing — or sneakily feeding — your room.
1.0.5 retains the focus on quiet-by-default, structured data and targeted diagnostics: profilers are off until you need them, while the network and RPC monitors preserve bounded, recent evidence for post-session analysis.
What's new in 1.0.5
- Updated ModConfig support for the current settings menu, section names, and dropdown labels.
- Fixed settings text not following game language changes.
- Restricted translations to WhySoLaggy's own settings to avoid changing other mods' labels.
- Fixed inherited-method patch warnings during ModConfig integration and improved menu refresh cleanup.
- Kept ModConfig optional and preserved existing configuration values and diagnostic features.
Built against PEAK 2.4.b. PEAKLib.ModConfig remains optional. Final in-game language-switching and host/client checks are still pending; the 1.0.4 measurements and testing notes below are historical.
Quick start
- Install BepInExPack PEAK.
- Drop WhySoLaggy.dll into PEAK/BepInEx/plugins.
- Launch the game, play normally, then exit.
- Open PEAK/BepInEx/ and look at:
- WhySoLaggy.log — performance data (quiet by default, see Log Verbosity)
- WhySoLaggy_Abuse.log — abuse alerts + RPC reports + feeding-chain traces
- whysolaggy_data.csv — every event in 87 fixed columns
- whysolaggy_events.jsonl — every event as JSON (one per line)
- harmony_patches.csv — every Harmony patch in the process (written once at startup)
Zero extra setup needed. All advanced features are opt-in.
Features
Each feature has a default state. Features marked opt-in cost zero when disabled.
- FPS Monitor — always on
- Tracks frame time every frame; any frame exceeding SpikeThresholdMs (default 50ms) is logged as a spike and written as a SpikeFrame event.
- Every ReportIntervalSeconds (default 10s) emits an FpsReport event with average/p95/p99 frame ms, window average, and (if memory monitor is on) AllocRateKBps.
- Overhead: one Time.unscaledDeltaTime read per frame. Negligible.
- Plugin Profiler — opt-in (default off in 1.0.4)
- When EnablePluginProfiling=true, Harmony-patches Update/LateUpdate/FixedUpdate on every BepInEx plugin's MonoBehaviours and records their per-frame cost.
- Periodic report lists the slowest plugins by average ms, plus total calls.
- Use IgnorePluginGuids (comma-separated) to permanently mute noisy plugins. Example:
IgnorePluginGuids = com.example.ui-mod,com.example.minimap
- Why off by default: instrumenting every mod's Update adds measurable self-overhead. Turn on only when diagnosing.
- Patch Profiler — opt-in (default off in 1.0.4)
- When EnablePatchProfiling=true, wraps every Harmony-patched target method with prefix/postfix timing.
- Throttling: after a method has been sampled >20 times and its average sits below MinReportMs (default 0.1ms), only every 10th call is recorded afterwards. Cuts self-overhead by ~70–90% in busy scenes.
- IgnorePatchMethods lets you skip known noisy methods:
IgnorePatchMethods = Player.Update,Camera.LateUpdate
- Null-safe: a null __originalMethod is logged as "(unknown)" instead of throwing inside Harmony.
- Room-Bombing Detection — always on
- Monitors three per-second rates: Instantiate, Destroy, RPC. Also tracks absolute scene object count for spike detection.
- When any rate exceeds its threshold, an ⚠ ABUSE ALERT is written to WhySoLaggy_Abuse.log together with the offending player's nickname + ActorNumber and the current top-5 RPC method names for context.
- A red on-screen banner shows the alert for 12s (auto-fades). Language follows system locale (中/EN).
- Observation only — never kicks, blocks or interferes.
- 1.0.4 — two extra alarms layered on top (see also the Master-side diagnostics section):
- ActorMethodHotspot — the same actor sent the same RPC ≥ ActorMethodRateThreshold times in one check window (default 20/s). Pinpoints which client is flooding which method, not just the
Install & use Install: BepInEx plugin
- The archive from playbuff is the mod itself — usually a BepInEx plugin (a .dll or a plugin folder once unzipped).
- 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.
- Manual route: install the BepInEx loader in the game folder, then drop the unzipped .dll or plugin folder into BepInEx/plugins/.
- 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.
Install these first, or the mod will not work: