Skip to content

26.3 Debug Logging and Diagnostics

Dasik edited this page Aug 20, 2026 · 1 revision

πŸ” Debug Logging & Diagnostic Tracing (Minecraft 26.3)

Camera Culling includes an in-game diagnostic logging and real-time state transition tracing engine to enable players and modpack developers to monitor exactly when and why entities are rendered or culled.


πŸ“‹ Diagnostics Infobox

Property Value
Command Toggle `/cameraculling debug [true
GUI Toggle "Real-Time Debug Logging" in Engine & Diagnostics category
Default State false (Zero string allocations on hot render paths)
Chat Output Color-coded Β§6[CC-Debug] state transition notifications
Log Output SLF4J logger output under [CameraCulling Debug] tag

πŸ”¬ State Transition Logging Architecture

When debug mode is enabled, CullingDiagnosticsHelper captures every state transition (Visible $\leftrightarrow$ Culled) as entities cross sightlines:

[CC-Debug] Β§c[CULLED] Β§eminecraft:cow #412Β§7 (dist: Β§f18.4mΒ§7) -> Β§bBlock Occlusion
[CC-Debug] Β§a[VISIBLE] Β§eminecraft:zombie #891Β§7 (dist: Β§f12.1mΒ§7) -> Β§bSightline (Eyes)
[CC-Debug] Β§a[VISIBLE] Β§eminecraft:wolf #204Β§7 (dist: Β§f6.2mΒ§7) -> Β§bBlacklist Immunity
[CC-Debug] Β§a[VISIBLE] Β§eminecraft:warden #102Β§7 (dist: Β§f34.8mΒ§7) -> Β§bBoss Immunity

Transition Reasons Documented

  1. Sightline (Head Top) β€” Visible via head top raycast sample.
  2. Sightline (Eyes) β€” Visible via anatomical eye sample.
  3. Sightline (Upper Torso) β€” Visible via upper chest sample.
  4. Sightline (Center) β€” Visible via midpoint sample.
  5. Sightline (Flank) β€” Visible via perimeter flank sample.
  6. Proximity Safety Bubble β€” Within min distance margin.
  7. Boss Immunity β€” Protected by boss HP threshold or keyword.
  8. Blacklist Immunity β€” Whitelisted in client or server blacklist.
  9. Player / Vehicle Immunity β€” Local player, passenger, or mount.
  10. Glowing Immunity β€” Entity has active glowing effect.
  11. Crowd / Mob Overdraw Occlusion β€” Exceeded local cluster density cap.
  12. Block Occlusion β€” All sightline samples occluded by solid blocks.

⚑ Zero-Allocation Hot-Path Guard

To maintain maximum FPS, debug string formatting and message generation are completely bypassed when debugMode is false:

public static boolean isDebugEnabled() {
    return CameraCullingConfig.isDebugMode() || LOGGER.isDebugEnabled();
}

public static void logStateTransition(Entity entity, Vec3 camPos, boolean nowOccluded, String reason) {
    if (!isDebugEnabled()) {
        return; // Zero string formatting or object creation when disabled
    }
    ...
}

πŸ”— Related Pages

Clone this wiki locally