About unreal-gas
unreal-gas is a C++ guide for developers implementing Unreal Engine's Gameplay Ability System. It covers setup, architecture, effects, ability lifecycles, networking, and common pitfalls, and points to official and community references for current details.
Key features
- 01Plugin setup and core class relationships
- 02Ability, effect, attribute, and tag patterns
- 03Ability lifecycle and activation methods
- 04Networking, replication, and prediction guidance
- 05Common implementation pitfalls and references
Use cases
- 01Setting up Gameplay Ability System in a project
- 02Implementing abilities and gameplay effects in C++
- 03Reviewing multiplayer replication and prediction patterns
Install
Copy the command and run it in a terminal.
npx skills add https:/ / github.com/ maystudios/ claude-skills --skill unreal-gasAfter installing, type/unreal-gasin Claude Code to confirm it loaded.
Bundled files
References and scripts installed along with SKILL.md.
references/core-classes.mdeffects-and-attributes.mdnetworking.mdpatterns-and-pitfalls.mdDetails
From the project READMEUnreal Engine Gameplay Ability System (GAS) -- C++ Guide
Official Documentation (always consult for latest details)
These are the authoritative sources. Reference them for up-to-date API details, as GAS evolves across engine versions:
The community docs by tranek are the most comprehensive single resource for GAS. They cover advanced topics (prediction internals, optimization, replication modes, pitfalls) that Epic's official docs do not. Always check them for edge cases and production patterns.
The Lyra Sample Project is Epic's recommended working reference implementation for GAS.
Plugin Setup
- Enable Gameplay Abilities plugin in the editor
- Add to
Build.cs:PublicDependencyModuleNames.AddRange(new string[] { "GameplayAbilities", "GameplayTags", "GameplayTasks" }); - UE 5.2 and earlier: call
UAbilitySystemGlobals::Get().InitGlobalData()in your AssetManager or GameInstance. UE 5.3+ does this automatically.
Core Architecture
See references/core-classes.md for the full class reference, setup patterns, and C++ code snippets.
System overview:
Actor
+-- UAbilitySystemComponent (ASC) --- manages everything below
+-- UGameplayAbility instances (granted abilities)
| +-- UAbilityTask instances (async execution)
+-- UAttributeSet instances (numeric data)
+-- Active UGameplayEffect specs (modifiers)
+-- FGameplayTag container (status/state)
+-- GameplayCue triggers (cosmetic FX)
Key relationships:
- ASC is the central hub; one per Actor (place on Pawn or PlayerState)
- Abilities create/apply Effects to modify Attributes and Tags on targets
- Effects auto-trigger Cues when their tags match
GameplayCue.*tags - Tags control ability activation, blocking, and cancellation systemically
- AbilityTasks handle async work (montages, delays, targeting) within abilities
Gameplay Effects Quick Reference
See references/effects-and-attributes.md for detailed GE patterns, modifier math, stacking, cooldowns, and attribute handling.
Duration types:
- Instant -- modifies BaseValue permanently, never tracked as active
- Duration -- modifies CurrentValue, auto-reverts on expiry
- Infinite -- persists until explicitly removed
Modifier aggregation: ((Base + Additive) * Multiplicative) / Division
- Multiply/Divide uses
1 + Sum(Mods - 1)-- two +50% multipliers = +100%, not +125%
Ability Lifecycle
GiveAbility() -> TryActivateAbility() -> CanActivateAbility()
-> ActivateAbility() [override this] -> CommitAbility() [apply cost/cooldown]
-> ... do work (AbilityTasks) ... -> EndAbility()
Four activation methods: explicit handle, GameplayEvent, GameplayEffect tags, Input codes.
Instancing policies:
InstancedPerActor-- recommended default; one instance reused per actorInstancedPerExecution-- new instance each activation; simplest but heaviestNonInstanced-- uses CDO; best performance, C++ only, no state/delegates/RPCs
Networking & Prediction
See references/networking.md for replication modes, prediction details, and multiplayer patterns.
Net Execution Policies: LocalPredicted, LocalOnly, ServerOnly, ServerInitiated.
Key rules:
- ASC replicates Attributes and Tags to all clients, but NOT abilities/effects (bandwidth optimization)
- Non-instant GEs support prediction rollback; instant GEs (damage) do NOT
- Cues use unreliable replication -- cosmetic only, never gameplay logic
- ASC's owning Actor must be locally controlled for remote activation to work
- For PlayerState-based ASC: use Mixed replication for players, Minimal for AI
Common Patterns & Pitfalls
See references/patterns-and-pitfalls.md for implementation recipes and known issues.
Critical pitfalls:
PreAttributeChangeclamping does NOT permanently change modifiers -- clamp BaseValue inPostGameplayEffectExecuteinsteadServer Respects Remote Ability Cancellationcauses more trouble than it's worth -- disable itReplication Policyon GameplayAbility is misleadingly named -- do not use it- PlayerState
NetUpdateFrequencydefaults too low -- increase it or enable Adaptive Network Update Frequency - Removing AttributeSets at runtime can crash clients
- Animation montages must use
PlayMontageAndWaitAbilityTask, not directPlayMontage, for replication