← Back to Home
Beginner ~15 min read

Authoring Performance Scenarios

PerfScenario assets are the core of PerfGuard. Learn how to create camera paths, select the right stats, configure warmup, and organize your test suite.

1

Understanding PerfScenario Assets

A UPerfScenario is a UPrimaryDataAsset that packages everything PerfGuard needs to run a single performance test: which map to load, which Level Sequence to play, which stats to record, and how to handle warmup.

The Gauntlet controller uses the Asset Registry to discover scenarios by name at runtime, so they can live anywhere in your content hierarchy. One scenario = one test. A typical project has 3–10 scenarios covering different maps or camera angles.

📄
Content Browser showing several PerfScenario assets organized in a PerfGuard/ folder (e.g., PS_MainMenu, PS_GameplayHeavy, PS_OpenWorld)
Screenshot: Content Browser with scenario assets
2

Creating a Level Sequence Camera Path

Every scenario needs a Level Sequence that drives a CineCamera Actor along a deterministic path. This is what makes your tests repeatable — the same pixels are rendered every run.

In the editor:

  1. Go to Cinematics → Add Level Sequence and save it
  2. In the Sequencer, click + Track → Actor to Sequencer → CineCamera Actor
  3. Move the camera to your starting position and keyframe the Transform
  4. Advance the timeline, reposition the camera, and add more keyframes
  5. Repeat until you've covered the heaviest views in the map
🎥
UE5 Sequencer panel with a CineCamera Actor track showing multiple transform keyframes over a 20-second timeline
Screenshot: Sequencer timeline with camera keyframes
💡
Tip Use Pilot mode (right-click the CineCamera in the viewport → Pilot) to fly the camera manually. This is the fastest way to author a realistic path without fighting the transform gizmo.
Warning Avoid sequences that depend on gameplay state (enemies spawning, physics objects settling). Camera-only paths are deterministic; gameplay is not. If you need gameplay-driven scenarios, consider the Replay system (future feature).
3

Configuring Scenario Properties

Open your PerfScenario asset and set these core properties in the Details panel:

  • Scenario Name — A unique identifier used by the CLI (e.g., MainMenu_Flythrough)
  • Map — Soft reference to the level asset to load
  • Level Sequence — Soft reference to the camera sequence to play
PerfScenario Details panel with Scenario Name, Map, and Level Sequence fields filled in
Screenshot: Core scenario properties
4

Selecting Stats to Track

The Tracked Stats array determines which CSV profiler columns PerfGuard monitors. Common choices:

  • FrameTime — Total frame time in ms (the primary metric)
  • GameThreadTime — CPU game thread cost
  • RenderThreadTime — CPU render thread cost
  • GPUTime — GPU frame cost
  • DrawCalls — Number of draw calls per frame
  • TrianglesDrawn — Triangle count per frame

You can track any column present in the CSV profiler output. Start with the defaults and add more as you identify bottlenecks.

💡
Tip Don't track too many stats — it creates noise in reports and makes regressions harder to triage. Start with FrameTime, GPUTime, and GameThreadTime, then add specifics as needed.
5

Setting Warmup Frames

The first frames of any capture are polluted by shader compilation, texture streaming, and level loading hitches. The Warmup Frames setting tells PerfGuard how many initial frames to discard before measuring.

A typical value is 60 frames (about 1 second at 60fps). If your scene has heavy streaming (large open worlds), increase to 120–180.

CLI Equivalent
perfguard baseline record MyScenario \
    --csv path/to/csv \
    --warmup 60  # Skip first 60 frames
Warning Setting warmup too low will include shader compilation hitches, inflating your baseline and masking real regressions. Too high wastes capture data. Check the frame time histogram in the report to find where the initial spike ends.
6

Using Tags for Organization

PerfScenario assets support tags for grouping and filtering. Use them to categorize tests by area, priority, or purpose:

  • gpu-heavy — Scenes that stress the GPU
  • cpu-bound — Game thread bottleneck tests
  • smoke — Fast sanity checks for every PR
  • nightly — Comprehensive tests for nightly builds
  • marketplace-demo — Scenarios for demo scenes

Tags can be used in suite configuration files to run subsets of your test suite in different CI contexts.

7

Naming Conventions and Best Practices

Adopt a consistent naming scheme so scenarios are self-documenting:

Recommended Pattern
# Pattern: PS_{MapName}_{ViewDescription}
PS_MainMenu_FullRotation
PS_CityLevel_StreetFlythrough
PS_Arena_CombatOverview
PS_OpenWorld_LongDrive
  • Prefix with PS_ so scenarios are easy to find in the Content Browser
  • Include the map name for immediate context
  • Describe what the camera does, not the test purpose
  • Store all scenarios under Content/PerfGuard/Scenarios/
8

Testing Scenarios in the Editor

Before running headless Gauntlet captures, verify your scenario works in the editor. Open the PerfScenario asset and use the Preview functionality to play the sequence in-editor and confirm the camera path is correct.

Check for:

  • Camera clips through geometry
  • Sequence length is appropriate (10–30 seconds)
  • The heaviest views are covered by the camera path
  • No dependency on runtime gameplay state
PerfScenario asset with the Preview button highlighted, showing an in-editor camera flythrough playing in the viewport
Screenshot: In-editor scenario preview
💡
What's next? Now that you can author scenarios, learn how to manage baselines for regression comparison, or set up CI/CD pipelines to automate the process.