Chapter 10

Game Features & Modular Gameplay

Self-contained gameplay plugins you can flip on and off at runtime, and the broker that lets them reach into a game that has never heard of them.

In this chapter

  1. The Core Idea
  2. Lifecycle States
  3. Actions — The Payload
  4. The Injection Mechanism
  5. Caveats
1

The Core Idea

A Game Feature is a self-contained chunk of gameplay — content plus logic — packaged as its own plugin that you can flip on and off at runtime.

The key inversion. The core game is unaware the feature exists. The feature reaches into the game; the game never references the feature. Remove it and nothing dangles.

This is how Fortnite cycles huge volumes of content in and out.

What it physically is


2

Lifecycle States

StateMeaning
InstalledPresent on disk
RegisteredThe engine knows it exists
LoadedIts assets are in memory
ActiveIts Actions run and it affects gameplay

Flipping to Active triggers the feature's asset loading via Asset Bundles (Chapter 9); flipping back releases it.

So instead of hand-calling loads scattered through your code, you set the feature state and it orchestrates load and unload. That's the "automate the trigger points" answer to manual streaming.


3

Actions — The Payload

An empty feature does nothing. You add Actions to the GameFeatureData:

ActionWhat it does
Add ComponentsThe workhorse — injects Components onto existing Actor classes on an opt-in basis
Add CheatsDebug commands that exist only while the feature is active, never in shipping
Add Data RegistryPlugs feature data into global registries
Add World Partition ContentAttaches streamed world content

4

The Injection Mechanism

Adding a Component to an Actor the feature doesn't own works through a neutral broker: UGameFrameworkComponentManager.

Actors opt in by registering as receivers, usually in BeginPlay:

if (UGameFrameworkComponentManager* ComponentManager =
        GetGameInstance()->GetSubsystem<UGameFrameworkComponentManager>())
{
    ComponentManager->AddReceiver(this);
}

Features register their Components with the same broker, and it matches them up. Neither side holds a direct reference to the other — and that indirection is exactly what makes runtime on/off possible.


5

Caveats

The Modular Gameplay plugin is still Beta. Use caution shipping on it.

It's also under-documented. Lyra is the de facto reference implementation — Game Features, GAS and Modular Gameplay wired together — and is best learned by reading its source.

← Chapter 9 ↑ Index Chapter 11 →