Diagnose a running game
Choose a diagnostic by the question
| Question | First check | Evidence to keep |
|---|---|---|
| Which C++ implementation runs? | Generate a compilation database for the editor target, then use the agent's clangd definitions and references. Follow the class default and the map's actual consumer. | Target, engine version, selected translation unit and diagnostics |
| Which thread took the time? | Capture a short Insights trace during the suspect action. Export timer statistics headlessly. Use PresentMon for presented frames and RenderDoc for one problematic GPU frame. | Trace, event boundaries and filtered CSV |
| Did a remote player observe the change? | Use the game's existing multiplayer test or a Gauntlet node with a server and two clients. Assert unique owners, authority and peer state, then disconnect one player. | Per-role logs, build, transport, map, input and assertions |
| Which asset is the game using? | Query Asset Registry in Editor Python, load the selected asset and inspect its skeleton and material slots. Follow the reference from the map or pawn. Reopen after saving edits. | Object paths and cold readback |
| Can this input be recovered? | Run Hygiene preflight and the project's archive verification. For a separate restic repository run restic check --read-data, restore to a new directory and compare file hashes. | Snapshot ID, restore directory and both SHA-256 values |
Index a UE module and inspect a trace
In PowerShell set $engine to the engine root, $project to the absolute project file and $run to a fresh evidence directory. Substitute the project's editor target and source file. UBT generates the flags for UHT headers and engine macros. Point clangd at that directory and check its log for the actual compilation command.
& "$engine/Engine/Build/BatchFiles/Build.bat" -Mode=GenerateClangDatabase MyGameEditor Win64 Development "-Project=$project" "-OutputDir=$run"
clangd "--compile-commands-dir=$run" "--check=$source"Capture with -trace=frame,cpu,gpu -tracefile=... on the process executing the test. Use absolute paths in this PowerShell example. Open the resulting CSV and inspect counts and time units. Match input, map, build, resolution and warm-up for a comparison. Fixed-step replay and screenshot readback distort frame pacing.
"TimingInsights.ExportTimerStatistics `"$run/timers.csv`"" | Set-Content "$run/export.rsp" -Encoding ascii
& "$engine/Engine/Binaries/Win64/UnrealInsights.exe" "-OpenTraceFile=$run/game.utrace" -NoUI -AutoQuit "-ExecOnAnalysisCompleteCmd=@=$run/export.rsp"PresentMon 2.x accepts --process_id PID --timed 15 --terminate_after_timed --output_file frames.csv. The UE-bundled 1.8 uses single dashes. Select one swap chain and phase, then compute nearest-rank P95/P99 of positive frame intervals in milliseconds. Report the 1% low convention explicitly (1000 divided by the mean of the slowest 1% of intervals). ETW access was denied on the test account. Use RenderDoc's event browser and pipeline state manually when an identified draw or render target needs inspection. PresentMon CLI · Timing export · Gauntlet
Repeat a project diagnosis
- Gameplay C++. Open the project with a clangd client using the generated database. In the actual class header, go to the definition of an overridden method. Find references from a second translation unit and use type hierarchy to open the engine base. Open the project's generated
Intermediate/Build/.../Inc/<Module>/UHT/*.gen.cppand follow a reflected call inside its generated wrapper back to the implementation. Save paths and line numbers. If navigation fails, confirm the target built with UBT and UHT before changing source. - Frame pacing. Run the same build and input twice in real time. Keep both event files and traces. In the response file above use
TimingInsights.ExportTimingEvents "D:/run/ticks.csv" -threads=GameThread -timers=FEngineLoop::Tick -columns=StartTime,EndTime. Use forward slashes inside quoted response-file paths on Windows. For wall intervals keep consecutive engine frame numbers in the matched action only. Keep the GPU query and the trace-wide Tick distribution separate. Close the comparison when both intervals are aligned or document the missing clock. - Packaged multiplayer. Start with
RunUAT.bat RunUnreal -project=GAME.uproject -build=STAGED_DIRECTORY -platform=Win64 -configuration=Development -test=UE.BootTest. Then use-test=UE.NetworkAutomation.ListenServer -map=/Game/Maps/YOUR_MAP -clientip=127.0.0.1. Save each role log. The project must supply its test inputs, nonzero displacement and distinct owner/authority/peer assertions, and its completion signal. A node timeout after two joins establishes connectivity only. Run the game's existing packaged test when it already provides these assertions and exit handling. - Field trials. Use
ueagent run --project GAME.uproject --native --test Full.Test.Namefor the red and green checks. Match the project's editor plugin flags with repeated--editor-arg. UBT checks cached dependencies on each native target run. Count invoked builds and launched tests from each run'scommands.jsonl; retain the failing and passing Automation reports. Record the tested UI, game state or unit of work. A frame-rate or productivity improvement needs its own measured baseline.
Reproduce the low-resolution scene
In a disposable D3D12 game host enable UE's RenderDoc plugin, set its binary path to the official installation, launch with -AttachRenderDoc and wait for the gameplay HUD. For this controlled reproduction, set r.ScreenPercentage 50 in a 960×540 window and execute renderdoc.CaptureFrame. Keep the RDC from Saved/RenderDocCaptures and its SHA-256. The thumbnail preserves the symptom. The XML records the actual D3D12 commands.
renderdoccmd thumb -o frame.png $capture
renderdoccmd convert -f $capture -o frame.xml -c xml
Get-FileHash -Algorithm SHA256 $captureInspect RSSetViewports and its Width/Height values, or select draws in RenderDoc's Event Browser and inspect the rasterizer viewport. Keep the capture and measured counts. The XML can be regenerated and was about 0.8 GB in this example.
Run a release check on the staged deliverable
Use the project's existing RunUAT BuildCookRun or BuildGraph script with its map list and target configuration. Start the staged executable, record its hash and test the formal entry point. For Gauntlet, use the project's node name with RunUAT RunUnreal -project=... -build=... -test=.... The node must define the roles and the game's pass conditions. Keep client logs separate. To examine replication, enable Network Insights on the scoped test run; packet capture with TShark is an additional diagnostic when engine events leave an unanswered transport question.
For optional supply-chain checks, scan the release input tree or staging directory. gitleaks git . --redact checks repository history, syft dir:STAGE -o spdx-json=sbom.json inventories staged packages, and osv-scanner scan source -r STAGE checks supported manifests. Keep reports local and resolve license findings against upstream notices. These are upstream CLI recipes. Gitleaks · Syft · OSV-Scanner
Choose an asset or porting tool
Start by reading the project's source, importer settings and reference data. In Editor Python, unreal.AssetRegistryHelpers.get_asset_registry() can enumerate assets by class. Load the selected mesh and inspect mesh.get_editor_property("skeleton") and mesh.get_editor_property("materials"). For a changed animation, compare source and retargeted curves, compressed evaluation and a pose observed on the actual pawn. For an external interchange file, use a new output directory and the relevant upstream CLI. Blender background mode can run a project-owned import inspection script with blender --background --factory-startup --python inspect_asset.py -- input.fbx. Blender is a guidance-only path.
For a port, record the original revision, license, source function or resource path, observed input and expected behavior. Keep game assets and research outputs in the authorized project. Use the existing PCK inspector for supported packages. Choose format-specific tools only when source or metadata leaves a concrete question unanswered. Runtime instrumentation and binary decompilation have no role in the verified workflows above.
For window capture, aligned footage and FFmpeg recipes, see Visual and media evidence.