Token导航 LogoToken导航

Agent Skill · 前端设计

ue-mass-entity(质量实体)

ue-mass-entity 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

ue-mass-entity 是前端设计类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为只读;许可证信息还不明确,第三方扫描已通过,按安装量在前端设计类的 10,216 个 Skill 里排第 2,925。

总安装 1,745周安装 72GitHub Stars 125下载 570核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:ue-mass-entity(质量实体)
来源仓库:https://github.com/quodsoler/unreal-engine-skills
仓库路径:skills/ue-mass-entity
安装命令:
npx skills add https://github.com/quodsoler/unreal-engine-skills --skill ue-mass-entity
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/quodsoler/unreal-engine-skills --skill ue-mass-entity

这个 Skill 是做什么的

前端设计类 Skill 关注页面结构、视觉规范和组件写法,输出通常是可运行的界面代码。

ue-mass-entity 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。适合在 Codex、Claude、Cursor、Gemini CLI 中围绕仓库状态、代码变更或协作事项进行整理。

通过 npx skills add 命令从指定仓库安装,需结合原始 README 核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。当前无原始 SKILL.md 内容可参考,功能以实际实现为准。

来源仓库内路径:skills/ue-mass-entity

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/quodsoler/unreal-engine-skills --skill ue-mass…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它标注为只读,先用只读任务试一次,确认行为符合预期再扩大使用范围。

常见问题

6 条

ue-mass-entity 怎么安装?

在终端执行 npx skills add https://github.com/quodsoler/unreal-engine-skills --skill ue-mass-entity。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

ue-mass-entity 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

ue-mass-entity 需要什么权限?

权限级别是只读。该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

ue-mass-entity 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

ue-mass-entity 用的人多吗?

公开数据是累计安装 1,745 次,近一周安装 72 次,下载 570 次,GitHub 125 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

ue-mass-entity 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。
  • 标注为只读权限,试用阶段不容易误改本地文件。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理前端设计类任务、又不想每次都手写提示词的人。
  • 只想先试试效果、不希望它改动本地文件的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

前端设计类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
frontend-design

前端设计 · Codex、Claude

8,823,360126,072只读MIT通过
vercel-composition-patterns

Vercel 组合模式 · Codex、Claude

3,858,81625,893需要联网MIT通过
vercel-react-native-skills

Vercel React native skills 前端 · Codex、Claude

2,468,66425,878只读MIT通过
adapt

adapt 搜索 · Codex、Claude

2,027,04023,125操作浏览器未明确通过
bolder

bolder 分析 · Codex、Claude

2,004,28823,130只读未明确通过
ue-mass-entity

质量实体 · 本页

1,745125只读未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

UE Mass Entity Framework

You are an expert in Unreal Engine's Mass Entity framework -- an archetype-based Entity Component System (ECS) designed for high-performance simulation of thousands of entities using cache-friendly data layouts and parallel processing.

Context Check

Before proceeding, read .agents/ue-project-context.md to determine:

  • Whether the MassEntity plugin is enabled (and MassAI, MassCrowd, MassGameplay if needed)
  • The target entity count and performance budget
  • Whether MassCrowd lane navigation or ZoneGraph is in use
  • Existing processors, fragments, traits, and entity config assets

Information Gathering

Ask the developer:

  1. What kind of entities are being simulated? (crowds, projectiles, traffic, wildlife, custom)
  2. What data does each entity carry? (position, velocity, health, custom state)
  3. Are entities visualized? If so, what LOD strategy? (ISM, skeletal, actor promotion)
  4. Is this multiplayer? If so, which entities replicate?
  5. How many entities at peak? (hundreds vs. tens of thousands)

ECS Concepts

Mass Entity uses an archetype ECS model where entity composition determines memory layout:

ConceptClass BasePurpose
EntityFMassEntityHandle8-byte identity handle (Index + SerialNumber)
FragmentFMassFragmentPer-entity mutable data (position, velocity, health)
TagFMassTagZero-size boolean marker for filtering
Shared FragmentFMassSharedFragmentPer-archetype mutable data
Const Shared FragmentFMassConstSharedFragmentPer-archetype immutable data (mesh params)
Chunk FragmentFMassChunkFragmentPer-memory-chunk data (custom chunk-level state)
ArchetypeFMassArchetypeHandleUnique combination of fragment/tag types

Why archetypes matter: Entities with identical fragment/tag composition share the same archetype. All fragments of the same type within a chunk are stored contiguously, enabling cache-friendly iteration over thousands of entities per frame.


Fragment and Tag Definitions

All types require USTRUCT() with GENERATED_BODY():

// Per-entity mutable data
USTRUCT()
struct FHealthFragment : public FMassFragment
{
    GENERATED_BODY()
    float Current = 100.f;
    float Max = 100.f;
};

// Zero-size marker — no data members
USTRUCT()
struct FDeadTag : public FMassTag
{
    GENERATED_BODY()
};

// Shared across all entities in an archetype (mutable)
USTRUCT()
struct FTeamSharedFragment : public FMassSharedFragment
{
    GENERATED_BODY()
    int32 TeamID = 0;
};

Chunk fragments (FMassChunkFragment) store per-memory-chunk state shared across all entities in a chunk. Note: FMassRepresentationLODFragment inherits from FMassFragment (per-entity), not FMassChunkFragment. Const shared fragments (FMassConstSharedFragment) are immutable after archetype creation -- use for configuration data like FMassRepresentationParameters. See references/mass-fragment-reference.md for built-in types.


FMassEntityManager

The entity manager is NOT a UObject -- it is a struct (TSharedFromThis<FMassEntityManager>, FGCObject). Access it through UMassEntitySubsystem (a UWorldSubsystem):

UMassEntitySubsystem* MassSubsystem = GetWorld()->GetSubsystem<UMassEntitySubsystem>();
FMassEntityManager& EntityManager = MassSubsystem->GetMutableEntityManager();
// const ref: MassSubsystem->GetEntityManager()

Entity Lifecycle

// One-shot creation
FMassEntityHandle Entity = EntityManager.CreateEntity(ArchetypeHandle);

// With shared fragments
FMassArchetypeSharedFragmentValues SharedValues;
FMassEntityHandle Entity = EntityManager.CreateEntity(ArchetypeHandle, SharedValues);

// Two-phase (reserve then build)
FMassEntityHandle Handle = EntityManager.ReserveEntity();
EntityManager.BuildEntity(Handle, ArchetypeHandle);

// Batch creation (thousands at once)
// BatchCreateEntities returns TSharedRef<FEntityCreationContext> — retain it until
// observer processors should fire (dropping it early suppresses observer execution).
TArray<FMassEntityHandle> Entities;
TSharedRef<FEntityCreationContext> CreationContext =
    EntityManager.BatchCreateEntities(ArchetypeHandle, 5000, Entities);

// Destruction
EntityManager.DestroyEntity(Handle);
EntityManager.BatchDestroyEntities(EntityArray);

Validity Checks

FMassEntityHandle::IsSet() (aliased as IsValid()) only checks non-zero Index/SerialNumber -- it does NOT verify the entity exists. Always use the entity manager:

EntityManager.IsEntityValid(Handle)   // entity exists
EntityManager.IsEntityBuilt(Handle)   // fully constructed
EntityManager.IsEntityActive(Handle)  // active in simulation

Direct Fragment/Tag Mutations (Outside Processors)

EntityManager.AddFragmentToEntity(Handle, FHealthFragment::StaticStruct());
EntityManager.RemoveFragmentFromEntity(Handle, FHealthFragment::StaticStruct());
EntityManager.AddTagToEntity(Handle, FDeadTag::StaticStruct());
EntityManager.RemoveTagFromEntity(Handle, FDeadTag::StaticStruct());
EntityManager.SwapTagsForEntity(Handle, FOldTag::StaticStruct(), FNewTag::StaticStruct());

UMassProcessor

Processors iterate over entities matching a query each frame. Subclass UMassProcessor (abstract), override ConfigureQueries() and Execute():

UCLASS()
class UMyMovementProcessor : public UMassProcessor
{
    GENERATED_BODY()
public:
    UMyMovementProcessor();
protected:
    virtual void ConfigureQueries(const TSharedRef<FMassEntityManager>& EntityManager) override;
    virtual void Execute(FMassEntityManager& EntityManager,
                         FMassExecutionContext& Context) override;
private:
    FMassEntityQuery MovementQuery;
};

Constructor Configuration

UMyMovementProcessor::UMyMovementProcessor()
{
    ProcessingPhase = EMassProcessingPhase::PrePhysics;
    ExecutionFlags = static_cast<int32>(
        EProcessorExecutionFlags::Server |
        EProcessorExecutionFlags::Standalone);
    ExecutionOrder.ExecuteInGroup = UE::Mass::ProcessorGroupNames::Movement;
    ExecutionOrder.ExecuteAfter.Add(TEXT("UMassApplyVelocityProcessor"));
    bRequiresGameThreadExecution = false; // true if accessing UObjects
}

EMassProcessingPhase: PrePhysics, StartPhysics, DuringPhysics, EndPhysics, PostPhysics, FrameEnd

EProcessorExecutionFlags: None(0), Standalone(1), Server(2), Client(4), Editor(8), AllNetModes(7 = Standalone|Server|Client)

Execution ordering: ExecutionOrder.ExecuteInGroup, ExecuteAfter, ExecuteBefore control processor scheduling relative to named groups and other processors.


FMassEntityQuery

Queries define which entities a processor operates on. Configure in ConfigureQueries(), then call RegisterQuery():

void UMyMovementProcessor::ConfigureQueries(const TSharedRef<FMassEntityManager>& EntityManager)
{
    MovementQuery.AddRequirement<FTransformFragment>(
        EMassFragmentAccess::ReadWrite, EMassFragmentPresence::All);
    MovementQuery.AddRequirement<FMassVelocityFragment>(
        EMassFragmentAccess::ReadOnly, EMassFragmentPresence::All);
    MovementQuery.AddRequirement<FHealthFragment>(
        EMassFragmentAccess::ReadOnly, EMassFragmentPresence::Optional);
    MovementQuery.AddTagRequirement<FDeadTag>(EMassFragmentPresence::None);
    MovementQuery.AddSharedRequirement<FTeamSharedFragment>(
        EMassFragmentAccess::ReadOnly, EMassFragmentPresence::All);
    MovementQuery.AddConstSharedRequirement<FMassRepresentationParameters>(
        EMassFragmentPresence::All);
    MovementQuery.AddRequirement<FMassRepresentationLODFragment>(
        EMassFragmentAccess::ReadWrite, EMassFragmentPresence::Optional);
    MovementQuery.AddSubsystemRequirement<UMassRepresentationSubsystem>(
        EMassFragmentAccess::ReadWrite);
    RegisterQuery(MovementQuery);
}
EMassFragmentAccessUsage
NoneNo access (filter only)
ReadOnlyGetFragmentView<T>() -- TConstArrayView
ReadWriteGetMutableFragmentView<T>() -- TArrayView
EMassFragmentPresenceMeaning
AllEntity must have this fragment
AnyAt least one Any-marked fragment must exist
NoneEntity must NOT have this fragment
OptionalAccess if present, skip if absent

Fragment-Based Chunk Filtering

// FMassRepresentationLODFragment is a per-entity fragment, not a chunk fragment.
// Filter using a regular fragment view within the iteration lambda.
MovementQuery.SetChunkFilter([](const FMassExecutionContext& Context) -> bool {
    // Chunk filters operate on chunk-level data; use per-entity access inside ForEachEntityChunk.
    return true;
});

FMassExecutionContext and Iteration

Inside ForEachEntityChunk, the context provides typed views into chunk data:

void UMyMovementProcessor::Execute(FMassEntityManager& EntityManager,
                                   FMassExecutionContext& Context)
{
    MovementQuery.ForEachEntityChunk(Context,
        [this](FMassExecutionContext& Context)
    {
        const int32 NumEntities = Context.GetNumEntities();
        TArrayView<FTransformFragment> Transforms =
            Context.GetMutableFragmentView<FTransformFragment>();
        TConstArrayView<FMassVelocityFragment> Velocities =
            Context.GetFragmentView<FMassVelocityFragment>();
        TConstArrayView<FMassEntityHandle> Entities = Context.GetEntities();
        const float DeltaTime = Context.GetDeltaTimeSeconds();

        for (int32 i = 0; i < NumEntities; ++i)
        {
            Transforms[i].GetMutableTransform().AddToTranslation(
                Velocities[i].Value * DeltaTime);
        }
    });
}

Parallel execution: MovementQuery.ParallelForEachEntityChunk(Context, Lambda) for thread-safe processors.

Subsystem access: Context.GetMutableSubsystem<T>() / Context.GetSubsystem<T>() for subsystems declared via AddSubsystemRequirement.

Shared/chunk access: Context.GetMutableSharedFragment<T>(), Context.GetConstSharedFragment<T>(), Context.GetChunkFragment<T>().


FMassCommandBuffer (Deferred Mutations)

CRITICAL: Inside ForEachEntityChunk, never call entity manager mutations directly. Structural changes during iteration invalidate archetype memory layouts, causing undefined behavior. Use Context.Defer():

MovementQuery.ForEachEntityChunk(Context,
    [](FMassExecutionContext& Context)
{
    auto Transforms = Context.GetMutableFragmentView<FTransformFragment>();
    auto Entities = Context.GetEntities();
    for (int32 i = 0; i < Context.GetNumEntities(); ++i)
    {
        if (Transforms[i].GetTransform().GetLocation().Z < -1000.f)
        {
            Context.Defer().AddTag<FDeadTag>(Entities[i]);
            Context.Defer().RemoveFragment<FHealthFragment>(Entities[i]);
        }
    }
});

Deferred command execution order: Create -> Add -> Remove -> ChangeComposition -> Set -> Destroy. This guarantees fragments exist before being written, and entities exist before being modified.

PushCommand<T>(Command) pushes a typed deferred command. Note: PushCommand does NOT accept a lambda. For custom deferred logic, use PushUniqueCommand(TUniquePtr<FMassBatchedCommand>&&) with a subclass of FMassBatchedCommand. See references/mass-entity-patterns.md for patterns.


UMassObserverProcessor

Observers react to structural changes -- when a fragment or tag is added to or removed from an entity. They fire automatically:

UCLASS()
class UHealthAddedObserver : public UMassObserverProcessor
{
    GENERATED_BODY()
public:
    UHealthAddedObserver()
    {
        ObservedType = FHealthFragment::StaticStruct();
        ObservedOperations = EMassObservedOperationFlags::AddElement;
    }
protected:
    virtual void ConfigureQueries(const TSharedRef<FMassEntityManager>& EntityManager) override;
    virtual void Execute(FMassEntityManager& EntityManager,
                         FMassExecutionContext& Context) override;
};

The observer Execute runs only for entities that just had the observed type added/removed. Use observers for initialization, cleanup, and state-change responses instead of per-frame polling.


FMassEntityView

For single-entity access outside processor iteration, use FMassEntityView. It is transient -- never store across frames because archetype memory can relocate:

if (EntityManager.IsEntityValid(Handle))
{
    FMassEntityView View(EntityManager, Handle);
    if (View.GetFragmentDataPtr<FHealthFragment>() != nullptr)
    {
        FHealthFragment& Health = View.GetFragmentData<FHealthFragment>();
        Health.Current -= Damage;
    }
    bool bDead = View.HasTag<FDeadTag>();
}

Mass Spawner and Config Assets

UMassEntityConfigAsset defines entity templates via traits. Add traits like UMassAssortedFragmentsTrait (custom fragments), UMassVisualizationTrait (ISM visualization), or UMassReplicationTrait (networking).

Custom traits subclass UMassEntityTraitBase and override BuildTemplate(FMassEntityTemplateBuildContext&, const UWorld&) to add fragments and configure archetypes. ValidateTemplate() provides editor-time validation.

AMassSpawner is a world actor that references entity config assets and controls spawn count, timing, and spatial distribution. See references/mass-entity-patterns.md for trait implementation templates.


Common Fragments

FragmentTypePurpose
FTransformFragmentFragmentEntity world transform
FMassVelocityFragmentFragmentLinear velocity
FMassForceFragmentFragmentApplied force
FAgentRadiusFragmentFragmentAgent collision radius
FMassMoveTargetFragmentFragmentNavigation move target
FMassRepresentationFragmentFragmentCurrent visual representation state
FMassRepresentationLODFragmentFragmentPer-entity LOD level and visibility state
FMassRepresentationParametersConst SharedRepresentation type per LOD, update rate config
FMassMovementParametersConst SharedMax speed, acceleration

See references/mass-fragment-reference.md for complete field details and trait types.


Representation (ISM Visualization)

Mass Entity uses Instanced Static Meshes for rendering thousands of entities without per-entity actors:

EMassRepresentationTypeUsage
StaticMeshInstanceISM for mid/far entities
HighResSpawnedActorFull actor for close-up (high LOD)
LowResSpawnedActorReduced actor for medium LOD
NoneNo visual representation
EMassLODDetail Level
HighFull detail, actor-based
MediumReduced detail
LowMinimal (ISM only)
OffNot rendered

UMassRepresentationSubsystem manages ISM instances. Use UMassVisualizationTrait on entity configs to set meshes and LOD distances. Force game-thread for representation processors: TMassSharedFragmentTraits<T>::GameThreadOnly = true.


MassCrowd

UMassCrowdSubsystem provides lane-based navigation using ZoneGraph for pedestrian crowd simulation. Located in Engine/Plugins/AI/MassCrowd/ (not Runtime).

Key features: lane state management, waiting slot allocation, density tracking, and avoidance. Thread-safe for parallel processors: TMassExternalSubsystemTraits<UMassCrowdSubsystem>::GameThreadOnly = false.

Entities use FMassMoveTargetFragment for lane-following targets. ZoneGraph defines navigation lanes as connected graphs with automatic density management.


StateTree Integration

Mass Entity processors can trigger State Tree evaluations for entity AI. State Trees provide hierarchical decision-making for Mass entities as an alternative to per-entity behavior trees (prohibitively expensive at scale). For State Tree architecture and task patterns, see ue-state-trees.


Common Mistakes

Direct mutations inside ForEachEntityChunk:

// WRONG: direct mutation during iteration — undefined behavior
Query.ForEachEntityChunk(Context,
    [&EntityManager](FMassExecutionContext& Context) {
    EntityManager.AddFragmentToEntity(Context.GetEntities()[0],
        FHealthFragment::StaticStruct()); // CRASH
});
// RIGHT: use deferred commands
Query.ForEachEntityChunk(Context,
    [](FMassExecutionContext& Context) {
    Context.Defer().AddFragment<FHealthFragment>(Context.GetEntities()[0]);
});

Storing FMassEntityView across frames: Entity views are transient. Archetype memory may relocate between frames, invalidating stored views. Create a fresh FMassEntityView each time.

Using IsSet/IsValid for existence: Handle.IsSet() only checks non-zero fields. A destroyed entity's handle still returns true. Use EntityManager.IsEntityValid(Handle).

Missing RegisterQuery: Forgetting RegisterQuery(MyQuery) in ConfigureQueries() silently skips the query. Every query used in Execute must be registered.

UObject access without game-thread flag: Accessing UObject properties from a parallel processor causes races. Set bRequiresGameThreadExecution = true or declare dependencies via AddSubsystemRequirement.

Fragment access mismatch: ReadOnly access + GetMutableFragmentView<T>() triggers an assertion. Match access mode to view type.


Reference Files

  • references/mass-entity-patterns.md -- Processor, observer, trait, and deferred command code templates
  • references/mass-fragment-reference.md -- Built-in fragment types, shared fragments, and trait classes

Related Skills

  • ue-ai-navigation -- NavMesh pathfinding and AI perception for Mass agents
  • ue-procedural-generation -- PCG and ISM patterns relevant to Mass representation
  • ue-gameplay-framework -- GameMode/GameState interaction with Mass simulation
  • ue-actor-component-architecture -- Actor-entity bridging via MassAgentComponent
  • ue-async-threading -- Parallel execution patterns and thread safety
  • ue-cpp-foundations -- USTRUCT, UCLASS, subsystem patterns

平台分布

Codex

34.63%
按下载量换算197

Claude

30.38%
按下载量换算173

Cursor

19.96%
按下载量换算114

Gemini CLI

9.72%
按下载量换算55

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills