Skilllibrary blueprint-patterns
Implements clean Unreal Engine 5 Blueprint architecture including BP types, event flow, BP-C++ boundaries, interfaces, macros vs functions, casting, and performance. Use when designing or refactoring UE5 Blueprints, wiring GameplayAbilitySystem or Enhanced Input in BP, or fixing spaghetti Blueprint graphs.
install
source · Clone the upstream repo
git clone https://github.com/merceralex397-collab/skilllibrary
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/merceralex397-collab/skilllibrary "$T" && mkdir -p ~/.claude/skills && cp -r "$T/13-game-engines-and-creative-tech/blueprint-patterns" ~/.claude/skills/merceralex397-collab-skilllibrary-blueprint-patterns && rm -rf "$T"
manifest:
13-game-engines-and-creative-tech/blueprint-patterns/SKILL.mdsource content
Purpose
Design and implement clean, performant Unreal Engine 5 Blueprint architectures: correct BP type selection, event-driven communication, BP-C++ interop, interface decoupling, and performance optimization for visual scripting graphs.
When to use this skill
- Creating or refactoring UE5 Blueprint actors, widgets, or components
- Wiring Blueprint-to-C++ boundaries (
,UFUNCTION
macros)UPROPERTY - Designing Blueprint interfaces for decoupled actor communication
- Integrating GameplayAbilitySystem (GAS) or Enhanced Input via Blueprints
- Debugging Blueprint execution flow, breakpoints, or watch values
- Optimizing Blueprint performance (replacing Tick, nativizing hot paths)
Do not use this skill when
- Working in Unity or Godot — this is UE5-specific
- Writing pure C++ without Blueprint exposure — use general C++ patterns
- The task is about NPC AI logic — use
(though BT integration overlaps)ai-npc-behavior - The task is about asset import/compression — use
asset-pipeline
Operating procedure
- Choose the correct Blueprint type:
- Actor BP: for placed-in-world entities (characters, pickups, triggers).
- Component BP: for reusable behavior attached to any actor (health component, inventory).
- Widget BP: for UMG UI elements (HUD, menus, popups).
- Interface BP: for defining contracts without coupling (IDamageable, IInteractable).
- Function Library: for pure static utility functions (math helpers, string formatters).
- Macro Library: for reusable graph snippets that inline-expand (multi-output control flow).
- Design event flow:
- Use
for initialization, avoidBeginPlay
unless per-frame updates are truly needed.Tick - Prefer Timers (
) over Tick for periodic logic.SetTimerByEvent - Use Event Dispatchers (multicast delegates) for one-to-many notification (e.g., OnHealthChanged).
- Use Custom Events for internal Blueprint communication.
- Bind dispatchers in BeginPlay, unbind in EndPlay to prevent dangling references.
- Use
- Set up BP-C++ boundaries:
: C++ function callable from BP.UFUNCTION(BlueprintCallable)
: C++ declares, BP implements.UFUNCTION(BlueprintImplementableEvent)
: C++ provides default, BP can override.UFUNCTION(BlueprintNativeEvent)
: expose variables to BP editor.UPROPERTY(EditAnywhere, BlueprintReadWrite)- Keep heavy computation in C++; keep configuration and wiring in BP.
- Use interfaces for decoupling: create a Blueprint Interface (e.g.,
) withBPI_Interactable
. Implement on any actor. Call viaInteract(AActor* Caller)
→Does Implement Interface
message. Never hard-cast to concrete types for communication.Interact - Understand macros vs functions: Macros inline-expand (support multiple exec outputs, no call overhead, no breakpoints). Functions use call stack (debuggable, support local variables, cause one function call). Use macros only for flow control; use functions for everything else.
- Manage casting and references: avoid frequent
calls — cache results. Use Soft Object References (CastTo<>
) for assets to prevent hard loading. UseTSoftObjectPtr
checks before dereferencing.IsValid() - Integrate GAS in Blueprints: create GameplayAbilities as BP subclasses, bind to
via Enhanced Input. UseInputAction
. Wire gameplay effects and attribute sets via BP-exposed properties.AbilitySystemComponent->TryActivateAbility() - Debug and profile: set BP breakpoints (F9), add watch values, step through execution. Use
and Blueprint profiler to find hot nodes. Nativize performance-critical BPs viastat game
project setting.NativizeAssets
Decision rules
- If a BP graph exceeds ~50 nodes, split into functions or sub-Blueprints.
- If the same logic appears in 3+ Blueprints, extract to a Component BP or Function Library.
- If an actor needs to communicate without knowing the receiver type, use a Blueprint Interface.
- If Tick is used, justify it — most logic should be event-driven or timer-based.
- If performance profiling shows BP overhead >1ms/frame, move the hot path to C++ with
.BlueprintCallable - Prefer Event Dispatchers over direct references for observer-pattern communication.
- Use
andCollapsed Graphs
to organize complex BP graphs visually.Comment Boxes
Output requirements
— which BP type and rationaleBlueprint Type
— text description of event chain (BeginPlay → Bind → Dispatch → Handle)Event Flow Diagram
— any UFUNCTION/UPROPERTY declarations neededC++ Interface
— key nodes, connections, and variable namesBlueprint Graph Description
— Tick usage, cast frequency, nativization candidatesPerformance Notes
— breakpoint locations and expected execution flowDebug Steps
References
- UE5 Docs: Blueprint Visual Scripting, Blueprint Best Practices, Blueprint Communication
- UE5 API:
,UBlueprintFunctionLibrary
,UBlueprintInterfaceUGameplayAbility - UE5 Enhanced Input:
,UInputAction
, BP bindingUInputMappingContext - UE5 GAS:
,UAbilitySystemComponent
,UGameplayEffectFGameplayAttribute - Epic Games, Blueprint Nativization documentation
Related skills
— UE5 behavior trees are authored in BP + Blackboardai-npc-behavior
— UMG widgets are Blueprint-basedgame-ui-hud
— save game objects exposed to BP viasave-load-stateUSaveGame
— replicated properties and RPCs in BPmultiplayer-netcode
Failure handling
- If a Blueprint compile error occurs, check for broken references — use
andFind References
tools.Redirect - If casting fails at runtime, add
checks and log the failing actor class.IsValid - If BP performance is unacceptable, identify the node via Blueprint Profiler and move to C++.
- If spaghetti is already severe, refactor incrementally: extract one function per PR, add comment boxes, replace casts with interfaces.