Skip to content
Back to skills

Unreal Gameplay Framework

ASecurity

Unreal gameplay classes: GameMode, GameState, PlayerController, PlayerState, Pawn, Character, GameInstance, subsystems; where state lives, the spawn flow.

  • 5 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 3, 2026
ai-agentspythongoc++bashreact

Works with

  • cli

Security analysis

A100/100

Pro scans all 18 files and shows the line behind each finding

Scanned December 3, 2026

npx -y skills add tipoLi5890/game-studio --skill unreal-gameplay-framework --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Unreal Gameplay Framework?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Unreal Gameplay Framework
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tipoli5890-unreal-gameplay-framework/badge)](https://www.skillsdirectory.com/skills/tipoli5890-unreal-gameplay-framework)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: unreal-gameplay-framework
description: >-
  Unreal gameplay classes: GameMode, GameState, PlayerController, PlayerState, Pawn, Character,
  GameInstance, subsystems; where state lives, the spawn flow.
---

# unreal-gameplay-framework — which class owns what

The gameplay framework already has a home for every kind of state: rules on the server, shared state that replicates, per-player state, input, the body in the world, and what survives a level change.

Before adding a member, answer three questions about the class it goes on: on which machines does it exist, does it replicate, and how long does it live. A score on the pawn resets on respawn; a rule's result on the game mode never reaches a client; a value on the game instance is never seen by another player.

## Load what the situation needs

| The situation | Read |
|---|---|
| Starting the courier's class set | *The class set* below, `templates/` |
| "Where does this variable go?" | *Where state lives* below, `reference/framework-map.md` §2 |
| "Works for the host, not for clients", "resets after respawn", "gone after the next map" | `reference/framework-map.md` §3 |
| Which game mode runs, default classes, the join and spawn order, possession hooks | `reference/spawn-flow.md` |
| Moving to the next route: seamless or not, what survives | `reference/spawn-flow.md` §5 |
| Constructor, `OnConstruction`, `BeginPlay`, `EndPlay`: what runs when | `reference/actor-lifecycle.md` |
| A service with a managed lifetime (per world, per game instance, per local player) | `reference/subsystems.md`, `templates/RouteSubsystem.h` |
| Checking a project's classes for misplaced state | `scripts/framework_check.py` |
| Replicating a property, RPCs, ownership | `unreal-replication` |
| Input bindings on the character | `unreal-enhanced-input` |
| Abilities and attributes on the player state or the pawn | `unreal-gas` |

## The class set

| Class (template) | Base | Exists on | Replicates | Lives | Courier job |
|---|---|---|---|---|---|
| `ACourierRunGameMode` | `AGameModeBase` | server only | no | per level | default classes, `ParcelsPerRoute`, `RecordDelivery` |
| `ACourierRunGameState` | `AGameStateBase` | server and all clients | to all | per level | `ParcelsOnRoute` |
| `ACourierPlayerState` | `APlayerState` | server and all clients | to all | per player, outlives the pawn; copied on seamless travel | `ParcelsDelivered` |
| `ACourierPlayerController` | `APlayerController` | server and its own client | to the owner | per connection | local set-up in `BeginPlay` when `IsLocalController()` |
| `ACourierCharacter` | `ACharacter` | server and the clients it is relevant to | yes | per life | `MoveOnRoute`, `LookAround`, the possession hooks |
| `URouteSubsystem` | `UWorldSubsystem` | each machine | no | per world | the map's drop points |

The game mode wires them in its constructor:

```cpp
ACourierRunGameMode::ACourierRunGameMode()
{
	DefaultPawnClass = ACourierCharacter::StaticClass();
	PlayerControllerClass = ACourierPlayerController::StaticClass();
	PlayerStateClass = ACourierPlayerState::StaticClass();
	GameStateClass = ACourierRunGameState::StaticClass();
	bUseSeamlessTravel = true;
}
```

A Blueprint child of each class (`BP_CourierCharacter` with the mesh and the input config) is
where content is attached; point the game mode's slots at the Blueprints in its class defaults.
The game mode runs when the project's `GlobalDefaultGameMode`, a map's GameMode Override or the
`?game=` option names it (`reference/spawn-flow.md` §1).

Every replicated value is written on the server and flows outwards: a client's Server RPC on
something it owns asks, the game mode decides (`RecordDelivery`), and the game state and player
state carry the result to everyone. The templates' `SetParcelsOnRoute` and `AddDeliveries`
return early without authority and call the Blueprint reaction on the server themselves, because
a repnotify runs on clients only.

## Where state lives

| The state | Home |
|---|---|
| every machine sees it, about the match | game state |
| others see it, about one player, survives the pawn | player state |
| about the body, may reset on respawn | the pawn or a component on it |
| only the server may know or decide it | game mode |
| only this machine needs it (HUD, camera, menu input) | the local player controller or a local player subsystem |
| survives a map change on this machine | the game instance or a game instance subsystem |
| belongs to the loaded map, nobody else receives it | a world subsystem |

## Order that matters

- **A player joins** (server): `PreLogin` → `Login` → `PostLogin` (`OnPostLogin` last) →
  `HandleStartingNewPlayer` → `RestartPlayer` → `FindPlayerStart` / `ChoosePlayerStart` →
  `SpawnDefaultPawnFor` → `APawn::PossessedBy` (server or standalone only) →
  `SetupPlayerInputComponent`.
- **On the owning client** possession arrives by replication: `OnRep_Controller`,
  `NotifyControllerChanged` (also on the server), `AcknowledgePossession`, `PawnClientRestart`,
  and the player state through `OnRep_PlayerState`. Client-side work that needs the player state
  waits for `OnRep_PlayerState`; server-side work that needs the controller goes in `PossessedBy`.
- **An actor spawns**: constructor (defaults and subobjects only) → `OnConstruction` →
  `PostInitializeComponents` → `BeginPlay`; a map-placed actor goes `PostLoad` →
  `PostInitializeComponents` → `BeginPlay`. `EndPlay` runs on every way out.
- **A route changes**: `ServerTravel` with `bUseSeamlessTravel` keeps connections and controllers;
  the game state and pawns are new; a player state's members cross only through
  `SeamlessTravelTo` and `CopyProperties`. Across a non-seamless travel, data rides in the game
  instance.

## Misplacements by symptom (short list)

1. **A client reads zero from the game mode** (`GetAuthGameMode()` is null on clients): move the
   value to the game state or a player state.
2. **Score resets on respawn**: it is on the pawn; move it to the player state.
3. **Score gone after the next route**: no seamless travel, or no copy in `SeamlessTravelTo` /
   `CopyProperties`.
4. **Another player's controller is null on a client**: read their player state instead.
5. **A Server RPC on the game state never runs**: no client owns it; put the RPC on the controller,
   the pawn or one of their components.
6. **`GetPlayerState()` is null in a client's `BeginPlay`**: use `OnRep_PlayerState`.

The full table, with causes and fixes: `reference/framework-map.md` §3.

## Check it without the engine

```bash
python3 scripts/framework_check.py /path/to/CourierRun
python3 scripts/framework_check.py /path/to/CourierRun --strict   # warnings fail too
```

It maps each `UCLASS` to its framework role through the base chain and fails on replicated
properties or RPCs on a game mode, a game instance or a subsystem, and on a default-class slot
given a class of the wrong kind; it warns on a player state whose members nothing copies on
travel and on an `AGameMode` paired with a base game state. Blueprint classes are invisible to it,
and `0 framework classes` means nothing was judged. The replication declarations themselves are
checked by `unreal-replication`'s `rep_lint.py`.

## Related skills

- Replicated properties, RPCs, ownership and roles: `unreal-replication`
- Input on the character: `unreal-enhanced-input`
- The ability system on the player state or the pawn: `unreal-gas`
- Animation on the character's mesh: `unreal-animation`
- What C++ owns and what a Blueprint child tunes: `unreal-blueprint-boundary`
- Reflection specifiers and object lifetime: `unreal-cpp-reflection`

Files in this skill

  • SKILL.md7.5 KB
  • reference/actor-lifecycle.md4.4 KB
  • reference/framework-map.md6.7 KB
  • reference/spawn-flow.md6.2 KB
  • reference/subsystems.md3.5 KB
  • scripts/framework_check.py18.5 KB
  • templates/CourierCharacter.cpp1015 B
  • templates/CourierCharacter.h1.2 KB
  • templates/CourierPlayerController.cpp483 B
  • templates/CourierPlayerController.h743 B
  • templates/CourierPlayerState.cpp1 KB
  • templates/CourierPlayerState.h1.2 KB
  • templates/CourierRunGameMode.cpp1.3 KB
  • templates/CourierRunGameMode.h830 B
  • templates/CourierRunGameState.cpp616 B
  • templates/CourierRunGameState.h946 B
  • templates/RouteSubsystem.cpp572 B
  • templates/RouteSubsystem.h881 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.