- Home
- Skills
- Game Development
- Unreal Engine 5 C++ Builder: Conventions and Headless Tests
Unreal Engine 5 C++ Builder: Conventions and Headless Tests
UE5 C++ that compiles, survives garbage collection, keeps rules testable and the server in charge.
$9
Works with the AI Agents you already use
Unreal Engine 5 C++ Builder: Conventions and Headless Tests
Example session with this skill installed
I need a server-authoritative health component for my character. It should handle damage and death, with validation to ensure damage values aren't negative.
- Read your context and instructions
- Compiled the unreal engine 5
I have created the C++ health component with server-side validation and a corresponding automation test to verify the logic.
Health Component Implementation
// Source/MyGame/Public/HealthComponent.h
#pragma once
#include "CoreMinimal.h"
#include "Components/ActorComponent.h"
#include "HealthComponent.generated.h"
UCLASS(ClassGroup=(Custom), meta=(BlueprintSpawnableComponent))
class MYGAME_API UHealthComponent : public UActorComponent
{
GENERATED_BODY()
public:
UHealthComponent();
UFUNCTION(BlueprintCallable, Category = "Health")
float GetHealth() const { return CurrentHealth; }
UFUNCTION(Server, Reliable, WithValidation)
void ServerApplyDamage(float DamageAmount);
protected:
virtual void BeginPlay() override;
UPROPERTY(ReplicatedUsing = OnRep_CurrentHealth, EditAnywhere, Category = "Health")
float CurrentHealth;
UPROPERTY(EditAnywhere, Category = "Health")
float MaxHealth = 100.0f;
UFUNCTION()
void OnRep_CurrentHealth();
};
// Source/MyGame/Private/HealthComponent.cpp
#include "HealthComponent.h"
#include "Net/UnrealNetwork.h"
UHealthComponent::UHealthComponent()
{
PrimaryComponentTick.bCanEverTick = false;
SetIsReplicatedByDefault(true);
CurrentHealth = MaxHealth;
}
void UHealthComponent::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
{
Super::GetLifetimeReplicatedProps(OutLifetimeProps);
DOREPLIFETIME(UHealthComponent, CurrentHealth);
}
bool UHealthComponent::ServerApplyDamage_Validate(float DamageAmount)
{
// Reject negative damage or extreme values
return DamageAmount >= 0.0f && DamageAmount < 10000.0f;
}
void UHealthComponent::ServerApplyDamage_Implementation(float DamageAmount)
{
CurrentHealth = FMath::Clamp(CurrentHealth - DamageAmount, 0.0f, MaxHealth);
if (CurrentHealth <= 0.0f) { /* Trigger Death Logic */ }
}
Next steps
- Add
PublicDependencyModuleNames.AddRange(new string[] { "NetCore" });to yourMyGame.Build.cs. - Attach this component to your Character Blueprint in the Unreal Editor.
- Run the generated automation test
Project.MyGame.Health.DamageValidationto verify the bounds checking.
Connects securely to your tools. The creator never sees your data.
About this skill
Building Unreal Engine 5 games in C++ often leads to "out of memory" crashes, garbage collection bugs, and server-side cheating. This skill enforces strict UE5 conventions and multiplayer authority so your game stays stable and secure.
What it does
- Memory safety ensures UObject lifetimes are managed via
TObjectPtr,UPROPERTY, andTWeakObjectPtrto prevent dangling pointers. - Multiplayer authority implements server-authoritative logic using
WithValidationRPCs to block client-side cheating. - Gameplay framework scaffolds GameModes, Pawns, and Controllers while keeping input logic inside the Enhanced Input subsystem.
- Automated testing generates headless C++ automation tests that run via command-line without launching the full editor.
- Build orchestration provides exact
UnrealBuildToolandBuildCookRuncommands for consistent CI/CD or local builds.
How it works
- Module setup configures
.uprojectfiles andBuild.csdependencies for new gameplay features. - Logic implementation writes C++ classes following the
UCLASSandGENERATED_BODYmacros. - Data binding exposes C++ properties to Blueprints for designer tuning without leaking core logic into binary graphs.
- Validation runs headless tests with
-nullrhito verify rules before the developer launches the editor.
Frameworks & tools
This skill is built for Unreal Engine 5.x C++ projects using UnrealBuildTool (UBT), Enhanced Input, UMG, and the Unreal Automation Framework.
Why this beats prompting it yourself
Generic LLMs often suggest standard C++ new/delete or std:: containers which crash Unreal's garbage collector. This skill strictly uses engine-specific types like TArray and FString while enforcing the required _Validate and _Implementation patterns for RPCs.
Use cases
- Migrating fragile Blueprint logic into stable, testable C++ modules.
- Hardening a multiplayer game against speed hacks and inventory manipulation.
- Setting up a headless CI pipeline to catch regressions in gameplay rules.
- Scaffolding a new UE5 project with a clean separation of C++, Config, and Content.
Known limitations
Does not support direct editing of binary .uasset or .umap files. Requires a local Unreal Engine installation to run the generated BuildTool commands.
Cannot edit binary .uasset or .umap files directly. Developer must manually launch the Editor to compile shaders or perform visual layout. Requires local UE5 installation for CLI commands.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 7 days ago