Skip to main content

Abilities

Every ability is an Ability Definition Data Asset. The asset holds what the ability is and all of its numbers; the logic is in a Gameplay Ability class that many abilities share, one per cast type. A new ability therefore needs a new asset and no code. Abilities run on Unreal's Gameplay Ability System, with the start of each cast predicted on the caster's own game (see Multiplayer).

Key concepts​

  • Ability Definition: one Data Asset per ability, champion abilities and summoner spells alike.
  • Cast type: how the ability is aimed and fired, such as Skillshot or Channel. Each has its own ability class.
  • Slot: the key the ability sits on: Q, W, E, R, or Passive. Summoner spells sit on D and F.
  • Rank: Q, W and E have ranks 1 to 5, the ultimate on R ranks 1 to 3. Every rank has its own cooldown, cost and damage.
  • Effects: Gameplay Effects the ability applies besides its damage and heal: crowd control, shields, buffs.
  • Description: the tooltip text, with tokens the framework fills with the rank's numbers.

The Ability Definition​

Make one in the Content Browser with Miscellaneous > Data Asset > Ability Definition, or duplicate a sample one such as DA_Varra_Q_PiercingBolt in /PioneerMOBA/Sample/Champions/Varra. Then add it to a Champion Definition's Abilities under its slot. Add an ability walks through it.

SectionFieldWhat it does
AbilityDisplay Name, IconWhat the HUD shows
DescriptionThe tooltip, with {Tokens} for its numbers; see Descriptions
Ability TagIdentifies the ability, for example Ability.Varra.Q
SlotQ, W, E, R, or Passive. A summoner spell goes on D
Ability ClassThe class that runs it: the class of its cast type, or a Blueprint ability of your own
Max Rank5 for a basic ability, 3 for an ultimate, 1 for a passive or a summoner spell
Rank LevelsThe champion level each rank needs. Empty uses the Match settings: 1, 3, 5, 7, 9, and 6, 11, 16 for the ultimate
CastingCast TypeHow it is aimed and fired; see Cast types
Default Cast ModeWhat the key does until the player chooses; see Cast modes
Cast TimeSeconds between the cast and the ability firing. The caster stands still for that long
Wait For ServerOff: the caster's own game predicts the cast. On: it shows nothing of the cast until the server has confirmed it
Walk Into RangeA cast on something out of range walks into range first
Max DurationThe longest the ability stays active after it has fired (10 s by default)
Cast Clip, Clip Effect Time, Charge ClipThe animation the caster plays; see Effects and animation
TargetingRange, Width, Radius, Angle and the restThe shape of the ability. Which ones a cast type reads is in the table below
AffectsWho it can be cast on and hits: Enemies, Allies, Allies And Self, or Self
Max TargetsThe most units an area hits, nearest to its center first. 0 hits all
Target Unit TagsLimits a targeted ability to units with one of these tags; see Targeting a kind of unit
Only ChampionsAreas, lines and cones pass minions, monsters and structures over, and a skillshot flies through them
RanksCooldown, Mana CostOne value per rank, rank 1 first
Base DamageDamage per rank before scaling, crits and resists
Scaling Attribute, Scaling RatioAdds that share of the caster's stat to the damage: 0.7 of Bonus Attack Damage adds 70% of it
Base Heal, Heal Per LevelHealth each unit hit gets back, per rank, and more for each level of the caster
EffectsDamage TypePhysical, Magic or True
Can CritAbilities do not crit unless this is on
EffectsGameplay Effects besides the damage; see Effects
CuesThe Gameplay Cues of the cast, the projectile's flight, each hit and the area; see Effects and animation
BotUsage and the restWhen bots use the ability; see Bots

What you can rely on​

  • Values are read when the ability is cast. Change a number while the game runs in the editor and the next cast uses it. A cooldown that is already running keeps its length.
  • A shape is exactly as large as its numbers. A skillshot flies Range from the caster's center. A unit is hit when its body touches the shape: for a line 120 cm wide and a champion 34 cm in radius, when its center is less than 94 cm from the middle of the line. A cone goes by the unit's center.
  • The indicator is drawn from the same numbers, so it always matches what the ability hits.
  • Saving checks the asset. A missing Ability Tag or Ability Class, a number its cast type needs that is 0, or a rank array shorter than Max Rank is an error in the message log, and an ability with an error is not granted to its champion. An empty rank array means the ability does not use that value.
  • Cooldowns are per slot. While Q is on cooldown the champion carries the gameplay tag Cooldown.Q.
  • A champion with Resource set to None pays no mana; only cooldowns hold it back.

Cast types​

Each ability picks a Cast Type and points its Ability Class at the class that runs it.

Cast TypeAbility ClassWhat it doesFields it reads
Skillshot (Line)MobaSkillshotAbilityA projectile flies the full Range along the aim. It stops at the first enemy, or with Pierces Units hits every one on the lineRange, Width, Projectile Speed, Pierces Units, Projectile Class
TargetedMobaTargetedAbilityCast on one unit. With a Projectile Speed a projectile follows the unit and hits when it arrives; with 0 it hits at once. With Affects set to Self it is cast on the casterRange, Affects, Projectile Speed, Homing Projectile Class
AoEMobaAreaAbilityHits every unit whose body reaches into a circle at the aim point. With Range 0 the circle is around the casterRange, Radius, Affects, Max Targets
ConeMobaConeAbilityHits every unit whose center is within Range of the caster and within the Angle around the aim directionRange, Angle
DashMobaDashAbilityMoves the caster toward the aim at Dash Speed, up to Range. It stops at a wall, and at the first enemy champion if the ability has damage or an effect, which that champion then takes. With a Radius it is a leap: it passes everyone and hits the circle where it landsRange, Dash Speed, Width, Radius
BlinkMobaBlinkAbilityMoves the caster to the aim point at once, up to Range. Aimed into a wall, it lands on the last walkable point on the way. With a Radius it hits the units around the landing pointRange, Radius
ChannelMobaChannelAbilityThe caster stands still for Channel Duration and hits the circle every Tick Interval, the first time at once. With Range 0 the circle is around the casterRange, Radius, Channel Duration, Tick Interval
ToggleMobaToggleAbilityIts key switches it on and off. While on, it drains its rank's Mana Drain each second, keeps its caster effects up and, with a Radius, hits the circle around the caster every Tick IntervalMana Drain, Tick Interval, Radius
ChargedMobaChargedAbilityThe key press starts the charge; the reach grows from Min Range to Range over Max Charge Time; the release hits a line of that reachMin Range, Range, Width, Max Charge Time, Full Charge Hold Time
AoE, as a wallMobaWallAbilityRaises a wall at the aim point for Wall Lifetime seconds, Wall Length long across the aim and Width thick. It blocks walking and dashes; projectiles fly over it. Units where it rises are pushed to the nearer side. A Blueprint of MobaWall in Wall Class gives its lookRange, Wall Length, Width, Wall Lifetime, Wall Class
PassiveMobaPassiveAbilityNo key. It fires on every Nth gameplay event of its Passive Trigger, every Cooldown seconds, when the champion loses a tag, or as an empowered basic attackPassive Trigger, Passive Trigger Count, Only Champions Trigger, Empowers Attack, Empowered Attack Scale, Range, Width

What you can rely on​

  • Range is measured from the caster's center to the point, or to the edge of the target unit's body.
  • A cast out of range (Targeted, AoE, Channel) walks the champion into range first and then casts, unless Walk Into Range is off. The server never casts beyond the range: a request from too far away is refused, with a leeway of 50 cm for the way the champion walked while the request travelled.
  • Cost and cooldown start with the cast, before the cast time. A cast the server refuses costs nothing.
  • The caster stands still during the cast time. A stun, a silence or a knock-up during it cancels the cast.
  • The target of a targeted ability dies during the cast time: the cast is cancelled, and the mana and the cooldown are given back.
  • A channel ends at once on a move, attack or cast order, and on a stun, a silence or a knock-up.
  • A toggle's cooldown starts when it is switched off. It switches itself off when the mana reaches 0. Stuns and silences leave it on.
  • A charged ability is paid for at the key press. The caster stands still while it charges. A key still held Full Charge Hold Time (0.5 s) after the full charge casts by itself. Effects marked Only At Full Charge apply only to a cast held the full time, and Full Charge Damage Scale multiplies its damage: 1.5 is 50% more.
  • A recast (Recast Window): after the ability hits a unit, casting it again within that many seconds dashes the caster to the unit at Dash Speed, for no mana and without a new cooldown.
  • An execute (Execute Below Health) kills a champion whose health is below that share of its maximum when the hit lands, through shields, damage reduction and guards. Above it, the hit is an ordinary one.
  • Caster Heal Per Champion Hit heals the caster that share of its own maximum health for each enemy champion the cast hits, once per champion per cast.
  • Hits are the server's. The caster's own game predicts the start of a cast, the dash and the blink; nobody predicts damage.

Passives​

A passive is always rank 1. It ends when the champion dies and starts again with the new body.

  • By event: it counts the gameplay events of its Passive Trigger while off cooldown, and fires on every Passive Trigger Count-th. With Only Champions Trigger, only events about a champion count. With a Range and a Width it hits a line from the caster through the unit the event is about; without them, that unit.
  • By time: with no trigger and a Cooldown, it fires when the champion gets it and every Cooldown seconds after.
  • On losing a tag: Fires On Losing Tags, such as State.InBrush as the champion leaves brush or State.Stealthed as its stealth ends.
  • Empowered attacks: with Empowers Attack, every Passive Trigger Count-th basic attack, and the first attack while an Empower effect is on the champion, deals the attack's damage times Empowered Attack Scale plus the passive's own damage, as a basic attack that can crit and lifesteal. Its Primed Cue plays while the next attack is the empowered one.

The gameplay events the framework sends to a champion's ability system:

Event tagWhenThe event's target
Event.Attack.StartedA basic attack begins its wind-upThe unit attacked
Event.Attack.LandedA basic attack hitsThe unit attacked
Event.Damage.DealtA hit of the champion has taken health or shieldThe unit damaged
Event.Damage.TakenA hit has taken health or shield from the championThe attacker
Event.KillA unit has died by the champion's handThe unit killed
Event.CrowdControl.AppliedOne of the champion's abilities has put crowd control on a unitThe unit

Your own code can send more with UAbilitySystemBlueprintLibrary::SendGameplayEventToActor. Event.Ability.Cast is taken: it is the cast request itself.

Effects​

The Effects list applies Gameplay Effects besides the damage and the heal. Each entry has the effect class, who gets it (Units Hit or Caster), one Duration and one Magnitude per rank, and an optional Cue that stays on the unit while the effect lasts.

Effect classMagnitude
MobaStunEffect, MobaRootEffect, MobaSilenceEffect, MobaKnockUpEffect, MobaTauntEffectnot used; see Crowd control
MobaSlowEffectThe share of move speed it takes: 0.3 is 30%
MobaUnstoppableEffectnot used
MobaShieldEffectThe damage the shield absorbs
MobaAttackSpeedBuffEffect, MobaMoveSpeedBuffEffectThe share it adds: 0.15 is 15%
MobaStackingAttackSpeedEffectThe share each stack adds; up to five stacks, all lost when Duration passes with no new one
MobaDamageReductionEffectThe share taken off every hit: 0.3 is 30%
MobaGuardEffectThe share taken off the next hit, which uses it up
MobaVulnerabilityEffectThe share more damage the unit takes from the caster: 0.1 is 10%
MobaEmpowerEffectnot used: the caster's next attack within Duration is its passive's empowered attack
MobaMarkEffectnot used: the unit carries State.Marked, for the look of a recast's target
MobaStealthEffectnot used: the unit carries State.Stealthed, and in brush is hidden even from enemies in the same patch or with a ward there

Any Gameplay Effect of your own works too. It gets the entry's numbers as the set-by-caller magnitudes Data.Duration and Data.Magnitude.

A skillshot's effect can last longer the further the projectile flew: with a Far Duration, a unit hit within Near Distance of where the projectile left gets Duration, one hit at Far Distance or beyond gets Far Duration, and the time grows in a straight line between the two.

Targeting a kind of unit​

Target Unit Tags limits a Targeted ability to units with one of its tags, besides what Affects allows: Unit.Champion, Unit.Minion, Unit.Structure and Unit.Monster by the unit's kind, and Unit.Tower and Unit.Ward. Empty takes any unit. Teleport takes Unit.Minion, Unit.Tower and Unit.Ward. Cancelled Cooldown gives a channel that ends early a cooldown of its own, as Teleport's 60 s.

Ability ranks​

  • One point per level. The 18 points of levels 1 to 18 fill Q, W and E to rank 5 and R to rank 3.
  • Rank N of Q, W or E needs level 2N − 1. The ultimate's ranks open at levels 6, 11 and 16. An Ability Definition can set its own Rank Levels instead.
  • A rank 0 ability cannot be cast. A match starts with every ability at rank 0 and one point to spend.
  • Ctrl and the ability key, or a click on the glowing slot in the HUD, spends a point. The server checks the point and the level; the new rank arrives by replication.
  • A rank-up during a cooldown keeps that cooldown; the new rank's numbers apply from the next cast.
  • Points gained while dead can be spent at once.
  • A passive, a summoner spell and the basic attack are always rank 1.

The rank levels for the whole project are in Project Settings > Pioneer MOBA Framework > Match: Basic Ability Rank Levels (1, 3, 5, 7, 9) and Ultimate Rank Levels (6, 11, 16).

From code, AMobaPlayerState has GetAbilityRank(Slot), GetUnspentAbilityPoints(), CanRankUpAbility(Slot), RankUpAbility(Slot) and the delegate OnAbilityRanksChanged.

Descriptions​

An ability's Description is its tooltip text: a sentence or two on what it does, with its numbers written as tokens. For example:

Fires a bolt {Range} cm ahead that deals {Damage} physical damage and slows by {Percent1}% for {Duration1} s.

The HUD's tooltip fills the tokens in for the champion's rank and shows what scaling damage comes to now: "87 (60 +0.9 bonus AD)". While an ability point can go into the ability, each number the next rank changes reads "now → next". Numbers follow the player's culture.

TokenWhat it writes
{Damage}Base Damage with its scaling, "60 (+0.9 bonus AD)"; only a scaling, "40% AD"
{Heal}Base Heal, "90 (+15 per level)"
{DamageType}physical, magic or true
{Cooldown}, {Mana}, {ManaDrain}per rank
{Range}, {Radius}, {Width}, {MinRange}, {Angle}as the definition has them
{CastTime}, {ChannelDuration}, {CancelledCooldown}, {TickInterval}, {MaxChargeTime}, {RecastWindow}, {WallLength}, {WallLifetime}, {DashSpeed}, {ProjectileSpeed}the same
{TriggerCount}, {EmpoweredScale}a passive's count, and its empowered attack in percent, "140"
{ExecuteBelow}, {CasterHeal}, {FullChargeBonus}percents: "20", "8", "50"
{Duration1}, {Magnitude1}, {Percent1}the first effect's duration, magnitude, and magnitude in percent ("30" for a 0.3 slow); {Duration2} the second's, and so on
{FarDuration1}, {NearDistance1}, {FarDistance1}an effect whose duration grows with distance

A token the ability has no number for is a warning when the asset is saved, and the tooltip shows it as it is. From code, UMobaAbilityDescription::FormatDescription(Definition, Rank, Caster) writes the text; rank 0 shows every rank, "60/95/130".

A new kind of ability​

When no cast type fits, write the behaviour yourself and keep everything else: targeting, cost, cooldown, the cast time, interrupts and prediction stay in the base class.

  • In Blueprint: subclass MobaGameplayAbility and fill in its hooks. See Add an ability. The sample's Ice Wall, GA_Isolde_IceWall in /PioneerMOBA/Sample/Champions/Isolde, is one.
  • In C++: derive from UMobaGameplayAbility and override OnCastFired_Implementation. The base class gives you the aim (GetAim, GetAimDirection); HitUnits(FindUnitsInRadius(...)) and FinishCast() do the rest. UMobaAreaAbility is the example to read: about twenty lines.

A Blueprint or C++ ability of your own cannot change how it is aimed: the cast type of its definition decides the indicator and what the cast request carries.