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, UGameFeatureData | Plugin Layout and Descriptor |
| Activating or unloading a feature at runtime, plugin URLs, plugin states | Plugin States and the Subsystem |
| Writing an action that runs when a feature turns on or off | Writing a UGameFeatureAction |
| Picking a ready-made action instead of writing one | Engine-Provided Actions |
| Adding components to actors from a feature, extension events | Component Injection |
| Ordering initialization between components that load separately | Init State System |
| Choosing a base class for a Pawn/Controller/PlayerState/GameState component | Modular Component Bases |
| Filtering which plugins load, client/server data, state observers | Project Policies and Observers |
| Lyra-style experience composition (sample code, not engine API) | references/experience-system.md |
| Full templates: custom action, receiver setup, policies subclass | references/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 }
]
}
| Key | Meaning |
|---|---|
ExplicitlyLoaded | The plugin manager does not mount the plugin at startup; the feature's state machine mounts and unmounts it. Always true for a feature plugin. |
CanContainContent | Plugin ships a Content/ directory (needed for the UGameFeatureData asset). |
BuiltInInitialFeatureState | How far a built-in plugin advances at startup: "Installed", "Registered", "Loaded" or "Active". Unknown values log an error and fall back to Active. |
EnabledByDefault | Plugin is enabled without a .uproject entry. |
Modules[].Type | ModuleHostType name: Runtime, RuntimeNoCommandlet, Editor, Developer, Program, … |
Modules[].LoadingPhase | ModuleLoadingPhase 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