Gameplay Coverage
Code coverage says little about a game. A line of an ability can run in every test without any test checking what the ability does. Specter reports coverage in your game's own terms: which abilities, effects, attributes, widgets, actors, maps, gameplay tags and AI states your tests drove or checked, which only ran along the way, and which no test reaches at all.
The Coverage Window
Open it from Tools › Specter › Coverage, or from the Coverage percentage in the Test Runner. Every test you run in Play-In-Editor is recorded, so the numbers follow the latest run of each test: run one test and only its record changes.

Tested, Reached, No Test
Everything in the game is in one of three states:
- Tested: a test drove it or checked it directly. It triggered the ability, clicked the widget, read the attribute, spawned the actor, loaded the map.
- Reached: it ran or was on screen while a test ran, but no test named it. Something exercised it, and nothing would notice if it broke.
- No test: no test went near it.
Coveredmeans tested or reached, and the window always shows both numbers. The reached list is usually the most useful one: it's the things that already work in a test and only need an expect. A touch on a class also counts for the classes it extends.
What It Counts
| Category | What's listed | Tested when |
|---|---|---|
| Abilities | Gameplay ability classes | A test triggered it, or checked that it activated |
| Effects | Gameplay effect classes | A test applied it, checked it, or checked an attribute it changed on the same actor |
| Attributes | Each attribute of each attribute set | A test read or checked it |
| Widgets | Widget Blueprints and C++ widget classes | A test located, clicked or checked it |
| Actors | Actor classes | A test spawned, located or checked one |
| Maps | The project's maps | A test loaded it |
| Tags | The most specific gameplay tags (Status.Stunned, not Status) | A test checked for it |
| AI states | StateTree states with no child states, and Behavior Tree tasks | A test checked the AI was in it |
| Functions | Functions you mark (opt-in, below) | A test called it with callFunction |
Blueprints are listed from the asset registry, without loading them. Listing AI states loads each StateTree and Behavior Tree under the included paths.
Functions You Mark
Some of a game's rules live in plain functions rather than abilities: scoring, a damage formula, a save. Mark the ones you want measured and they get a Functions category of their own, with the same three states: tested when a test calls it with callFunction, reached when it runs during a test.
In a Blueprint
Select the function and tick Include in Specter Coverage in its details, in the Graph section. It works in any Blueprint, function libraries and widgets included (not the construction script). The Blueprint recompiles before the next Play, and the window shows the function straight away, before you save.
In C++
Functions written in C++ don't have the Blueprint checkbox: add SpecterCoverage to a UFUNCTION's metadata, or to a UCLASS to mark every UFUNCTION it declares, and rebuild the editor:
// One function
UFUNCTION(BlueprintCallable, meta = (SpecterCoverage))
int32 ScoreTake();
// Every UFUNCTION the class declares
UCLASS(meta = (SpecterCoverage))
class AStuntDirector : public AActor
{
GENERATED_BODY()
...
};Specter sees a marked C++ function run when it's called from a Blueprint, an event, a delegate or a test. A call from other C++ code goes through nothing Specter can watch, so for those put SPECTER_COVERED()at the top of the function. It works in member functions of a UCLASS, needs the Specter module in your game module's dependencies, and compiles to nothing in Shipping builds.
#include "SpecterCovered.h"
int32 AStuntDirector::ScoreTake()
{
SPECTER_COVERED(); // so a call from other C++ code counts too
...
}Tested or Reached
// Tested: the test calls the marked function itself
const score = await director.callFunction("ScoreTake");
expect(score).toBeGreaterThan(0);
// Reached: the function ran because of something else the test did
await world.getByWidget("WBP_Toolbar").getChild("ActionButton").click();- A child Blueprint's override counts for the marked function it overrides.
- Events in an event graph aren't seen: they all run inside the graph's one generated function. To measure an event's logic, move it into a function and mark that.
- A Blueprint function is listed under its Blueprint, a C++ one under
C++ › Module › Class.
Choosing What Counts
Project Settings › Plugins › Specter Coveragedecides what counts as the game. It's saved in DefaultGame.ini, so the whole team sees the same number.
| Setting | Default | What it does |
|---|---|---|
| Include Paths | /Game | Content folders whose assets are counted. |
| Exclude Paths | None | Folders or assets left out: marketplace packs, samples, prototypes. A C++ module is /Script/Module, a class /Script/Module.Class. The eye button in the window adds to this list. |
| Include Project Plugins | On | Also count the content of the project's own plugins. |
| Include C++ Classes | On | Also count abilities, effects, attribute sets, widgets and actors written in the project's C++ modules. |
| Include Gameplay Tags | On | Count the project's most specific tags. Hide a branch by excluding /GameplayTags/Status. |
| Include AI States | On | Count StateTree leaf states and Behavior Tree tasks. |
Exporting a Report
Export report writes a single self-contained HTML page, plus the same data as JSON, to Saved/Specter/Coverage/. Share it, or archive one per build to see coverage move over time.
Limits
- Only tests run in Play-In-Editor are recorded. A standalone or packaged game, as on CI, keeps no record yet.
- Records are kept per machine, in
Saved/. - A deleted or renamed test keeps counting until you use Forget recorded coverage in the window's menu.
- Effects checked only by
toHaveAppliedGameplayEffect, or thegameplayEffectoption oftoHaveAttributeChange, count as reached rather than tested: those matchers work from events the game already sent, so the engine never hears which effect they named.