Skip to main content

UE Batch Profiler

A batch profiling plugin to capture frames using RenderDoc or UE Insights through various Profiling Cameras. Can be used from console commands.

The Need For Speed

Either you want to optimize something or find the bottleneck, it is crucial to know the current changes and use as much as the same conditions to better understand the output of the profiling. In order to maintain this consistency, using the same camera setup on the same views are really useful, but it is time consuming to do manually.

To better analyze the frame and have a more smooth capture process, I have created this plugin. It helps you to

  • Have seperated ProfilingCamera actors around the world you can use and adjust without messing with game cameras within the world
  • Allows you to capture with UE Insights and RenderDoc (must be installed and enabled)
  • Can capture active view or run a batch capture from all active profiling cameras
  • Activate / Deactivate those cameras individually for batch capturing
  • Can capture with custom resolutions and window modes
  • Can execute console commands before and after capture such as stat commands
  • Can delay capture for n seconds to prevent hiccups
  • Can capture with custom naming rulesets and trace channels (UE Insights trace only)

Usage

This plugin is still in development.

Installation

Head to the project repository first. You can either

  • Clone the repository inside your project's Plugins folder (Recommended - You can update the plugin easily)
  • Download the latest release and extract it into your project's Plugins folder

RenderDoc Integration

If you want to use RenderDoc feature, install RenderDoc and enable the plugin from Unreal Engine. To complete the RenderDoc plugin installation, you should head to the plugin settings and set the binary path of RenderDoc, if not already set. For more information please refer to RenderDoc Plugin Repository.

Profiling Camera

Profiling Cameras are derived from regular cameras with profiling capabilities. You can add those to your world through blah blah blah or use a shortcut from settings.

Profiling Camera Properties

  • Active On Profiling: Defines if the camera will be captured during batch runs
  • Camera Name: Defines the name of the camera, helping identifying the frame better

Commands

In order to start profiling, you should either

  • Use PIE mode and activate console from ~ key.
  • Use Standalone mode and activate console from ~ key.

Camera Switching Commands

cpp
// Switches to next profiling camera (if available and active on profiling)
cp.next

// Switches to previous profiling camera (if available and active on profiling)
cp.prev

RenderDoc Commands

cpp
// Captures frame using RenderDoc
cp.start.renderdoc

// Captures frames from all profiling cameras using RenderDoc
cp.batch.renderdoc

// You can optionally add an argument to define how many frames to capture.
// Defaults to the value set in settings
cp.start.renderdoc 2
cp.batch.renderdoc 2

UE Insights Commands

cpp
// Captures frame using UE Insights
cp.start.trace

// Captures frame using UE Insights
cp.start.snapshot

// Captures frames from all profiling cameras using UE Insights trace
cp.batch.trace

// Captures frames from all profiling cameras using UE Insights snapshot
cp.batch.snapshot

// You can optionally add an argument to define how many seconds to trace
// Defaults to the value set in settings. Works only on trace
cp.start.trace 2
cp.batch.trace 2

Settings

There are multiple settings that work globally. In order to access them, go to Edit > Project Settings > Plugins > UE Batch Profiler.

Generic Settings

  • Delay Before Capture: Delays for n seconds to prevent hiccups
  • Pre-Capture Commands: Array of strings to execute console commands before starting capture
  • Post-Capture Commands: Array of strings to execute console commands after completing capture
  • Use Custom Resolutions: If enabled, allows you to profile using custom resolutions
  • Fullscreen Window: Defines if the window will be Fullscreen or Windowed
  • Custom Resolution: Defines the window resolution if custom resolution is enabled

UE Insights Settings

  • Use Snapshot Instead: Uses trace.snapshot instead of trace.file
  • Capture Naming: You can define a custom capture naming ruleset here
  • Available Tokens: A read-only field that shows all available tokens for capture naming
  • Trace Settings: This section allows you to customize trace options
  • Capture Seconds: How many seconds will the trace run
  • Enabled Trace Channels: You can define which channels to trace here. By default Log, Frame, GPU, CPU, and Bookmark enabled

RenderDoc Settings

  • Frame Amount: Defines how many frames to be captured for each camera