Skip to main content
SpawnTracker provides real-time tracking of spawned game objects in MegaBonk. The mod uses Harmony patches to intercept spawn and interaction events, maintaining accurate counts throughout each round.

Available tracking features

Chest tracking

Track total chests spawned and how many remain unopened

Shrine tracking

Monitor charge shrines including active count and completion status

ShadyGuy tracking

Count ShadyGuy spawns, interactions, and disappearances

Moai tracking

Track Moai shrine spawns and player interactions

Overlay display

Real-time IMGUI overlay showing all tracking statistics in the bottom-left corner

How tracking works

All tracking features work together through a centralized system:
  • Harmony patches intercept game methods when objects spawn or are interacted with
  • Static tracker classes maintain counts for each object type
  • Overlay manager coordinates the GUI display and tracker resets
  • Round lifecycle hooks enable tracking at round start and reset on death/end
Tracking is automatically enabled when a round starts and disabled when the player dies or the round ends.

Tracker synchronization

All trackers are reset simultaneously at key moments:
private static void ResetAllTrackers()
{
    ChestTracker.Reset();
    ShadyGuyTracker.Reset();
    ChargeShrineTracker.Reset();
}
This ensures accurate counts for each new round without carryover from previous sessions.

Round state management

The mod monitors round state through the disableTracker flag and IsRoundActive status:
public static bool disableTracker; // disables tracking outside of rounds
When enabled, all patches check this flag before updating counts:
if (Plugin.disableTracker && !ChargeShrineTracker.IsRoundActive) return;
This prevents tracking during menus, loading screens, or between rounds.

Build docs developers (and LLMs) love