Навык для работы с Game Feature плагинами, модульным геймплеем, GameFeatureAction и Lyra-подобной архитектурой.

Звёзды468
Форки74
Авторquodsoler
Обновлёнсен 28 2026

Установка

SKILL.md

UE Game Features and Modular Gameplay

You are an expert in Unreal Engine's Game Features plugin system and modular gameplay architecture.

Context Check

Read .agents/ue-project-context.md before proceeding. Determine:

  • Whether the GameFeatures and ModularGameplay plugins are enabled
  • Which actors register as component receivers (AddReceiver)
  • Whether the project uses an init state system or experience-based loading
  • Existing UGameFeatureAction subclasses or modular component base classes

Information Gathering

Ask the developer:

  1. Are you creating a new Game Feature plugin or extending an existing one?
  2. What components or abilities should the feature inject into gameplay actors?
  3. Does the feature need async loading or runtime activation/deactivation?
  4. Is there an experience/game mode composition system (Lyra-style)?
  5. Do components need ordered initialization across features?

Game Feature Plugin Structure

A Game Feature plugin is a standard UE plugin with Type set to "GameFeature" in its .uplugin descriptor. This tells the engine to manage its lifecycle through the Game Features subsystem rather than loading it as a regular plugin.

.uplugin Descriptor

{
    "Type": "GameFeature",
    "BuiltInInitialFeatureState": "Active",  // or "Registered", "Installed"
    "Plugins": [
        { "Name": "GameFeatures", "Enabled": true },
        { "Name": "ModularGameplay", "Enabled": true }
    ]
}

BuiltInInitialFeatureState controls how far the plugin advances on startup. Use "Active" for always-on features, "Registered" for features activated by gameplay code, or "Installed" for downloadable content loaded on demand.

UGameFeatureData

Each Game Feature plugin contains a UGameFeatureData primary data asset (extends UPrimaryDataAsset) that defines what the feature does:

// From GameFeatureData.h
UPROPERTY(EditDefaultsOnly, Instanced, Category = "Game Feature | Actions")
TArray<TObjectPtr<UGameFeatureAction>> Actions;

UPROPERTY(EditAnywhere, Category = "Game Feature | Asset Manager")
TArray<FPrimaryAssetTypeInfo> PrimaryAssetTypesToScan;

Actions is the core — an instanced array of UGameFeatureAction subclasses that execute when the feature activates.

Directory Convention

Plugins/GameFeatures/
├── ShooterCore/
│   ├── ShooterCore.uplugin          (Type: GameFeature)
│   ├── Content/
│   │   └── ShooterCore.uasset       (UGameFeatureData)
│   └── Source/ShooterCoreRuntime/
└── DeathmatchRules/
    ├── DeathmatchRules.uplugin
    └── Content/DeathmatchRules.uasset

Plugin State Machine

Game Feature plugins transition through a well-defined state machine. Actions fire at specific transitions and runtime activation must target valid destination states.

EGameFeaturePluginState Lifecycle

Uninitialized → Terminal → UnknownStatus → StatusKnown
    → Installed → Registered → Loaded → Active

Each major state has transition states between them (e.g., Registering, Loading, Activating). You target a destination state and the subsystem walks the chain.

Destination States

StateDescription
TerminalPlugin removed from tracking entirely
StatusKnownAvailability confirmed (exists on disk or bundle)
InstalledFiles on local storage, not yet registered
RegisteredAssets registered with Asset Manager, actions notified
LoadedAssets loaded into memory
ActiveActions fully activated, components injected

URL protocols: file: for built-in disk plugins, installbundle: for downloadable features. Convert descriptor path to URL with UGameFeaturesSubsystem::GetPluginURL_FileProtocol(Path).


UGameFeatureAction

UGameFeatureAction (UCLASS(MinimalAPI, DefaultToInstanced, EditInlineNew, Abstract)) is the base class for all actions. DefaultToInstanced + EditInlineNew allow instances to be created inline within UGameFeatureData's Actions array.

Lifecycle Methods

// Registration phase
virtual void OnGameFeatureRegistering();
virtual void OnGameFeatureUnregistering();

// Loading phase
virtual void OnGameFeatureLoading();
virtual void OnGameFeatureUnloading();

// Activation — primary override point
virtual void OnGameFeatureActivating(FGameFeatureActivatingContext& Context);
virtual void OnGameFeatureActivating();  // legacy no-arg fallback

// Post-activation confirmation
virtual void OnGameFeatureActivated();

// Deactivation — supports async via context
virtual void OnGameFeatureDeactivating(FGameFeatureDeactivatingContext& Context);

OnGameFeatureActivating(Context) is the primary override. The base calls the legacy no-arg version for backward compatibility.

Async Deactivation

When deactivation requires async work, pause it via the context:

void UMyAction::OnGameFeatureDeactivating(FGameFeatureDeactivatingContext& Context)
{
    FSimpleDelegate ResumeDelegate = Context.PauseDeactivationUntilComplete(
        TEXT("MyAction_AsyncCleanup"));
    // Start async work — MUST invoke ResumeDelegate when done or deactivation hangs
    AsyncTask(ENamedThreads::GameThread, [ResumeDelegate]()
    {
        // ... cleanup ...
        ResumeDelegate.ExecuteIfBound();
    });
}

See references/game-feature-patterns.md for complete custom action subclass templates.


Built-in Actions

UGameFeatureAction_AddComponents

UCLASS(MinimalAPI, meta=(DisplayName="Add Components"), final). The most commonly used action — injects components into actors via UGameFrameworkComponentManager.

Configuration uses FGameFeatureComponentEntry:

UPROPERTY(EditAnywhere) TSoftClassPtr<AActor> ActorClass;
UPROPERTY(EditAnywhere) TSoftClassPtr<UActorComponent> ComponentClass;
UPROPERTY(EditAnywhere) uint8 bClientComponent : 1;
UPROPERTY(EditAnywhere) uint8 bServerComponent : 1;

Internally stores TSharedPtr<FComponentRequestHandle> — RAII removes components when the handle drops (feature deactivates). Set both bClientComponent and bServerComponent for components needed everywhere, server-only for gameplay logic, client-only for cosmetic.

Other Built-in Actions

ActionPurpose
UGameFeatureAction_AddCheatsRegister cheat manager extensions
UGameFeatureAction_DataRegistryRegister data registry sources

UGameFeaturesSubsystem

UGameFeaturesSubsystem (UEngineSubsystem) manages all Game Feature plugin lifecycles:

UGameFeaturesSubsystem& GFS = UGameFeaturesSubsystem::Get();

Runtime Activation and Deactivation

FString PluginURL = UGameFeaturesSubsystem::GetPluginURL_FileProtocol(
    TEXT("/MyProject/Plugins/GameFeatures/MyFeature/MyFeature.uplugin"));

// Activate — callback receives const UE::GameFeatures::FResult&
GFS.LoadAndActivateGameFeaturePlugin(PluginURL,
    FGameFeaturePluginLoadComplete::CreateUObject(this, &UMyMgr::OnLoaded));

// Deactivate and unload
GFS.DeactivateGameFeaturePlugin(PluginURL);
GFS.UnloadGameFeaturePlugin(PluginURL, /*bKeepRegistered=*/ false);

// Or target a specific state:
GFS.ChangeGameFeatureTargetState(PluginURL, EGameFeatureTargetState::Registered,
    FGameFeaturePluginChangeStateComplete());

Query and Observe

bool bActive = GFS.IsGameFeaturePluginActive(PluginURL, /*bCheckForActivating=*/ false);
EGameFeaturePluginState State = GFS.GetPluginState(PluginURL);

// Global observer — implement IGameFeatureStateChangeObserver
GFS.AddObserver(MyObserver, UGameFeaturesSubsystem::EObserverPluginStateUpdateMode::CurrentAndFuture);
GFS.RemoveObserver(MyObserver);

IGameFeatureStateChangeObserver provides: OnGameFeatureRegistering(Data, PluginName, URL), OnGameFeatureActivating(Data, URL), OnGameFeatureDeactivating(Data, Context, URL).


Component Injection System

UGameFrameworkComponentManager (UGameInstanceSubsystem) is the runtime engine that injects components into actors. It is a Game Instance subsystem — not an engine subsystem:

UGameFrameworkComponentManager* CompMgr =
    GetGameInstance()->GetSubsystem<UGameFrameworkComponentManager>();

Actor Registration (Receivers)

Actors must register as receivers to accept injected components:

void AMyCharacter::BeginPlay()
{
    Super::BeginPlay();
    UGameFrameworkComponentManager::AddGameFrameworkComponentReceiver(this);
}
void AMyCharacter::EndPlay(const EEndPlayReason::Type EndPlayReason)
{
    UGameFrameworkComponentManager::RemoveGameFrameworkComponentReceiver(this);
    Super::EndPlay(EndPlayReason);
}

Component Requests (RAII)

TSharedPtr<FComponentRequestHandle> Handle = CompMgr->AddComponentRequest(
    TSoftClassPtr<AActor>(AMyCharacter::StaticClass()),
    UMyHealthComponent::StaticClass(),
    EGameFrameworkAddComponentFlags::AddUnique);
// Handle is RAII — destroying it removes the request and cleans up injected components
FlagValueBehavior
None0Default, allows duplicates
AddUnique1Skip if same class already exists
AddIfNotChild2Skip if a child class already exists
UseAutoGeneratedName4Auto-generated name instead of class name

Extension Handlers and Events

TSharedPtr<FComponentRequestHandle> ExtHandle = CompMgr->AddExtensionHandler(
    TSoftClassPtr<AActor>(AMyCharacter::StaticClass()),
    FExtensionHandlerDelegate::CreateUObject(this, &UMyAction::OnExtension));

void UMyAction::OnExtension(AActor* Actor, FName EventName)
{
    if (EventName == UGameFrameworkComponentManager::NAME_GameActorReady)
    { /* Actor fully initialized */ }
}

Standard event names: NAME_ReceiverAdded, NAME_ReceiverRemoved, NAME_ExtensionAdded, NAME_ExtensionRemoved, NAME_GameActorReady. Send custom events with CompMgr->SendExtensionEvent(Actor, FName("MyEvent")).


Init State System

The init state system solves ordered initialization across independently-loaded features. Without it, Component A might read from Component B before B exists — a common problem in modular architectures.

Registering Init States

Define project-wide init states as FGameplayTag values in a fixed order:

CompMgr->RegisterInitState(TAG_InitState_Spawning, false, FGameplayTag());
CompMgr->RegisterInitState(TAG_InitState_DataAvailable, false, TAG_InitState_Spawning);
CompMgr->RegisterInitState(TAG_InitState_DataInitialized, false, TAG_InitState_DataAvailable);
CompMgr->RegisterInitState(TAG_InitState_GameplayReady, false, TAG_InitState_DataInitialized);

Changing and Observing Init State

// Advance a feature's state
bool bChanged = CompMgr->ChangeFeatureInitState(
    MyActor, FName("MyComponent"), this, TAG_InitState_DataAvailable);

// Wait for another feature to reach a state
FDelegateHandle DH = CompMgr->RegisterAndCallForActorInitState(
    MyActor, FName("OtherComp"), TAG_InitState_DataInitialized,
    FActorInitStateChangedDelegate::CreateUObject(this, &UMyComp::OnOtherReady),
    /*bCallImmediately=*/ true);

// Check if all features reached a state
bool bAllReady = CompMgr->HaveAllFeaturesReachedInitState(
    MyActor, TAG_InitState_GameplayReady, /*ExcludingFeature=*/ NAME_None);

IGameFrameworkInitStateInterface

Implement on components for structured init state progression:

UCLASS()
class UMyModularComponent : public UPawnComponent,
    public IGameFrameworkInitStateInterface
{
    GENERATED_BODY()
public:
    virtual FName GetFeatureName() const override { return TEXT("MyFeature"); }
    virtual bool CanChangeInitState(UGameFrameworkComponentManager* Manager,
        FGameplayTag CurrentState, FGameplayTag DesiredState) const override;
    virtual void HandleChangeInitState(UGameFrameworkComponentManager* Manager,
        FGameplayTag CurrentState, FGameplayTag DesiredState) override;
    virtual void CheckDefaultInitialization() override;

    virtual void BeginPlay() override
    {
        Super::BeginPlay();
        RegisterInitStateFeature();
    }
    virtual void EndPlay(const EEndPlayReason::Type Reason) override
    {
        UnregisterInitStateFeature();
        Super::EndPlay(Reason);
    }
};

ContinueInitStateChain(TArray<FGameplayTag>{State1, State2, State3}) attempts to advance through a sequence of states. Use this in CheckDefaultInitialization to auto-advance as far as possible.


Modular Component Hierarchy

The ModularGameplay plugin provides typed base components for gameplay framework actors:

Base ClassParentTyped Accessor
UGameFrameworkComponentUActorComponentNone (generic base)
UPawnComponentUGameFrameworkComponentGetPawn<T>(), GetPawnChecked<T>()
UControllerComponentUGameFrameworkComponentGetController<T>(), GetControllerChecked<T>()
UGameStateComponentUGameFrameworkComponentGetGameState<T>(), GetGameStateChecked<T>()
UPlayerStateComponentUGameFrameworkComponentGetPlayerState<T>(), GetPlayerStateChecked<T>()

Use these instead of raw UActorComponent for type-safe owner access and init state integration.


Experience System Pattern

The experience system (pioneered by Lyra) composes game modes from Game Feature plugins at runtime. Instead of a monolithic GameMode, lightweight experience data assets list which features to activate.

Core Flow

GameMode::InitGame()
  → Load UExperienceDefinition (from map or URL options)
    → For each feature: LoadAndActivateGameFeaturePlugin()
    → All loaded → OnExperienceLoaded broadcast
      → Components initialize, gameplay begins

A UExperienceManagerComponent on AGameStateBase orchestrates loading. Systems bind to its OnExperienceLoaded delegate rather than assuming features are available at BeginPlay.

See references/experience-system.md for the full pattern with code templates.


Project Policies

UGameFeaturesProjectPolicies controls feature loading behavior. Override IsPluginAllowed(PluginURL, OutReason) to filter plugins, GetGameFeatureLoadingMode(bLoadClientData, bLoadServerData) for network filtering, and InitGameFeatureManager()/ShutdownGameFeatureManager() for custom lifecycle. Register via DefaultGame.ini under GameFeaturesSubsystemSettings.

See references/game-feature-patterns.md for the full policies subclass template.


Common Mistakes

Missing receiver registration:

// WRONG — components never injected, no error logged
void AMyCharacter::BeginPlay() { Super::BeginPlay(); }
// RIGHT
void AMyCharacter::BeginPlay()
{
    Super::BeginPlay();
    UGameFrameworkComponentManager::AddGameFrameworkComponentReceiver(this);
}

Leaking FComponentRequestHandle:

// WRONG — handle destroyed immediately, component removed next frame
CompMgr->AddComponentRequest(ActorClass, CompClass, Flags);
// RIGHT — store for lifetime of injection
RequestHandle = CompMgr->AddComponentRequest(ActorClass, CompClass, Flags);

Using BeginPlay for cross-component init:

// WRONG — modular components may not exist yet
void UMyComp::BeginPlay() { GetOwner()->FindComponentByClass<UOther>()->Configure(); }
// RIGHT — use init state system to wait for dependencies
void UMyComp::HandleChangeInitState(/*...*/, FGameplayTag DesiredState)
{
    if (DesiredState == TAG_InitState_DataInitialized)
        GetOwner()->FindComponentByClass<UOther>()->Configure();
}

Forgetting PauseDeactivationUntilComplete delegate: If you call PauseDeactivationUntilComplete but never invoke the returned delegate, plugin deactivation hangs indefinitely. Always invoke it, even on error paths.

Wrong subsystem type for ComponentManager:

// WRONG — NOT an engine subsystem
GEngine->GetEngineSubsystem<UGameFrameworkComponentManager>();
// RIGHT — UGameInstanceSubsystem
GetGameInstance()->GetSubsystem<UGameFrameworkComponentManager>();

Related Skills

  • ue-gameplay-framework — GameMode, GameState, PlayerController, PlayerState lifecycle
  • ue-actor-component-architecture — Component creation, attachment, tick management
  • ue-gameplay-abilities — GAS integration with modular components
  • ue-data-assets-tables — Primary data assets, Asset Manager scanning
  • ue-module-build-system — Plugin structure, Build.cs dependencies
  • ue-world-level-streaming — Level streaming, seamless travel interactions

Вставить в README

Ссылка на карточку для вашего README — без картинок и счётчиков.

[DarkPlay: ue-game-features](https://darkplay.ru/ai/skills/quodsoler-unreal-engine-skills-ue-game-features)

Похожие скиллы и другие разделы каталога

Популярное в разделе «Скиллы»

Самые востребованные скиллов раздела по установкам и звёздам.

find-skillsvercel-labs · Помогает находить и устанавливать навыки агентов по запросам вроде «как сделать X»…
4 400 000 устан.
grill-memattpocock · Настойчивое интервью для доработки плана или дизайна.
1 600 000 устан.
hyperframesheygen-com · Обязательная точка входа для любых задач по видео, анимации и motion-графике в…
1 600 000 устан.
hyperframes-cliheygen-com · Цикл разработки HyperFrames CLI: init, add, render, preview, publish и другие команды.
1 600 000 устан.
agent-browservercel-labs · CLI для автоматизации браузера для ИИ-агентов: навигация по страницам, заполнение форм…
1 600 000 устан.
media-useheygen-com · Agent Media OS: единый навык для медиа в HyperFrames — BGM, SFX, изображения, голос, LUT.
1 500 000 устан.
hyperframes-registryheygen-com · Установка и подключение блоков реестра в композиции HyperFrames через add и catalog.
1 400 000 устан.
grill-with-docsmattpocock · Настойчивое интервью для доработки плана или дизайна, попутно создающее документацию (ADR…
1 300 000 устан.
improve-codebase-architecturemattpocock · Поиск в кодовой базе возможностей для углубления, визуальный HTML-отчёт о них и детальный…
1 300 000 устан.
tddmattpocock · Разработка через тестирование (TDD): red-green-refactor и интеграционные тесты.
1 300 000 устан.
Похожее в других разделах каталога

Соседние разделы каталога: возможно, нужный инструмент живёт там.

Architectaffaan-m · Специалист по архитектуре ПО для проектирования систем, масштабируемости и принятия…
225 587 ★
Code Exploreraffaan-m · Глубоко анализирует существующие функции кодовой базы, прослеживая пути выполнения…
225 587 ★
Gan Generatoraffaan-m · GAN Harness — агент-генератор: реализует функции по спецификации и итерирует по отзывам.
225 587 ★
Gan Planneraffaan-m · GAN Harness — агент-планировщик: разворачивает промпт в полную спецификацию продукта.
225 587 ★
Planneraffaan-m · Специалист по планированию сложных функций, архитектурных изменений и рефакторинга.
225 587 ★
Tdd Guideaffaan-m · Специалист по TDD: сначала тесты, покрытие 80%+.
225 587 ★
ruflo-arenaruvnet · Конкурентная рулиология для роёв ruflo: арены, турниры и адаптивная коэволюция…
240 комп.
Constitutional Validatorshanraisshan · Проверяет пункты роадмапа, функции и технические решения на соответствие конституции…
61 912 ★
agentic-bundle-indie-game-devsickn33 · Установите набор редакционных навыков «Indie Game Dev» для Claude Code.
49 917 ★
amazon-location-serviceanthropics · Помогает разработчикам добавлять карты, поиск мест, геокодирование, маршрутизацию и…
100 комп.

Лучшие ИИ-инструменты для программирования

ИИ для программирования

Подборка нейросетей и ИИ-ассистентов для разработки и автоматизации кода. Сервисы, которые ускоряют написание, ревью и отладку, экономят часы рутины и снижают порог входа в сложные

GenAPIGenapi
По запросу
5.0
Notepad++ AINotepad-plus-plus
По запросу
4.9
GitHub CopilotGitHub
По подписке
4.9
Creatium MaxCremax
По запросу
4.8
Emacs AIGnu
По запросу
4.8
KiteKite
По запросу
4.8
Amazon Q DeveloperAmazon
По запросу
4.8
VECTA
Есть бесплатный тариф
4.8
SoftPractice
Есть бесплатный тариф
4.8
VibeForge
Есть бесплатный тариф
4.7

Лучшие ИИ-инструменты для генерации видео

Генерация видео

Подборка нейросетей для генерации и монтажа видео. Инструменты, которые превращают текст в готовые ролики, экономят часы на съемках и постпродакшне. Подходит для SMM-специалистов,

VEED.IOVeed
По запросу
5.0
MootionMootion
По запросу
5.0
FlyviFlyvi
Есть бесплатный тариф
4.9
Google Veo 3.1Google
Платно
4.9
Sora (OpenAI)OpenAI
Платно
4.9
PikaPika
Платно
4.9
captions space
Есть бесплатный тариф
4.8
Клайп
Есть бесплатный тариф
4.8
viralpulse.appViralpulse
По запросу
4.8
Viral Maker AIViral-maker
Есть бесплатный тариф
4.8

Лучшие ИИ-инструменты для генерации текста и копирайтинга

Генерация текста и копирайтинг

Подборка нейросетей для генерации текстов и копирайтинга. Сервисы, которые помогают создавать статьи, посты и рекламные объявления с нуля или по черновику, экономя часы рутинной ра

NeuroscribeNeuroscribe
Есть бесплатный тариф
5.0
GoGPTGogpt
По запросу
5.0
ChatsonicChatsonic
По запросу
4.9
НейроТекстерNeuro-texter
По запросу
4.9
ChatGPTOpenAI
По подписке
4.9
Редактум
Есть бесплатный тариф
4.8
ChadGPTChadgpt
По запросу
4.8
Cosmo ScribeCosmoscribe
Есть бесплатный тариф
4.8
Memo HelperCopilot33
По запросу
4.8
LibraChatLibrachat
Есть бесплатный тариф
4.8