Skip to content
OpenAgentSkill
Browsing is open · Catalog captured 2026-11-21 · Automatic updates and account services are paused.
Development

ue-mass-entity

Use when writing or debugging Mass Entity ECS code in Unreal Engine C++ — processors, queries, fragments, tags, observers, traits, spawning and large-scale agent simulation. Also use when the user mentions 'MassEntity', 'UMassProcessor', 'FMassEntityQuery', 'ForEachEntityChunk', 'FMassEntityManager', 'FMassFragment', 'FMassTag', 'FTransformFragment', 'UMassObserverProcessor', 'ObservedTypes', 'Defer', 'archetype', 'AMassSpawner', 'entity config asset', 'MassCrowd', 'ISM crowd', 'entity relations', or 'thousands of agents'. For State Tree behavior on entities, see ue-state-trees; for ZoneGraph and Smart Objects, see ue-ai-navigation; for thread-safety rules, see ue-async-threading.

quodsoler · Static checks on file

Installation

Read the source and dependencies before running a command. Copying does not install or execute anything.

npx skills add quodsoler/unreal-engine-skills --skill ue-mass-entity

About this skill


name: ue-mass-entity description: "Use when writing or debugging Mass Entity ECS code in Unreal Engine C++ — processors, queries, fragments, tags, observers, traits, spawning and large-scale agent simulation. Also use when the user mentions 'MassEntity', 'UMassProcessor', 'FMassEntityQuery', 'ForEachEntityChunk', 'FMassEntityManager', 'FMassFragment', 'FMassTag', 'FTransformFragment', 'UMassObserverProcessor', 'ObservedTypes', 'Defer', 'archetype', 'AMassSpawner', 'entity config asset', 'MassCrowd', 'ISM crowd', 'entity relations', or 'thousands of agents'. For State Tree behavior on entities, see ue-state-trees; for ZoneGraph and Smart Objects, see ue-ai-navigation; for thread-safety rules, see ue-async-threading." metadata: version: "2.0.0" engine: "5.8"

UE Mass Entity

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

Mass is an archetype Entity Component System for simulating thousands of agents with cache-friendly data layouts and multi-threaded processors. The core lives in the always-available runtime modules MassEntity and MassCore (plus MassSignals, MassEngine); gameplay-facing pieces (spawning, representation, movement, LOD, replication, actor bridging) come from the MassGameplay (Experimental in 5.8) plugin, and navigation/behavior from MassAI (Experimental in 5.8) and MassCrowd (Experimental in 5.8).

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
Build.cs, includes, "enable the plugin"Modules and Build.cs
Declaring fragments, tags, shared/chunk dataFragments, Tags and Archetypes
Creating/destroying entities, direct mutationFMassEntityManager
Writing a processor, scheduling, phasesUMassProcessor
Selecting entities, requirements, filteringFMassEntityQuery
Reading/writing fragment data in a loopIteration and FMassExecutionContext
Adding/removing fragments during iterationDeferred Commands
Reacting to fragment/tag add or removeUMassObserverProcessor
One entity outside a processor, fluent buildSingle-Entity Access and FEntityBuilder
Parent/child links, archetype groupingRelations and Archetype Groups
Traits, config assets, AMassSpawnerTraits, Config Assets and Spawning
ISM rendering, LOD, actor promotionRepresentation and LOD
Crowds, lanes, entity AICrowd, Navigation and Behavior

Longer templates live in mass-entity-patterns.md; built-in types and fields in mass-fragment-reference.md.

Modules and Build.cs

There is no MassEntity plugin to enable. MassEntity and MassCore are runtime modules that ship with the engine — add them to Build.cs and they link. Only the gameplay layers are plugins, and those must be enabled in the .uproject.

PublicDependencyModuleNames.AddRange(new string[] {
    "Core", "CoreUObject", "Engine",
    "MassEntity",          // manager, processors, queries, commands, relations
    "MassCore",            // FMassFragment/FMassTag bases, FTransformFragment, traits
    "MassSignals",         // UMassSignalSubsystem, UMassSignalProcessorBase
    "MassCommon",          // UE::Mass::ProcessorGroupNames      (MassGameplay)
    "MassSpawner",         // UMassEntityTraitBase, AMassSpawner  (MassGameplay)
    "MassMovement",        // FMassVelocityFragment               (MassGameplay)
    "MassRepresentation",  // ISM visualization + LOD             (MassGameplay)
    "MassActors",          // UMassAgentComponent, actor bridging (MassGameplay)
    "MassNavigation",      // FMassMoveTargetFragment             (MassAI)
});

Include paths that moved into MassCore are namespaced under Mass/: Mass/EntityElementTypes.h, Mass/EntityFragments.h, Mass/EntityHandle.h, Mass/ExternalSubsystemTraits.h, Mass/ArchetypeGroup.h. MassEntityTypes.h still pulls the element bases in transitively; prefer the explicit Mass/ path.

Fragments, Tags and Archetypes

ConceptBase / typePurpose
EntityFMassEntityHandleIndex + SerialNumber identity handle
FragmentFMassFragmentPer-entity mutable data
Sparse fragmentFMassSparseFragmentPer-entity data stored outside the archetype (no entity move on add)
TagFMassTagZero-size marker used for filtering
Sparse tagFMassSparseTagMarker added/removed without an archetype change
Chunk fragmentFMassChunkFragmentOne instance per memory chunk
Shared fragmentFMassSharedFragmentMutable value shared by entities that reference it
Const shared fragmentFMassConstSharedFragmentImmutable shared configuration
ArchetypeFMassArchetypeHandleA unique fragment/tag composition

All of these derive from FMassElement and are declared in Mass/EntityElementTypes.h.

// MyMassTypes.h
#pragma once
#include "Mass/EntityElementTypes.h"
#include "MyMassTypes.generated.h"

USTRUCT()
struct FMyHealthFragment : public FMassFragment
{
    GENERATED_BODY()

    UPROPERTY(EditAnywhere, Category = "Mass")
    float Current = 100.f;

    UPROPERTY(EditAnywhere, Category = "Mass")
    flo
Read the complete source ↗