ue-state-trees
БесплатноБез исполняемых скриптовНе проверенUse when writing or debugging State Tree logic in Unreal Engine C++ — tasks, conditions, evaluators, considerations, schemas, transitions, events or Mass…
от quodsoler★ 483 звезды на GitHubОб этом скилле
UE State Trees
Target engine: UE 5.8. APIs below are verified against the 5.8 headers; older forms are listed under "Deprecated — do not use".
State Tree is a data-driven hierarchical state machine authored as a UStateTree data asset and executed from C++ through an execution context. Runtime types live in the StateTreeModule (plugin StateTree); actor-facing components and schemas live in GameplayStateTreeModule (plugin GameplayStateTree). Mass-entity behaviours add MassAIBehavior (plugin MassAI, Experimental in 5.8) plus MassEntity, MassCore and MassSignals. Add the modules you use to PublicDependencyModuleNames in your .Build.cs.
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 |
|---|---|
| What the runtime looks like, instance data, contexts | Architecture, Execution Contexts |
| Writing a task | Tasks |
| Writing a condition or gating a transition | Conditions |
| Utility scoring, "pick the best child state" | Considerations |
| Feeding world data into the tree | Evaluators, External Data |
| When and how states change | Transitions, State Types and Selection |
| Tag-driven signals into the tree | Events |
| Reacting to a C++ callback instead of polling | Delegates |
| Restricting which nodes an asset may use | Schemas |
| Running a tree on an actor or AI controller | Component and AI Setup |
| Reducing tick cost / sleeping trees | Scheduled Tick |
| Thousands of entities | Mass Entity Integration |
| Finishing work from a callback or another thread | Async Completion |
Architecture
UStateTree (UDataAsset) IsReadyToRun() must be true before execution
├── UStateTreeSchema which nodes and context data are allowed
├── States hierarchy of States/Groups/Linked/Subtree
│ ├── Tasks work performed while the state is active
│ ├── EnterConditions gate on selecting the state
│ ├── Considerations utility score used by selection behaviours
│ └── Transitions rules for leaving the state
├── Evaluators global data providers, tick before transitions
└── Parameters FInstancedPropertyBag global parameters
Nodes are USTRUCTs, not UObjects, and every node virtual is const. Mutable per-instance state lives in a separate instance-data struct owned by FStateTreeInstanceData, which is what persists across frames. The execution context is a short-lived view constructed over that instance data.
| Type | Role |
|---|---|
UStateTree |
The compiled asset. IsReadyToRun() reports link success |
FStateTreeInstanceData |
Persistent runtime storage — hold this, not the context |
FStateTreeExecutionContext |
Full read/write context; construct per tick |
FStateTreeReference |
UStateTree* plus overridden global parameters |
EStateTreeRunStatus |
Running, Stopped, Succeeded, Failed, Unset |
// MyTreeRunner.h — persistent storage on the owner
UPROPERTY(Transient)
FStateTreeInstanceData InstanceData;
// .cpp — one context per tick over the same instance data
FStateTreeExecutionContext Context(*this, *StateTreeAsset, InstanceData);
Context.SetCollectExternalDataCallback(
FOnCollectStateTreeExternalData::CreateUObject(this, &UMyTreeRunner::CollectExternalData));
FStateTreeExecutionContext::FStartParameters StartParams;
StartParams.RandomSeed = 1234;
Context.Start(StartParams);
// later frames
Context.Tick(DeltaTime);
Tick can be split when transitions must be evaluated after other systems have run: call TickUpdateTasks(DeltaTime) first and TickTriggerTransitions() afterwards.
Execution Contexts
5.8 splits the context by capability. Pick the narrowest one that compiles.
| Context | Gets you | Typical use |
|---|---|---|
FStateTreeReadOnlyExecutionContext |
GetOwner, GetWorld, GetStateTree, HasEventToProcess, IsValid |
GetDebugInfo overrides, gameplay debugger |
FStateTreeMinimalExecutionContext |
adds SendEvent, ScheduleNextTick, scheduled-tick requests |
sending an event from outside the tick |
FStateTreeExecutionContext |
adds Start/Stop/Tick, instance data, external data, FinishTask, BindDelegate |
everything inside a node |
FStateTreeWeakExecutionContext |
weak handles captured for later | lambdas, latent actions, timers |
Установить ue-state-trees в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл ue-state-trees?
Use when writing or debugging State Tree logic in Unreal Engine C++ — tasks, conditions, evaluators, considerations, schemas, transitions, events or Mass behaviours. Also use when the user mentions 'StateTree', 'state tree', 'FStateTreeTaskBase', 'FStateTreeExecutionContext', 'GetInstanceDataType', 'FInstanceDataType', 'UStateTreeComponent', 'UStateTreeAIComponent', 'FStateTreeReference', 'SendStateTreeEvent', 'EStateTreeRunStatus', 'StateTree schema', 'utility selection', 'scheduled tick', 'FinishTask', or 'Mass StateTree'. For behaviour trees, perception and navigation, see ue-ai-navigation; for Mass processors and fragments, see ue-mass-entity; for USTRUCT basics, see ue-cpp-foundations.
Как установить скилл ue-state-trees?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл ue-state-trees запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic