Unreal

From j4flmao/agent-skills · View interactive version

Unreal is an AI agent skill from the GitHub repository j4flmao/agent-skills. Use when the user asks about Unreal Engine 5, UE5 C++, Blueprints, UObject and Actor lifecycle, Gameplay Ability System, Nanite, Lumen, Chaos physics or Unreal replication. Produces Unreal project architecture and C++/Blueprint guidance. Not for Unity (use unity) or custom engine rendering (use rend

How to use this skill

Skill file

Unreal Engine Deep Engineering Guide

Purpose

Unreal Engine is a C++ game engine with a powerful actor-component framework (UObject/AActor), Blueprint visual scripting, the Chaos physics system, and the modern rendering stack built on RenderGraph, Nanite virtualized geometry, and Lumen GI.

Agent Protocol

Trigger

"unreal", "unreal engine 5", "UE5", "blueprint", "UObject", "gameplay ability system", "nanite", "lumen", "unreal replication".

Input Context

Output Artifact

C++/Blueprint guidance, config or a profiling plan. No file unless requested.

Response Format

UE: {5.x}
Change: {what and why}
Code: {snippet}
Verify: {Unreal Insights / stat commands}

1. Engine Architecture

Unreal Engine 5
  Modules (UObject-based reflection)
    Core, Engine, Renderer, RHI (D3D12/Vulkan/Metal), Niagara, Chaos
  Engine loop -> UEngine::Tick -> UWorld::Tick -> Actor::Tick
  GWorld: The current UWorld (loaded levels)

1.1 The Game Framework

| Class | Role |

|-------|------|

| UGameInstance | Per-process, survives level loads, global save data |

| UWorld | The active level + subsystems (GameMode, GameState) |

| AGameModeBase | Rules: spawn points, teams, win condition (server-only) |

| AGameStateBase | Replicated match state |

| APlayerController | Input + view; replicated to owner |

| APawn/ACharacter | The controllable entity |

Rule: GameMode is server-only; never game logic from clients. Use GameState for replicated data.

2. UObject Reflection & C++ / Blueprint

2.1 Macros

UCLASS()
class MYGAME_API APlayerCharacter : public ACharacter {
    GENERATED_BODY()
public:
    UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Stats")
    int32 MaxHealth = 100;

    UFUNCTION(BlueprintCallable, Category="Stats")
    void Heal(int32 Amount);
};

2.2 C++ vs Blueprint Decision

| Concern | Choose |

|---------|--------|

| Data, core logic, perf-critical hot loops | C++ |

| Designer-facing flow, tuning, event wiring | Blueprint |

| Heavy algorithms (async, math-costly) | C++ + Async tasks |

| Prototypes and small features early | Blueprint then port to C++ |

Rule: Blueprint is for content, C++ is for code. Keep hot paths in native.

2.3 Compilation & Deployment

3. Rendering Pipeline (Modern UE5)

3.1 RenderGraph

UE5 renderer records a DAG of passes; the RenderGraph merges/splits passes, computes transient resources, and drives barriers automatically:

SceneColorInit -> BasePass (GBuffer) -> LightCulling -> DeferredShading
               -> Reflection capture -> Sky -> Translucency -> PostProcess -> Present

Resources are transient and lifetime-tracked by the Render Dependency Graph (RDG). Custom passes are added with FRDGBuilder::AddPass from a plugin, usually hooked in through a FSceneViewExtensionBase subclass (no engine fork needed).

3.2 Nanite

3.3 Lumen

3.4 Niagara Particles

4. Physics — Chaos

4.1 Tunneling & CCD

Fast small projectiles: enable CCD on the body (BodyInstance.bUseCCD = true), or skip physics bodies and sweep each tick with GetWorld()->SweepSingleByChannel (hitscan: LineTraceSingleByChannel).

4.2 Level Streaming

Open worlds use World Partition (grid cells streamed around streaming sources, data layers, HLODs). Classic sublevels stream with UGameplayStatics::LoadStreamLevel / UnloadStreamLevel or Level Streaming Volumes.

5. Animation

6. AI

7. Multiplayer / Netcode

7.1 Replication

7.2 Network Architecture

7.3 Replication Optimization

8. UI (UMG)

9. Asset Pipeline

10. Performance Rules (Lead Level)

  1. Profile first: stat unit, stat gpu, ProfileGPU, stat game, Unreal Insights.
  2. Minimize tick cost: disable tick on actors that don't need it; use timers for periodic logic.
  3. Avoid GetAllActorsOfClass in tick; maintain manager lists.
  4. Object pools for frequently spawned/destroyed actors.
  5. GC: minimize UObject allocation in hot paths; use native allocators for transient data.
  6. Shader complexity: check the Shader Complexity view mode and material stats; set per-platform instruction budgets with your art team and enforce them in review.
  7. LODs mandatory for foliage, large scenes.

10.1 Frame Budget Template

| System | Budget (ms) @ 60fps |

|--------|---------------------|

| Gameplay (Tick) | 2.0 |

| Physics (Chaos) | 2.0 |

| Animation | 2.0 |

| AI / NavMesh | 1.5 |

| Rendering (CPU) | 3.0 |

| Rendering (GPU) | 8.3-14.0 |

| UI | 1.0 |

| Netcode | 1.0 |

| Misc / Driver | 2.0 |

11. Anti-Patterns

| Anti-pattern | Consequence | Fix |

|--------------|-------------|-----|

| Blueprint Tick heavy logic | Slow, GC | Move to C++ |

| Actor with no tick disabled | CPU wasted | Set bCanEverTick=false |

| Massive Blueprint inheritance chains | Hard to maintain, slow | Composition over deep inheritance |

| Not setting NetUpdateFrequency | Bandwidth | Lower on background actors |

| Full scene replication every frame | Network spike | Dormancy + conditions |

| Relying on Nanite for skinned meshes | Experimental in recent 5.x only | Classic skeletal LODs unless you have validated it |

| Lumen on low-end GPU | Frame drops | Disable or use baked GI |

12. When to NOT Use Unreal

13. References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.