Chapter 03

The C++ / Blueprint Boundary

Designing the exposed surface: reflection macros, meta specifiers, and structuring a system that is both fast and tunable.

In this chapter

  1. Exposing C++ to Designers
  2. Meta Specifiers — Safe, Well-Ranged Knobs
  3. Performant and Designer-Tunable at Once
  4. The C++ Base / Blueprint Subclass Pattern
1

Exposing C++ to Designers

It happens through the reflection macros. They are how C++ becomes visible and editable to designers.

UPROPERTY — exposing a variable

SpecifierEffect
EditAnywhereEditable in the details panel, on both defaults and instances
EditDefaultsOnlyRestricts editing to the class defaults — the CDO (Chapter 6)
BlueprintReadWriteBlueprints can get and set it
Category="..."Organizes it into a labelled section of the panel

UFUNCTION — exposing a function

SpecifierEffect
BlueprintCallableDesigners can call it from a graph
BlueprintPureMarks a side-effect-free getter (no exec pins)
BlueprintImplementableEventDeclared in C++, implemented entirely in Blueprint
BlueprintNativeEventC++ provides a default that Blueprint can override
BlueprintPure nodes have no execution pins, which also means you cannot place a breakpoint on one — see Chapter 18.

2

Meta Specifiers — Safe, Well-Ranged Knobs

Safety and polish come from the meta specifiers:

This is the craft of the role: designing the exposed surface so designers get safe, well-organized, well-ranged knobs — not a wall of raw variables.

3

Performant and Designer-Tunable at Once

When a system has to be both, split it by kind of work rather than trying to compromise:

Designers tune numbers and compose responses in Blueprint and data. They never run expensive per-tick logic in Blueprint.


4

The C++ Base / Blueprint Subclass Pattern

"Gameplay logic in C++, tuning and composition in Blueprints" is the typical pattern because it puts each kind of work where it belongs.

C++ base class
  • Defines the system and its contract
  • Owns performance-critical logic
  • Declares the properties and events it exposes
Blueprint subclass
  • Sets the data
  • Composes components
  • Implements designer-facing events
  • Handles content-specific one-offs

What you get out of it:

Interview drill

Answer each out loud before re-reading the chapter.

  1. How do you expose C++ functionality to designers?
  2. If a system must be both performant and designer-tunable, how do you structure it?
  3. Why is "gameplay logic in C++, tuning and composition in Blueprints" the typical pattern?
← Chapter 2 ↑ Index Chapter 4 →