All skills
jeffallan avatar

/game-developer

@efebc44
by jeffallanjeffallan/claude-skills12k stars
1,124

Use when building game systems, implementing Unity/Unreal Engine features, or optimizing game performance. Invoke to implement ECS architecture, configure physics systems and colliders, set up multiplayer networking with lag compensation, optimize frame rates to 60+ FPS targets, develop shaders, or apply game design patterns such as object pooling and state machines. Trigger keywords: Unity, Unreal Engine, game development, ECS architecture, game physics, multiplayer networking, game optimization, shader programming, game AI.

Use this Skill: https://skilld.dev/gh/jeffallan/claude-skills/game-developer

This session only. Nothing lands on disk.

referencesunreal-cpp.md

≈2.2k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Unreal Engine C++ Development

Actor Component Pattern

// Header file: MyCharacter.h
#pragma once

#include "CoreMinimal.h"
#include "GameFramework/Character.h"
#include "MyCharacter.generated.h"

UCLASS()
class MYGAME_API AMyCharacter : public ACharacter
{
    GENERATED_BODY()

public:
    AMyCharacter();

protected:
    virtual void BeginPlay() override;

public:
    virtual void Tick(float DeltaTime) override;
    virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;

private:
    // Exposed to Blueprints
    UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Movement", meta = (AllowPrivateAccess = "true"))
    float WalkSpeed = 600.0f;

    UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Camera", meta = (AllowPrivateAccess = "true"))
    class UCameraComponent* CameraComponent;

    UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Camera", meta = (AllowPrivateAccess = "true"))
    class USpringArmComponent* SpringArm;

    void MoveForward(float Value);
    void MoveRight(float Value);
};
// Implementation: MyCharacter.cpp
#include "MyCharacter.h"
#include "Camera/CameraComponent.h"
#include "GameFramework/SpringArmComponent.h"
#include "GameFramework/CharacterMovementComponent.h"

AMyCharacter::AMyCharacter()
{
    PrimaryActorTick.bCanEverTick = true;

    // Create components
    SpringArm = CreateDefaultSubobject<USpringArmComponent>(TEXT("SpringArm"));
    SpringArm->SetupAttachment(RootComponent);
    SpringArm->TargetArmLength = 300.0f;
    SpringArm->bUsePawnControlRotation = true;

    CameraComponent = CreateDefaultSubobject<UCameraComponent>(TEXT("Camera"));
    CameraComponent->SetupAttachment(SpringArm, USpringArmComponent::SocketName);
}

void AMyCharacter::BeginPlay()
{
    Super::BeginPlay();

    GetCharacterMovement()->MaxWalkSpeed = WalkSpeed;
}

void AMyCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
{
    Super::SetupPlayerInputComponent(PlayerInputComponent);

    PlayerInputComponent->BindAxis("MoveForward", this, &AMyCharacter::MoveForward);
    PlayerInputComponent->BindAxis("MoveRight", this, &AMyCharacter::MoveRight);
    PlayerInputComponent->BindAxis("Turn", this, &APawn::AddControllerYawInput);
    PlayerInputComponent->BindAxis("LookUp", this, &APawn::AddControllerPitchInput);
}

void AMyCharacter::MoveForward(float Value)
{
    if (Controller && Value != 0.0f)
    {
        const FRotator Rotation = Controller->GetControlRotation();
        const FRotator YawRotation(0, Rotation.Yaw, 0);
        const FVector Direction = FRotationMatrix(YawRotation).GetUnitAxis(EAxis::X);
        AddMovementInput(Direction, Value);
    }
}

Blueprint Callable Functions

UCLASS()
class MYGAME_API UHealthComponent : public UActorComponent
{
    GENERATED_BODY()

public:
    UHealthComponent();

protected:
    UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Health")
    float MaxHealth = 100.0f;

    UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Health")
    float CurrentHealth;

    // Event dispatcher for Blueprint
    UPROPERTY(BlueprintAssignable, Category = "Health")
    FOnHealthChangedSignature OnHealthChanged;

public:
    // Callable from Blueprint
    UFUNCTION(BlueprintCallable, Category = "Health")
    void TakeDamage(float Damage);

    UFUNCTION(BlueprintCallable, Category = "Health")
    void Heal(float Amount);

    UFUNCTION(BlueprintPure, Category = "Health")
    float GetHealthPercent() const { return CurrentHealth / MaxHealth; }

    // Native event that can be overridden in Blueprint
    UFUNCTION(BlueprintNativeEvent, Category = "Health")
    void OnDeath();
    virtual void OnDeath_Implementation();
};

// Event delegate
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FOnHealthChangedSignature, float, Health, float, MaxHealth);

Actor Component System

// Custom Actor Component
UCLASS(ClassGroup=(Custom), meta=(BlueprintSpawnableComponent))
class MYGAME_API UInventoryComponent : public UActorComponent
{
    GENERATED_BODY()

public:
    UInventoryComponent();

protected:
    virtual void BeginPlay() override;

private:
    UPROPERTY(EditAnywhere, Category = "Inventory")
    int32 MaxSlots = 20;

    UPROPERTY()
    TArray<class UItemData*> Items;

public:
    UFUNCTION(BlueprintCallable, Category = "Inventory")
    bool AddItem(UItemData* Item);

    UFUNCTION(BlueprintCallable, Category = "Inventory")
    bool RemoveItem(UItemData* Item);

    UFUNCTION(BlueprintPure, Category = "Inventory")
    int32 GetItemCount() const { return Items.Num(); }
};

Timers and Async Operations

class AWeapon : public AActor
{
private:
    FTimerHandle FireRateTimer;

    UPROPERTY(EditAnywhere, Category = "Weapon")
    float FireRate = 0.2f; // Seconds between shots

public:
    void StartFiring()
    {
        Fire(); // Immediate first shot
        GetWorldTimerManager().SetTimer(FireRateTimer, this, &AWeapon::Fire, FireRate, true);
    }

    void StopFiring()
    {
        GetWorldTimerManager().ClearTimer(FireRateTimer);
    }

    void Fire()
    {
        // Spawn projectile
        FVector Location = GetActorLocation();
        FRotator Rotation = GetActorRotation();
        GetWorld()->SpawnActor<AProjectile>(ProjectileClass, Location, Rotation);
    }
};

Object Pooling in Unreal

UCLASS()
class APooledActor : public AActor
{
    GENERATED_BODY()

private:
    bool bIsActive = false;

public:
    void Activate()
    {
        bIsActive = true;
        SetActorHiddenInGame(false);
        SetActorEnableCollision(true);
        SetActorTickEnabled(true);
    }

    void Deactivate()
    {
        bIsActive = false;
        SetActorHiddenInGame(true);
        SetActorEnableCollision(false);
        SetActorTickEnabled(false);
    }

    bool IsActive() const { return bIsActive; }
};

UCLASS()
class AObjectPool : public AActor
{
    GENERATED_BODY()

private:
    UPROPERTY(EditAnywhere, Category = "Pool")
    TSubclassOf<APooledActor> PooledClass;

    UPROPERTY(EditAnywhere, Category = "Pool")
    int32 PoolSize = 50;

    UPROPERTY()
    TArray<APooledActor*> Pool;

protected:
    virtual void BeginPlay() override
    {
        Super::BeginPlay();

        // Pre-spawn pool
        for (int32 i = 0; i < PoolSize; i++)
        {
            APooledActor* Actor = GetWorld()->SpawnActor<APooledActor>(PooledClass);
            Actor->Deactivate();
            Pool.Add(Actor);
        }
    }

public:
    APooledActor* GetPooledActor()
    {
        for (APooledActor* Actor : Pool)
        {
            if (!Actor->IsActive())
            {
                Actor->Activate();
                return Actor;
            }
        }

        // Expand pool if needed
        APooledActor* NewActor = GetWorld()->SpawnActor<APooledActor>(PooledClass);
        Pool.Add(NewActor);
        NewActor->Activate();
        return NewActor;
    }

    void ReturnToPool(APooledActor* Actor)
    {
        Actor->Deactivate();
    }
};

Data Assets and Structures

// Data structure
USTRUCT(BlueprintType)
struct FWeaponStats
{
    GENERATED_BODY()

    UPROPERTY(EditAnywhere, BlueprintReadWrite)
    FName WeaponName;

    UPROPERTY(EditAnywhere, BlueprintReadWrite)
    float Damage = 10.0f;

    UPROPERTY(EditAnywhere, BlueprintReadWrite)
    float FireRate = 0.5f;

    UPROPERTY(EditAnywhere, BlueprintReadWrite)
    int32 MagazineSize = 30;
};

// Data asset
UCLASS()
class UWeaponDataAsset : public UDataAsset
{
    GENERATED_BODY()

public:
    UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Weapon")
    FWeaponStats Stats;

    UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Weapon")
    TSubclassOf<class AProjectile> ProjectileClass;

    UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Weapon")
    USoundBase* FireSound;
};

Smart Pointers

// Use TSharedPtr for shared ownership
TSharedPtr<FGameData> GameData = MakeShared<FGameData>();

// Use TWeakPtr to avoid circular references
TWeakPtr<AActor> WeakActorRef = SharedActorPtr;

// Use TUniquePtr for exclusive ownership
TUniquePtr<FComplexSystem> System = MakeUnique<FComplexSystem>();

Performance Best Practices

  • Use UPROPERTY() for garbage collection (don't use raw pointers for UObjects)
  • Cache component references in BeginPlay()
  • Use PrimaryActorTick.bCanEverTick = false if Tick not needed
  • Prefer Timers over Tick for periodic updates
  • Use BlueprintPure for getter functions (no execution pin)
  • Profile with Unreal Insights and stat commands (stat fps, stat unit, stat game)
  • Use forward declarations in headers, includes in .cpp files
  • Implement object pooling for frequently spawned actors

Source: SKILL.md on GitHub

1 alert16d5 checks · Risk CRITICAL
  • Gen Agent Trust Hub16d

    The skill provides reference documentation and code samples for Unity and Unreal Engine game development, covering patterns like ECS, object pooling, and multiplayer networking. No malicious patterns, prompt injections, or security vulnerabilities were found.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer6mo

    2/6 files flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at efebc44. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Steadyupdated 5 months ago
Other metadata
metadata
{
  "author": "https://github.com/Jeffallan",
  "version": "1.1.0",
  "domain": "specialized",
  "triggers": "Unity, Unreal Engine, game development, ECS architecture, game physics, multiplayer networking, game optimization, shader programming, game AI",
  "role": "specialist",
  "scope": "implementation",
  "output-format": "code",
  "related-skills": null
}
  • Performance
  • unity
  • unreal-engine
  • game-development
  • ecs
  • physics
  • multiplayer
  • networking
  • optimization
  • shader
  • game-ai

README badge

README badge for jeffallan/claude-skills/game-developer

Implements core game systems for Unity and Unreal Engine including ECS architecture, physics, multiplayer networking, and performance optimization targeting 60+ FPS. Provides patterns for object pooling, component caching, state machines, and shader development with validation checkpoints for profiling and cross-platform testing.

Generated from the current SKILL.md.

Does this skill support both Unity and Unreal Engine?
Yes. The skill includes reference guides for both Unity C# and Unreal C++/Blueprints, with platform-specific patterns and constraints for each engine.
What performance targets does this skill enforce?
The skill mandates 60+ FPS on all platforms with validation checkpoints using profilers (Unity Profiler or Unreal Insights) to confirm frame time stays at or below 16 ms.
Does this cover multiplayer networking?
Yes. The skill includes guidance on client-server architecture and lag compensation strategies via the multiplayer-networking reference guide.
What game architecture patterns does this skill teach?
The skill covers Entity Component System (ECS) architecture, state machines, object pooling, and component caching, with concrete code examples for each pattern.
Can I use this skill for mobile game optimization?
Yes. The skill explicitly addresses platform-specific constraints including mobile performance, memory usage, and battery considerations as part of the optimization workflow.

Generated from the current SKILL.md. These answers refresh after source changes.