跳至正文
OpenAgentSkill
浏览已开放 · 目录记录日期 2026-11-21 · 自动更新和账户服务暂时关闭。
设计与 UI

ue-game-features

Use when building, activating or debugging Game Feature plugins and modular gameplay. Also use when the user mentions 'GameFeatureAction', 'UGameFeatureData', 'GameFeaturesSubsystem', 'LoadAndActivateGameFeaturePlugin', 'BuiltInInitialFeatureState', 'ExplicitlyLoaded', '.uplugin', 'GameFrameworkComponentManager', 'AddReceiver', 'AddComponentRequest', 'AddExtensionHandler', 'NAME_GameActorReady', 'init state', 'UPawnComponent', 'ModularGameplay', 'experience system' or 'Lyra-style modular architecture'. For plugin modules and Build.cs wiring, see ue-module-build-system; for component fundamentals, see ue-actor-component-architecture.

quodsoler · 已有静态检查记录

安装与使用

运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。

npx skills add quodsoler/unreal-engine-skills --skill ue-game-features

技能说明


name: ue-game-features description: "Use when building, activating or debugging Game Feature plugins and modular gameplay. Also use when the user mentions 'GameFeatureAction', 'UGameFeatureData', 'GameFeaturesSubsystem', 'LoadAndActivateGameFeaturePlugin', 'BuiltInInitialFeatureState', 'ExplicitlyLoaded', '.uplugin', 'GameFrameworkComponentManager', 'AddReceiver', 'AddComponentRequest', 'AddExtensionHandler', 'NAME_GameActorReady', 'init state', 'UPawnComponent', 'ModularGameplay', 'experience system' or 'Lyra-style modular architecture'. For plugin modules and Build.cs wiring, see ue-module-build-system; for component fundamentals, see ue-actor-component-architecture." metadata: version: "2.0.0" engine: "5.8"

UE Game Features and Modular Gameplay

Target engine: UE 5.8. APIs below are verified against the 5.8 headers; older forms are listed under "Deprecated — do not use".

Game Features (Beta in 5.8) packages gameplay as self-contained plugins under Plugins/GameFeatures/. UGameFeaturesSubsystem (a UEngineSubsystem) drives each plugin through a state machine; a UGameFeatureData primary data asset inside the plugin holds an instanced list of UGameFeatureAction objects that run at registration, load, activation and deactivation. Modular Gameplay (Beta in 5.8) supplies UGameFrameworkComponentManager (a UGameInstanceSubsystem) that injects components into opted-in actors, plus the UGameFrameworkComponent bases and the init-state system that orders initialization across independently loaded features. Build.cs modules: GameFeatures and ModularGameplay. The GameFeatures module already depends publicly on ModularGameplay and DataRegistry, so code that only consumes actions needs GameFeatures alone.

Context

Read .agents/ue-project-context.md if it exists (module names, conventions, enabled plugins, GAS/networking setup). Do not stop if it is missing.

Identify the area from the request and the codebase. Ask only when two plausible readings would produce different code.

Request is about…Go to
Creating a feature plugin, .uplugin keys, folder layout, UGameFeatureDataPlugin Layout and Descriptor
Activating or unloading a feature at runtime, plugin URLs, plugin statesPlugin States and the Subsystem
Writing an action that runs when a feature turns on or offWriting a UGameFeatureAction
Picking a ready-made action instead of writing oneEngine-Provided Actions
Adding components to actors from a feature, extension eventsComponent Injection
Ordering initialization between components that load separatelyInit State System
Choosing a base class for a Pawn/Controller/PlayerState/GameState componentModular Component Bases
Filtering which plugins load, client/server data, state observersProject Policies and Observers
Lyra-style experience composition (sample code, not engine API)references/experience-system.md
Full templates: custom action, receiver setup, policies subclassreferences/game-feature-patterns.md

Plugin Layout and Descriptor

A Game Feature plugin is an ordinary plugin that lives under <Project>/Plugins/GameFeatures/ or under <AdditionalPluginDirectory>/GameFeatures/. That location is what makes it a Game Feature plugin — UGameFeaturesSubsystemSettings::IsValidGameFeaturePlugin matches the descriptor path against those folders. There is no plugin-level "Type" key in the .uplugin schema.

Plugins/GameFeatures/
├── MyFeature/
│   ├── MyFeature.uplugin
│   ├── Content/MyFeature.uasset        (UGameFeatureData, named after the plugin)
│   └── Source/MyFeatureRuntime/
└── MyFeatureRules/
    ├── MyFeatureRules.uplugin
    └── Content/MyFeatureRules.uasset
{
	"FileVersion": 3,
	"Version": 1,
	"VersionName": "1.0",
	"FriendlyName": "My Feature",
	"Description": "Adds my gameplay feature",
	"Category": "Game Features",
	"CreatedBy": "",
	"CanContainContent": true,
	"ExplicitlyLoaded": true,
	"BuiltInInitialFeatureState": "Active",
	"Modules": [
		{ "Name": "MyFeatureRuntime", "Type": "Runtime", "LoadingPhase": "Default" }
	],
	"Plugins": [
		{ "Name": "GameFeatures", "Enabled": true },
		{ "Name": "ModularGameplay", "Enabled": true }
	]
}
KeyMeaning
ExplicitlyLoadedThe plugin manager does not mount the plugin at startup; the feature's state machine mounts and unmounts it. Always true for a feature plugin.
CanContainContentPlugin ships a Content/ directory (needed for the UGameFeatureData asset).
BuiltInInitialFeatureStateHow far a built-in plugin advances at startup: "Installed", "Registered", "Loaded" or "Active". Unknown values log an error and fall back to Active.
EnabledByDefaultPlugin is enabled without a .uproject entry.
Modules[].TypeModuleHostType name: Runtime, RuntimeNoCommandlet, Editor, Developer, Program, …
Modules[].LoadingPhaseModuleLoadingPhase name: Default, PreDefault, PostConfigInit, PostEngineInit, …

A content-only feature plugin omits Modules entirely. Adding a module means adding a Build.cs; see ue-module-build-system.

UGameFeatureData

UGameFeatureData : UPrimaryDataAsset is the asset the subsystem loads for the plugin. Its two authored properties are protected; read them through accessors:

const TArray<UGameFeatureAction*>& FeatureActions = FeatureData->GetActions();
const TArray<FPrimaryAssetTypeInfo>& ScanTypes = FeatureData->GetPrimaryAssetTypesToScan();

Actions is an Instanced array of UGameFeatureAction subclasses created inline in the asset. `Prima

阅读完整来源 ↗