debugging-techniques

Diagnose Unreal Engine C++ gameplay bugs using DrawDebug helpers, Visual Logger, and Gameplay Debugger.

1|Updated Sep 6, 2026
One-click install
npx skills add https://github.com/ziyarduc/Baran-bk-game --skill debugging-techniques-ziyarduc
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: debugging-techniques
Source: https://github.com/ziyarduc/Baran-bk-game/tree/main/.agents/skills/debugging-techniques
Command: npx skills add https://github.com/ziyarduc/Baran-bk-game --skill debugging-techniques-ziyarduc

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Unreal Engine gameplay bugs — wrong values, bad positions, intermittent AI decisions, crashes — are hard to diagnose with logging alone. This Skill guides you to the right debugging tool for each question: DrawDebug shapes for spatial issues, the Visual Logger for events over time, the Gameplay Debugger for live AI/system state, and the native debugger for crashes. ## Core Features & Use Cases - World-space visualization: DrawDebugLine, DrawDebugSphere, DrawDebugCapsule, DrawDebugString, and on-screen messages via GEngine->AddOnScreenDebugMessage to inspect traces, ranges, and live values. - Timeline replay with Visual Logger: Record UE_VLOG text and spatial entries per actor, then scrub the timeline to reproduce intermittent or AI bugs that unfold over seconds. - Custom Gameplay Debugger categories: Register FGameplayDebuggerCategory subclasses with CollectData/DrawData replication to overlay your own system's state in PIE. - Native debugging and console tooling: VS/Rider breakpoints with natvis, Live Coding caveats, ensure vs check usage, and stat/showdebug/cvar commands for runtime interrogation. - Use Case: An AI bot in your Battle Royale project occasionally picks the wrong target. Record UE_VLOG_SEGMENT entries of its perception checks, replay the Visual Logger timeline, and confirm the exact frame the wrong target was acquired. ## Quick Start Ask the AI to help you visualize a weapon trace or AI detection radius in your Unreal Engine project using the appropriate DrawDebug or Visual Logger technique.

Frequently Asked Questions about debugging-techniques

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I visualize a line trace or detection radius in Unreal Engine?▼

Use DrawDebugLine for traces and DrawDebugSphere or DrawDebugCapsule for radii, called from any code with a UWorld pointer. Include DrawDebugHelpers.h and set LifeTime and bPersistentLines to control how long shapes stay visible.

How do I debug an intermittent AI bug in Unreal Engine?▼

Record the session with the Visual Logger using UE_VLOG, UE_VLOG_LOCATION, and UE_VLOG_SEGMENT macros attached to the AI actor. Then open the Visual Logger window and scrub the timeline to see exactly what the actor perceived and decided at each frame.

What is the difference between check and ensure in Unreal Engine?▼

check is a fatal assertion that crashes the process when the condition fails, while ensure logs the failure with a callstack and lets the editor continue running. Prefer ensure for non-fatal invariants in gameplay code to avoid losing unsaved work.

Does DrawDebug work in Shipping builds?▼

No. All DrawDebug functions are guarded by ENABLE_DRAW_DEBUG, which evaluates to false in Shipping builds, so they are automatically stripped. The same applies to GEngine->AddOnScreenDebugMessage and UE_VLOG macros.

How do I add a custom category to the Gameplay Debugger?▼

Subclass FGameplayDebuggerCategory, implement CollectData and DrawData, then register it in StartupModule via IGameplayDebugger::RegisterCategory. Guard all code with WITH_GAMEPLAY_DEBUGGER and call SetupGameplayDebuggerSupport in your Build.cs file.

Why does my game crash after using Live Coding in Unreal Engine?▼

Live Coding cannot handle structural changes like new UPROPERTY members, changed class layout, or header edits affecting other translation units. After such changes it may appear to succeed but leave stale class layouts, so do a full editor restart and rebuild instead.