Master Unreal Engine C++ Development
Unreal Engine 5 C++ guidelines - UObject/GC safety, Epic naming conventions, performance patterns, and a PR checklist.
Why it matters
Elevate your Unreal Engine 5 C++ development with expert-level guidance on robust coding practices, performance optimization, and adherence to Epic Games' standards.
Outcomes
What it gets done
Write standard-compliant C++ for Unreal Engine 5.
Optimize performance-critical game code.
Debug memory leaks and garbage collection issues.
Implement Blueprint-exposed functionality and manage reflection systems.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/ag-unreal-engine-cpp-pro | bash Overview
Unreal Engine C++ Pro
Unreal Engine 5 C++ development guidelines: UObject/garbage-collection safety, Epic Games naming conventions, performance patterns (Tick avoidance, soft references), and a pre-PR checklist. Use when writing C++ for Unreal Engine 5.x - Actors, Components, UObject classes, or performance-critical and Blueprint-exposed code.
What it does
Unreal Engine C++ Pro provides expert-level guidelines for developing with Unreal Engine 5 using C++, focused on robust, performant, standard-compliant code. Core principles cover UObject and garbage collection (always wrap UObject* members in UPROPERTY() so the garbage collector tracks them, prefer addToRoot() over TStrongObjectPtr<> for root references outside a UObject graph, and use IsValid() rather than a raw nullptr check since it safely handles the pending-kill state), the reflection system (UCLASS/USTRUCT/UENUM/UFUNCTION to expose types to Blueprints, preferring BlueprintReadOnly over BlueprintReadWrite to avoid state being trampled from UI or level Blueprints), and performance (disable Tick by default and use timers or event-driven logic instead, avoid Cast<T>() in hot loops by caching references in BeginPlay, and use F-prefixed structs for data-heavy non-UObject types). It enforces Epic Games' strict naming conventions: T for templates, U for UObject, A for AActor, S for Slate widgets, F for structs, E for enums, I for interfaces, and b for booleans. Three common patterns are documented in full: robust component lookup done in PostInitializeComponents rather than Tick:
void AMyCharacter::PostInitializeComponents() {
Super::PostInitializeComponents();
HealthComp = FindComponentByClass<UHealthComponent>();
check(HealthComp); // Fail hard in dev if missing
}
interface-based decoupling via Implements<>() and Execute_ pattern calls; and async loading via TSoftClassPtr/TSoftObjectPtr instead of hard TSubclassOf references that force load-order chains, with LoadSynchronous() or a StreamableManager for async loading.
When to use - and when NOT to
Use this skill when developing C++ for Unreal Engine 5.x projects, writing Actors/Components/UObject-derived classes, optimizing performance-critical code, debugging memory leaks or garbage collection issues, implementing Blueprint-exposed functionality, following Epic's coding standards, working with the reflection system, or managing asset loading via soft references. Do not use it for Blueprint-only projects with no C++ code, Unreal Engine versions prior to 5.x, or non-Unreal game engines.
Inputs and outputs
Given an Unreal Engine C++ task, the skill outputs standard-compliant code following the above patterns, plus debugging techniques: UE_LOG with a custom log category via DEFINE_LOG_CATEGORY_STATIC, on-screen debug messages via GEngine->AddOnScreenDebugMessage, and the Visual Logger (implementing IVisualLoggerDebugSnapshotInterface) for AI debugging. A pre-PR checklist confirms whether an Actor truly needs to Tick or could use a Timer instead, whether all UObject* members are wrapped in UPROPERTY, whether hard TSubclassOf references are causing avoidable load chains, and whether delegates are cleaned up in EndPlay.
Integrations
Targets Unreal Engine 5.x's C++ API directly: UPROPERTY/UCLASS/USTRUCT/UFUNCTION reflection macros, GetWorldTimerManager() for timer-based logic, FindComponentByClass, and the TSoftClassPtr/TSoftObjectPtr/StreamableManager async-loading system.
Who it's for
Unreal Engine 5 C++ developers who want Epic Games' actual coding standards and performance patterns - correct UObject lifetime management, Tick avoidance, soft-reference asset loading - enforced via a concrete pre-PR checklist, rather than ad-hoc C++ that happens to compile.
FAQ
Common questions
Discussion
Questions & comments ยท 0
Sign In Sign in to leave a comment.