> For the complete documentation index, see [llms.txt](https://morningheartgames.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://morningheartgames.gitbook.io/docs/gameplay-ability-toolkit-ecs/reference/api-reference.md).

# ECS runtime API reference

This page lists the public types and calls of the ECS runtime, grouped by what you want to do. Each row gives the type or call and what it is for. Your IDE shows the full XML documentation for each one, so this page is a map, not a manual.

**Before you start**

* You know the ideas in [How it works](/docs/gameplay-ability-toolkit-ecs/build-with-it/concepts.md): the catalog, actors, requests, results and the frame order.
* Most types are in the `GameplayAbilityToolkit.Entities` namespace. Delivery types are in `GameplayAbilityToolkit.Entities.Delivery`. Netcode types are in `GameplayAbilityToolkit.Entities.Netcode` and exist only when `com.unity.netcode` is installed.
* Types marked *internal to the runtime* are public so that tools and tests can read them. Game code should not write them.

## Set up the catalog and actors

You use these in the Inspector, in a SubScene. See [Authoring](/docs/gameplay-ability-toolkit-ecs/build-with-it/authoring.md) for the fields.

| Type                         | Purpose                                                                                                                                                                                                                      |
| ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `GasCatalogAuthoring`        | Bakes the world's catalog from the assets it lists. One per world. **Gameplay Ability Toolkit > Entities > Gas Catalog Authoring**.                                                                                          |
| `GasEntityAuthoring`         | Bakes a GameObject into an actor: its attribute set, its abilities and their levels. **Gameplay Ability Toolkit > Entities > Gas Entity Authoring**.                                                                         |
| `GasEntityAbility`           | An ability with no script. It applies its granted effects and ends, or stays active when it declares waits. **Assets > Create > Gameplay Ability Toolkit > ECS > Ability**.                                                  |
| `GasEntityAbilityRuntime`    | What `GasEntityAbility` runs when it is granted to an `AbilitySystemComponent` on the GameObject runtime. It applies the effects to the owner and ends, unless the ability declares waits.                                   |
| `GasEntityAbilityDefinition` | The base class of ECS abilities. It holds the `Waits`, `Montages`, `MontageEvents` and `MontageEndedEvent`, and `EndsImmediatelyOnActivate`, which says whether the ability ends in its own activation.                      |
| `GasWaitDeclaration`         | One wait on an ability: `Kind`, `Duration`, `Tag`, `Attribute`, `Threshold`, `Action`, `Effect`, `FilterEffect`, `FireRepeatedly`, `Section` and `NextSection`.                                                              |
| `GasWaitKind`                | What a wait waits for: `Delay`, `TagPresent`, `TagAbsent`, `AttributeAbove`, `AttributeBelow`, `TagAdded`, `TagRemoved`, `GameplayEvent`, `EffectApplied`, `InputHeld`, `InputPressed`, `InputReleased` or `InputDoubleTap`. |
| `GasWaitAction`              | What a wait does when it holds: `EndAbility`, `CancelAbility`, `ApplyEffect`, `JumpToMontageSection`, `SetNextMontageSection` or `StopMontage`.                                                                              |
| `GasMontageEventBinding`     | Binds a montage notify (`Notify`) to the gameplay event it sends (`Event`, and `EndEvent` for the end of a notify state). Listed in an ability's **Montage Events**.                                                         |

## Find indices in the catalog

Every request and buffer addresses abilities, effects, tags and attributes by index. Look the index up by name once, when a system starts, and keep it. Each call returns -1 when the catalog has nothing of that name.

| Type or call                                                                                                                                                                                                                                                   | Purpose                                                                                                                                                |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `GasCatalog`                                                                                                                                                                                                                                                   | The component on the singleton catalog entity. `Value` is a `BlobAssetReference<GasCatalogBlob>`. Read it with `SystemAPI.GetSingleton<GasCatalog>()`. |
| `GasCatalogBlob.FindAbilityIndex(name)`                                                                                                                                                                                                                        | The index of the ability with this asset name.                                                                                                         |
| `GasCatalogBlob.FindEffectIndex(name)`                                                                                                                                                                                                                         | The index of the effect with this asset name.                                                                                                          |
| `GasCatalogBlob.FindTagIndex(name)`                                                                                                                                                                                                                            | The index of the tag with this full dotted name, such as `State.Stunned`.                                                                              |
| `GasCatalogBlob.FindAttributeIndex(setName, attributeName)`                                                                                                                                                                                                    | The index of an attribute, from its attribute set asset's name and its own name.                                                                       |
| `GasCatalogBlob.FindMontageIndex(nameHash)`                                                                                                                                                                                                                    | The index of a montage, from the hash of its asset name. `GasMontageUtility.NameHash` makes the hash.                                                  |
| `GasCatalogBlob`                                                                                                                                                                                                                                               | The baked data: the tables `Tags`, `Attributes`, `Modifiers`, `Effects`, `Abilities`, `Waits` and `Montages`, and the pools they point into.           |
| `GasTagEntry`, `GasAttributeEntry`, `GasModifierEntry`, `GasEffectEntry`, `GasAbilityEntry`, `GasWaitEntry`, `GasAbilityTrigger`                                                                                                                               | One row of each table. Read names and indices from them; the rest is *internal to the runtime*.                                                        |
| `GasMontageEntry`, `GasMontageNotify`, `GasMontageNotifyState`, `GasMontageSection`, `GasMontageClip`, `GasMontageEventBindingEntry`                                                                                                                           | The baked montages: length, play rate, notifies, notify states, sections and clips in time order, and each ability's notify bindings.                  |
| `GasQueryNode`, `GasConditionalEffectRef`                                                                                                                                                                                                                      | Baked tag queries and conditional effects. *Internal to the runtime.*                                                                                  |
| `GasModifierOperation`, `GasMagnitudeType`, `GasEffectType`, `GasAbilityTriggerSource`, `GasStackingDurationPolicy`, `GasStackingPeriodPolicy`, `GasStackingExpirationPolicy`, `GasStackingKeyPolicy`, `GasAttributeCalculationType`, `GasQueryExpressionType` | The catalog's copies of the toolkit's enums, with the same values.                                                                                     |
| `GasAbilityInstancingPolicy`, `GasAbilityCommitPolicy`                                                                                                                                                                                                         | An ability's instancing and commit policies as the catalog stores them.                                                                                |

## Ask the runtime to do something

Add a request to a queue. Queue it in `GasRequestSystemGroup`, and the runtime serves it in the same frame. Each queue is a singleton entity that carries a marker component and a buffer of requests.

| Queue                       | Request                                                                                                                                            | Asks for                                                                 | Call that queues one                    |
| --------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ | --------------------------------------- |
| `GasAbilityActivationQueue` | `GasAbilityActivationRequest`: `Target`, `Source`, `AbilityTarget`, `AbilityIndex`, `Level`, `SetByCallerStart`, `SetByCallerCount`, `FromTrigger` | Activating an ability.                                                   | `GasEntityFactory.RequestActivation`    |
| `GasInstantEffectQueue`     | `GasInstantEffectRequest`: `Target`, `Source`, `EffectIndex`, `Level`, `SetByCallerStart`, `SetByCallerCount`                                      | Applying an effect. Effects of every type go through this queue.         | `GasEntityFactory.RequestInstantEffect` |
| `GasAbilityEndQueue`        | `GasAbilityEndRequest`: `Target`, `AbilityIndex`, `WasCancelled`                                                                                   | Ending or cancelling a running ability.                                  | `GasEntityFactory.RequestEnd`           |
| `GasAbilityCommitQueue`     | `GasAbilityCommitRequest`: `Target`, `AbilityIndex`                                                                                                | Paying the cost and starting the cooldown of an explicit-commit ability. | None. Add to the buffer yourself.       |
| `GasGameplayEventQueue`     | `GasGameplayEvent`: `EventTagIndex`, `Instigator`, `Target`, `Magnitude`                                                                           | Raising a gameplay event. With no `Target`, every actor gets it.         | `GasEntityFactory.SendGameplayEvent`    |

`GasEntityFactory` is a static class. Its request calls each have two overloads: one finds the queue for you and returns `false` when the world has none, and one takes the queue entity.

| Call                                                                                                                  | Purpose                                                                                                                                           |
| --------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| `RequestActivation`, `RequestInstantEffect`, `RequestEnd`, `SendGameplayEvent`                                        | Queue a request, as in the table above.                                                                                                           |
| `AppendSetByCaller(entityManager, queue, name, value)` and `AppendSetByCaller(entityManager, queue, tagIndex, value)` | Add a set-by-caller value, keyed by name or by tag index, to a request queue's pool. Returns its index in the pool, to use as `SetByCallerStart`. |
| `TryGetQueue<TMarker>`                                                                                                | Find a queue entity from its marker component, such as `GasAbilityCommitQueue`.                                                                   |
| `GasSetByCallerValue`                                                                                                 | One value in a queue's pool: `NameHash` or `TagIndex`, and `Value`. Actors also keep these as the values an effect instance captured.             |

## Read what the runtime answered

Read these in `GasResultSystemGroup`. The runtime never clears activation results or cue events, so you do. It clears montage events itself at the start of its next update, and delivery hit events after one frame.

| Type                             | Purpose                                                                                                                                                                                                                                                             |
| -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `GasAbilityActivationEventQueue` | The singleton entity whose buffer receives one `GasAbilityActivationEvent` for each activation request.                                                                                                                                                             |
| `GasAbilityActivationEvent`      | The result of one request: `Target`, `Source`, `AbilityIndex`, `Level`, `Succeeded` and `FailureReason`.                                                                                                                                                            |
| `GasAbilityFailureReason`        | Why an activation failed: `Cooldown`, `Cost`, `TagRequirements`, `AbilitySystemNotFound` or `InvalidRequest`. `None` means it succeeded. The enum also has `RuntimeError`, which the ECS runtime does not set.                                                      |
| `GasCueEvent`                    | A cue raised on an actor, in its cue buffer: `Target`, `Instigator`, `Source`, `CueTagIndex`, `EventType`, `EffectLevel`, `EffectHandle` and `GameplayEffectActive`. See [Cues and presentation](/docs/gameplay-ability-toolkit-ecs/build-with-it/presentation.md). |
| `GasCueEventType`                | Which kind of cue it is: `OnActive`, `WhileActive`, `Executed` or `Removed`.                                                                                                                                                                                        |
| `GasMontageEvent`                | What happened to an actor's montage in the last update. See [Play and read montages](#play-and-read-montages).                                                                                                                                                      |
| `GasDeliveryHitEvent`            | A hit that a delivery ability made, for one frame. See [Abilities that reach other actors](#abilities-that-reach-other-actors).                                                                                                                                     |

## Read an actor's state

An actor is an entity with these components and buffers. Read them read-only. See [Performance](/docs/gameplay-ability-toolkit-ecs/reference/performance.md#read-the-runtimes-buffers-read-only) for why.

| Type                                                                                                                                        | Purpose                                                                                                                                                                                                  |
| ------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `GasAttributeValue`                                                                                                                         | Buffer: `BaseValue` and `CurrentValue` for each attribute in the catalog, indexed by attribute index.                                                                                                    |
| `GasTagCount`                                                                                                                               | Buffer: the tags the actor owns, with their counts, and the ability tags it blocks. `GasTagKind` (`Owned` or `BlockedAbility`) tells them apart.                                                         |
| `GasAbilitySlot`                                                                                                                            | Buffer: one element for each granted ability: `AbilityIndex`, `Level`, `CooldownRemaining`, `ActiveCount` and `UncommittedCount`.                                                                        |
| `GasActiveEffect`                                                                                                                           | Buffer: each live duration or infinite effect instance: `EffectIndex`, `Level`, `StackCount`, `MaxStackCount`, `Duration`, `Period`, `StartTime`, `NextPeriodTime`, `Handle`, `Source` and `Instigator`. |
| `GasInputState`                                                                                                                             | Component: `Held`, whether the actor's input is held. Input waits read it. Your input code writes it; with Netcode for Entities, `GasAbilityInput` does.                                                 |
| `GasAttributeModifier`, `GasGrantedAbility`, `GasActiveWait`, `GasAppliedEffectEvent`, `GasActiveCue`, `GasTagSnapshot`, `GasInputSnapshot` | The runtime's own bookkeeping for modifiers, granted abilities, armed waits, applied effects, cues that are showing and the previous frame's tags and input. *Internal to the runtime.*                  |
| `GasRecalcState`, `GasEffectGate`, `GasHasActiveEffects`, `GasHasRunningCooldown`, `GasHasWaitWork`                                         | Fingerprints and flags the runtime uses to skip actors that nothing changed. *Internal to the runtime.*                                                                                                  |

## Play and read montages

Only actors granted an ability with montages carry the montage components.

| Type or call                                                                                                                    | Purpose                                                                                                                                                                                                             |
| ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `GasMontagePlayback`                                                                                                            | Buffer: one element for each montage slot the actor has played in: `Montage`, `Ability`, `Time`, `PlayRate`, `Section`, `Sequence`, `Playing`, `Paused`, `BlendingOut` and `Interrupted`.                           |
| `GasMontageEvent`                                                                                                               | Buffer: what happened in the last update. The runtime clears it at the start of its next update.                                                                                                                    |
| `GasMontageEventKind`                                                                                                           | The kind of a `GasMontageEvent`: `Started`, `Notify`, `Ended`, `Interrupted`, `BlendingOut`, `NotifyBegin`, `NotifyEnd` or `SectionChanged`.                                                                        |
| `GasMontageRootMotion`                                                                                                          | Component: how far the montages moved the actor in the last update (`Delta`, `DeltaYaw`), whether root motion is `Active`, and the actor's `Scale`. The runtime owns no transform, so a system of yours applies it. |
| `GasMontageUtility.MontageForLevel`                                                                                             | The montage an ability plays at a level.                                                                                                                                                                            |
| `GasMontageUtility.TryGetSlot`, `TryGetAbilitySlot`, `FindPlayingForAbility`, `AbilitySlotNameHash`                             | Find the `GasMontagePlayback` element for a slot, or for an ability.                                                                                                                                                |
| `GasMontageUtility.TryGetClip`                                                                                                  | The clip, by name hash, and the time within the clip that a montage shows now. Use it to pose a character.                                                                                                          |
| `GasMontageUtility.GetBlendWeight`                                                                                              | The weight of a slot's montage, rising through its blend-in and falling through its blend-out.                                                                                                                      |
| `GasMontageUtility.RequestJumpToSection`, `RequestSetNextSection`, `RequestStop`, `RequestPosition`, `SetPlayRate`, `SetPaused` | Steer a playing montage. Jump, stop and position requests are carried out on the montage system's next update.                                                                                                      |
| `GasMontageUtility.BoundEvent`, `BoundEndEvent`                                                                                 | The event tag an ability binds to a notify, or to the end of a notify state.                                                                                                                                        |
| `GasMontageUtility.NameHash`                                                                                                    | The hash under which a notify, section, slot, clip or montage name is baked.                                                                                                                                        |

## Do something at once

These static calls act when you call them, with the same rules as the queues. Use them in editor tools, in tests and in main-thread code that needs an answer on the spot. Inside a system's update, prefer the queues. See [Doing it now instead of queueing](/docs/gameplay-ability-toolkit-ecs/build-with-it/gameplay-code.md#doing-it-now-instead-of-queueing).

| Type                          | Calls                                                                                                                                                                                                                                                                                                                                                                                      |
| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `GasEffectUtility`            | `TryApplyEffect` applies an effect of any type. Its longer overloads report a `GasEffectFailureReason` and the new instance's handle. `RemoveEffectInstance`, `RemoveEffect`, `RemoveEffectsFromSource`, `RemoveEffectsWithTag` and `RemoveAllEffects` take effects off. `CountActiveInstances` counts the instances of an effect.                                                         |
| `GasEffectFailureReason`      | Why an effect did not apply: `InvalidEffectIndex`, `TargetCannotReceiveEffects`, `ApplicationRequirementsNotMet`, `TargetNotSimulated` or `InvalidEffectData`.                                                                                                                                                                                                                             |
| `GasSetByCallerContext`       | The set-by-caller values for one direct call: a slice (`Start`, `Count`) of a pool (`Values`).                                                                                                                                                                                                                                                                                             |
| `GasAbilityActivationUtility` | `TryActivate` activates an ability and returns its `GasAbilityActivationEvent`. `EndAbility` ends one execution, and `EndAllExecutions` ends all of them. `TryCommit` commits an explicit-commit ability. `FindSlot` finds an ability's slot in a `GasAbilitySlot` buffer.                                                                                                                 |
| `GasTagUtility`               | `HasTag` and `GetTagCount` count a tag and its child tags. `HasTagExact` and `GetExplicitTagCount` count the exact tag only. `HasAll` and `HasAny` test a range of tags. `IsSelfOrAncestor` tests the tag hierarchy. `AddTag`, `RemoveTag`, `AddTags` and `RemoveTags` change a tag buffer directly; the runtime's own systems use them, and game code should ask through effects instead. |
| `GasQueryUtility`             | `Matches` evaluates a baked tag query against an actor's tags.                                                                                                                                                                                                                                                                                                                             |
| `GasCueUtility`               | `RaiseCue` and `RaiseEffectCues` raise cue events from your own code, with the runtime's rules.                                                                                                                                                                                                                                                                                            |
| `GasMagnitudeUtility`         | Evaluates baked magnitudes at a level: `EvaluateLevel`, `EvaluateModifier`, `EvaluateAttributeBased` and `GetCooldown`.                                                                                                                                                                                                                                                                    |
| `GasSimulationFilter`         | `ShouldSimulate` is false for a Netcode ghost that this client is not predicting.                                                                                                                                                                                                                                                                                                          |

## Place your systems in the frame

Put a system in `GasRequestSystemGroup` or `GasResultSystemGroup` with `[UpdateInGroup]`. Do not order a system against `GasSimulationSystemGroup`. See [How it works](/docs/gameplay-ability-toolkit-ecs/build-with-it/concepts.md#the-frame) for the order and what it means.

| Type                                                                                                                                                                                                                                                                                | Purpose                                                                                  |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
| `GasRequestSystemGroup`                                                                                                                                                                                                                                                             | Where your systems ask. It runs just before the runtime.                                 |
| `GasSimulationSystemGroup`                                                                                                                                                                                                                                                          | The runtime.                                                                             |
| `GasResultSystemGroup`                                                                                                                                                                                                                                                              | Where your systems read results. It runs just after the runtime.                         |
| `GasRuntimeBootstrapSystem`                                                                                                                                                                                                                                                         | In `InitializationSystemGroup`. Creates the queues and the clock when a catalog appears. |
| `GasTimeSystem`, `GasAbilityCooldownSystem`, `GasAbilityEndSystem`, `GasAbilityActivationSystem`, `GasAbilityCommitSystem`, `GasMontageSystem`, `GasInstantEffectSystem`, `GasEffectTickSystem`, `GasAttributeRecalculateSystem`, `GasAbilityWaitSystem`, `GasAbilityTriggerSystem` | The runtime's systems, in the order they run.                                            |

## Time and diagnostics

| Type or call                                | Purpose                                                                                                                                                                                                  |
| ------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `GasTime`                                   | The runtime's clock: `Elapsed`, `DeltaTime` and `Manual`. Set `Manual` to advance it yourself.                                                                                                           |
| `GasEntityFactory.TryGetWorldTime`          | Reads the clock. Returns `false` when the world has none.                                                                                                                                                |
| `GasSimulationStats`                        | Counters of the runtime's last update. Create one entity with this component to turn them on. See [Performance](/docs/gameplay-ability-toolkit-ecs/reference/performance.md#read-the-runtimes-counters). |
| `GasEntityFactory.TryGetSimulationStats`    | Reads the counters. Returns `false` when no entity carries them.                                                                                                                                         |
| `GasRuntimeSnapshot.Capture(entityManager)` | The number of actors, active effects, waits and owned tags, and the depth of each queue, cues included. `HasUndrainedConsumerQueue` is true when results or cues have passed `UndrainedThreshold` (100). |

## Build a catalog and a world in code

For tests, tools and problems you want to reproduce in isolation. [Minimal ECS example](/docs/gameplay-ability-toolkit-ecs/reference/minimal-example.md#code-path) shows them together.

| Type or call                                                           | Purpose                                                                                          |
| ---------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
| `GasCatalogBuilder.Build(tagAsset, attributeSets, effects, abilities)` | Turns assets into `GasCatalogData`, as the baker does. It takes an optional montage slot config. |
| `GasCatalogBuilder.BuildForActor`                                      | Builds the data for the catalog an actor uses.                                                   |
| `GasCatalogData`                                                       | The built data. `Diagnostics` lists everything the build skipped or changed, and why.            |
| `GasCatalogBlobFactory.Create(data)`                                   | Makes the blob that a `GasCatalog` holds. You dispose it.                                        |
| `GasEntityFactory.CreateCatalogEntity`                                 | Creates the entity that carries the catalog.                                                     |
| `GasEntityFactory.CreateQueues`                                        | Creates the activation, effect and result queues.                                                |
| `GasEntityFactory.CreateControlQueues`                                 | Creates the end, gameplay-event and commit queues.                                               |
| `GasEntityFactory.CreateTime`, `SetTime`                               | Create the clock, and set it. `SetTime` switches the clock to manual control.                    |
| `GasEntityFactory.EnsureRuntimeSingletons`                             | Creates whichever queues and clock are missing. `GasRuntimeBootstrapSystem` calls it.            |
| `GasEntityFactory.CreateActor`                                         | Creates an actor from the catalog and a list of ability indices.                                 |

## Abilities that reach other actors

In `GameplayAbilityToolkit.Entities.Delivery`. See [Abilities that reach other actors](/docs/gameplay-ability-toolkit-ecs/build-with-it/delivery.md).

| Type or call                                                                                                                                                                      | Purpose                                                                                                                                |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| `GasDeliveryAbility`                                                                                                                                                              | An ECS ability that finds actors and applies effects to each. **Assets > Create > Gameplay Ability Toolkit > ECS > Delivery Ability**. |
| `GasDeliveryShape`                                                                                                                                                                | Where it looks: `Area`, `Arc`, `Nearest` or `Projectile`.                                                                              |
| `GasDeliveryTiming`                                                                                                                                                               | When it hits: `OnActivation`, `OnMontageNotify`, `AfterDelay` or `WhileActive`.                                                        |
| `GasCasterAuthoring`, `GasCastSetting`                                                                                                                                            | Lets an actor ask for its abilities by itself. **Gameplay Ability Toolkit > Entities > Gas Caster Authoring**.                         |
| `GasCastMode`                                                                                                                                                                     | How a caster asks: `Code`, `Automatic`, `Interval` or `InputAction`.                                                                   |
| `GasCasting.Request(entityManager, caster, abilityIndex)`                                                                                                                         | Asks for a caster's ability from code. Returns `false` when the caster has no entry for it.                                            |
| `GasCastTrigger`                                                                                                                                                                  | Buffer on a caster: one entry for each ability it asks for, with its mode and its combo state (`ComboStep`, `ComboWindow`).            |
| `GasCombo`                                                                                                                                                                        | The combo rules. `WindowStart` and `WindowEnd` name the `Combo Start` and `Combo End` notifies.                                        |
| `GasDeliveryHitEvent`                                                                                                                                                             | Buffer on the delivery state entity: `AbilityIndex`, `Caster`, `Target` and `Level` of each hit, for one frame.                        |
| `GasCastTriggerSystem`, `GasComboSystem`, `GasDeliveryStartSystem`, `GasDeliverySearchSystem`, `GasProjectileSystem`, `GasDeliveryApplySystem`, `GasDeliveryResultsCleanupSystem` | The delivery module's systems. Each runs in `GasRequestSystemGroup` or `GasResultSystemGroup`.                                         |
| `GasDeliveryCatalog`, `GasDeliveryEntry`, `GasDeliveryEffect`, `GasDeliveryTagFilter`                                                                                             | The baked settings of the delivery abilities. `GasDelivery.FindEntry` finds an ability's entry. *Internal to the runtime.*             |
| `GasDeliveryState`, `GasDeliveryScheduled`, `GasDeliveryAwaitingNotify`, `GasDeliveryChannel`                                                                                     | The delivery systems' work queues. *Internal to the runtime.*                                                                          |

### Replace the delivery searches

See [Using your own queries](/docs/gameplay-ability-toolkit-ecs/build-with-it/delivery.md#using-your-own-queries) for a complete custom search system and its update order.

| Type or call                                           | Purpose                                                                                                                                                                                                                   |
| ------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `GasDelivery.ConfigureQueries(entityManager, options)` | Sets query ownership for this world. It keeps pending requests. Pass `default` to restore the built-in systems.                                                                                                           |
| `GasDeliveryQueryOptions`                              | `ExternalTargetSearch` leaves pending target searches to your system. `ExternalProjectileSimulation` leaves projectile movement, collision, hit history and destruction to your system. The two switches are independent. |
| `GasDelivery.EnsureState(entityManager)`               | Gets or creates the delivery state entity and its queues.                                                                                                                                                                 |
| `GasDelivery.PassesFilter`                             | Checks an entry's required and ignored tags, from a dynamic buffer or a native array. Callable from Burst. Geometry and target limits belong to your query.                                                               |
| `GasDeliveryPending`                                   | Target-search input: `Entry`, `Caster`, `Level`, `Origin` and `Forward`. A custom search consumes the requests it processes.                                                                                              |
| `GasDeliveryHit`                                       | Query output: `Entry`, `Caster`, `Target` and `Level`. Append to the delivery state's buffer for `GasDeliveryApplySystem`.                                                                                                |
| `GasProjectile`, `GasProjectileHitActor`               | Projectile state and its previous targets. A custom projectile system maintains these when it takes ownership.                                                                                                            |

`GasDeliveryApplySystem` applies each hit's configured effects and reports it as a `GasDeliveryHitEvent`, including hits from a custom system. The built-in spatial index is internal. A custom query can use its own spatial data, Unity Physics or game-specific selection without reading or rebuilding that index.

## Netcode for Entities

In `GameplayAbilityToolkit.Entities.Netcode`. See [Netcode for Entities](/docs/gameplay-ability-toolkit-ecs/build-with-it/netcode-for-entities.md).

| Type                                                                                                                                           | Purpose                                                                                                                                                                                                    |
| ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `GasAbilityInput`                                                                                                                              | The predicted input on a player's ghost: `AbilityIndex`, `Level`, `Trigger` and `Held`.                                                                                                                    |
| `GasNetcodeRequests`                                                                                                                           | `SendActivateAbility` asks the server to activate an ability, by RPC.                                                                                                                                      |
| `GasActivateAbilityRpc`                                                                                                                        | The RPC that carries the request: `AbilityIndex` and `Level`.                                                                                                                                              |
| `GasGhostAttribute`, `GasGhostOwnedTag`, `GasGhostBlockedTag`, `GasGhostAbilitySlot`, `GasGhostActiveEffect` and the other `GasGhost…` buffers | The replicated copies of an actor's state, baked onto ghosts for you. *Internal to the runtime.*                                                                                                           |
| `GasGhostMontage`                                                                                                                              | The replicated `GasMontagePlayback`, on ghosts whose abilities play montages. A predicted client rolls the montage back with the rest of the actor. An interpolating client reads it to animate the actor. |
| `GasPredictedBootstrapSystem`                                                                                                                  | Moves the three GAS groups into `PredictedSimulationSystemGroup`.                                                                                                                                          |
| `GasPredictedClockSystem`                                                                                                                      | Drives `GasTime` from the network tick.                                                                                                                                                                    |
| `GasPredictedStateRestoreSystem`, `GasPredictedStatePublishSystem`                                                                             | Copy state between the replicated copies and the runtime, before and after each predicted tick.                                                                                                            |
| `GasPredictedInputSystem`                                                                                                                      | Turns each tick's `GasAbilityInput` into activation requests, on the client and on the server.                                                                                                             |
| `GasPredictedCueMarkSystem`, `GasPredictedCueDropSystem`                                                                                       | Keep only the cues of a tick's first full prediction on a client.                                                                                                                                          |
| `GasNetcodeActivationRpcReceiveSystem`                                                                                                         | Server: turns activation RPCs into requests.                                                                                                                                                               |
| `GasNetcodeStateMirrorSystem`                                                                                                                  | Server: copies state that code outside the prediction loop wrote into the replicated copies.                                                                                                               |
| `GasDeliveryClientOffSystem`                                                                                                                   | Client: switches the delivery systems off, because deliveries run on the server only.                                                                                                                      |
| `GasGhostConfiguration`                                                                                                                        | Checks a ghost's Netcode settings, with `Validate` and `Recommend`. The **ECS Networking** page of the Dashboard shows the result.                                                                         |
| `GasGhostProfile`, `GasGhostRecommendation`, `GasGhostFinding`, `GasGhostFindingSeverity`                                                      | The plain values `GasGhostConfiguration` takes and returns.                                                                                                                                                |

## Next steps

* [Writing gameplay code](/docs/gameplay-ability-toolkit-ecs/build-with-it/gameplay-code.md): the requests, results and direct calls above, in use.
* [How it works](/docs/gameplay-ability-toolkit-ecs/build-with-it/concepts.md): the catalog, the queues and the frame order.
* [Authoring](/docs/gameplay-ability-toolkit-ecs/build-with-it/authoring.md): the components and assets in the first table.
* [Troubleshooting](/docs/gameplay-ability-toolkit-ecs/reference/troubleshooting.md): when a request does nothing.
