Skip to content

Overlay Pipeline and Mod Compat

Isllan Toso edited this page Nov 21, 2026 · 2 revisions

Overlay Pipeline and Mod Compatibility (bullet-inject & bullet-app)

Bullet's overlay pipeline is engineered to prepare match overlays in tens to hundreds of milliseconds without touching Riot's game files.

Parallel Game Indexing (overlay_builder::game_index)

  • Scans DATA/FINAL/ WAD archives in parallel using memory-mapped I/O (memmap2) and persists a versioned binary index (game_index) for instant subsequent startups.
  • Automatically invalidates both game_index and OverlayCache whenever game_version::check detects a new game binary stamp (PE TimeDateStamp on Windows, deterministic Mach-O header hash on macOS).

Incremental Overlay Construction (OverlayBuilder)

  1. Deduplication & Conflict Resolution: When multiple mods (e.g., an official skin + custom map + announcer) are active, resolve_inside and resolve_against ensure later mods in priority order cleanly override earlier ones.
  2. SubChunkTOC & Shared WAD Protection: Entries matching game SubChunkTOC hashes are filtered out; entries identical to the base game WAD are dropped as no-ops; shared champion/map WAD paths are propagated consistently to every WAD that references them.
  3. Map11 Collision Guard: Prevents champion-slot mods from accidentally overriding Map11.wad.client shared entries.
  4. Overlay Cache (OverlayCache): Records a fingerprint of (game_dir stamp, OVERLAY_BUILDER_REVISION, active mod hashes) so re-picking the same loadout skips WAD rewriting completely.

Debounced Arming & Safe Hook Window (InjectionTrigger)

  • 100 ms / 900 ms Debounce: Initial picks arm after 100 ms; subsequent switches debounce at 900 ms so rapid browsing does not waste disk I/O.
  • No Polling Ticker: Arming is triggered strictly by selection changes, never by a fixed-frequency loop.
  • 2-Second Safe Hook Window: Bullet never hooks an already-loading game process older than SAFE_HOOK_WINDOW (2 s) unless explicitly configured (HOOK_LOADING_GAME), preventing mid-load corruption.
  • Explicit Hook Confirmation: The pipeline distinguishes Armed, Hooked (Confirmed), Unconfirmed, Failed, and PatcherExited, surfacing exact status in the tray and logs.

Safe Archive Extraction & Custom Mod Repair (bullet-platform & mod_compat)

  • safe_extract_zip Limits & Traversal Guards: Validates every ZIP/archive entry before writing — rejects .., absolute paths, symlinks, junctions, and canonicalizes paths with Path::starts_with. Enforces hard bounds (16 GB total, 8 GB per file, 200,000 entries) after checking free disk space.
  • Atomic State Persistence (atomic_write): Writes config, presets, and history to a temporary file on the same volume, fsyncs, and atomically renames.
  • Custom Mod Repair (mod_compat): On startup (and via Support → Repair skins and mods), Bullet scans .fantome, .modpkg, and .zip mods in custom_mods/, repairs stale .bin links against the installed game version, backs up untouched originals in state/mod_originals/, and supports one-click restoration.

Match Statistics & Redacted Diagnostics (bullet-app)

  • Local Match Statistics (live_game & stats.rs): Tracks per-skin wins, losses, and win rate from live game end events into state/skin_stats.json, displayed on the Home tab.
  • Structured Logging (tracing): File logs default to INFO (configurable via BULLET_LOG / RUST_LOG), rotated across 7 daily files, with non-blocking appender drop counters. Secret tokens and party keys are never logged.
  • Diagnostics Export: Support → Export diagnostics redacts Windows/macOS user profile paths and UUIDs (diagnostics/control_panel/redact.rs) before packaging logs.

Clone this wiki locally