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.
| Section | Field | What it does |
|---|---|---|
| Ability | Display Name, Icon | What the HUD shows |
| Description | The tooltip, with {Tokens} for its numbers; see Descriptions | |
| Ability Tag | Identifies the ability, for example Ability.Varra.Q | |
| Slot | Q, W, E, R, or Passive. A summoner spell goes on D | |
| Ability Class | The class that runs it: the class of its cast type, or a Blueprint ability of your own | |
| Max Rank | 5 for a basic ability, 3 for an ultimate, 1 for a passive or a summoner spell | |
| Rank Levels | The champion level each rank needs. Empty uses the Match settings: 1, 3, 5, 7, 9, and 6, 11, 16 for the ultimate | |
| Casting | Cast Type | How it is aimed and fired; see Cast types |
| Default Cast Mode | What the key does until the player chooses; see Cast modes | |
| Cast Time | Seconds between the cast and the ability firing. The caster stands still for that long | |
| Wait For Server | Off: the caster's own game predicts the cast. On: it shows nothing of the cast until the server has confirmed it | |
| Walk Into Range | A cast on something out of range walks into range first | |
| Max Duration | The longest the ability stays active after it has fired (10 s by default) | |
| Cast Clip, Clip Effect Time, Charge Clip | The animation the caster plays; see Effects and animation | |
| Targeting | Range, Width, Radius, Angle and the rest | The shape of the ability. Which ones a cast type reads is in the table below |
| Affects | Who it can be cast on and hits: Enemies, Allies, Allies And Self, or Self | |
| Max Targets | The most units an area hits, nearest to its center first. 0 hits all | |
| Target Unit Tags | Limits a targeted ability to units with one of these tags; see Targeting a kind of unit | |
| Only Champions | Areas, lines and cones pass minions, monsters and structures over, and a skillshot flies through them | |
| Ranks | Cooldown, Mana Cost | One value per rank, rank 1 first |
| Base Damage | Damage per rank before scaling, crits and resists | |
| Scaling Attribute, Scaling Ratio | Adds that share of the caster's stat to the damage: 0.7 of Bonus Attack Damage adds 70% of it | |
| Base Heal, Heal Per Level | Health each unit hit gets back, per rank, and more for each level of the caster | |
| Effects | Damage Type | Physical, Magic or True |
| Can Crit | Abilities do not crit unless this is on | |
| Effects | Gameplay Effects besides the damage; see Effects | |
| Cues | The Gameplay Cues of the cast, the projectile's flight, each hit and the area; see Effects and animation | |
| Bot | Usage and the rest | When 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 Type | Ability Class | What it does | Fields it reads |
|---|---|---|---|
| Skillshot (Line) | MobaSkillshotAbility | A projectile flies the full Range along the aim. It stops at the first enemy, or with Pierces Units hits every one on the line | Range, Width, Projectile Speed, Pierces Units, Projectile Class |
| Targeted | MobaTargetedAbility | Cast 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 caster | Range, Affects, Projectile Speed, Homing Projectile Class |
| AoE | MobaAreaAbility | Hits every unit whose body reaches into a circle at the aim point. With Range 0 the circle is around the caster | Range, Radius, Affects, Max Targets |
| Cone | MobaConeAbility | Hits every unit whose center is within Range of the caster and within the Angle around the aim direction | Range, Angle |
| Dash | MobaDashAbility | Moves 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 lands | Range, Dash Speed, Width, Radius |
| Blink | MobaBlinkAbility | Moves 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 point | Range, Radius |
| Channel | MobaChannelAbility | The 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 caster | Range, Radius, Channel Duration, Tick Interval |
| Toggle | MobaToggleAbility | Its 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 Interval | Mana Drain, Tick Interval, Radius |
| Charged | MobaChargedAbility | The key press starts the charge; the reach grows from Min Range to Range over Max Charge Time; the release hits a line of that reach | Min Range, Range, Width, Max Charge Time, Full Charge Hold Time |
| AoE, as a wall | MobaWallAbility | Raises 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 look | Range, Wall Length, Width, Wall Lifetime, Wall Class |
| Passive | MobaPassiveAbility | No 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 attack | Passive 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.InBrushas the champion leaves brush orState.Stealthedas 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 tag | When | The event's target |
|---|---|---|
Event.Attack.Started | A basic attack begins its wind-up | The unit attacked |
Event.Attack.Landed | A basic attack hits | The unit attacked |
Event.Damage.Dealt | A hit of the champion has taken health or shield | The unit damaged |
Event.Damage.Taken | A hit has taken health or shield from the champion | The attacker |
Event.Kill | A unit has died by the champion's hand | The unit killed |
Event.CrowdControl.Applied | One of the champion's abilities has put crowd control on a unit | The 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 class | Magnitude |
|---|---|
MobaStunEffect, MobaRootEffect, MobaSilenceEffect, MobaKnockUpEffect, MobaTauntEffect | not used; see Crowd control |
MobaSlowEffect | The share of move speed it takes: 0.3 is 30% |
MobaUnstoppableEffect | not used |
MobaShieldEffect | The damage the shield absorbs |
MobaAttackSpeedBuffEffect, MobaMoveSpeedBuffEffect | The share it adds: 0.15 is 15% |
MobaStackingAttackSpeedEffect | The share each stack adds; up to five stacks, all lost when Duration passes with no new one |
MobaDamageReductionEffect | The share taken off every hit: 0.3 is 30% |
MobaGuardEffect | The share taken off the next hit, which uses it up |
MobaVulnerabilityEffect | The share more damage the unit takes from the caster: 0.1 is 10% |
MobaEmpowerEffect | not used: the caster's next attack within Duration is its passive's empowered attack |
MobaMarkEffect | not used: the unit carries State.Marked, for the look of a recast's target |
MobaStealthEffect | not 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.
| Token | What 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
MobaGameplayAbilityand fill in its hooks. See Add an ability. The sample's Ice Wall,GA_Isolde_IceWallin/PioneerMOBA/Sample/Champions/Isolde, is one. - In C++: derive from
UMobaGameplayAbilityand overrideOnCastFired_Implementation. The base class gives you the aim (GetAim,GetAimDirection);HitUnits(FindUnitsInRadius(...))andFinishCast()do the rest.UMobaAreaAbilityis 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.