Keyboard shortcuts

Press ← or → to navigate between chapters

Press ? to show this help

Press Esc to hide this help

data/abilities/

An ability: something an entity does, such as a sword swing, a rifle shot or a boar’s charge. Its root is a chain of nodes (in order, in parallel, by condition, repeated) over engine elements: waits, animation plays, telegraphs, area hits, sweeps, traces, dashes, projectiles, effects and cues. An ability is granted by an archetype, an item kind or an effect; a player activates it with a bound input action, and an AI behaviour or task requests it. Activation checks tags, cooldowns, charges, costs and the target. Cooldowns and costs are effects.

Registrymanifold:ability
Filesdata/abilities/*.ron, *.update.ron, *.final.ron
Sidesboth: the server and every client load it, and the handshake’s data hash covers it
Readsmanifold:predicate, manifold:stat, manifold:gameplay-config, manifold:presentation-field, manifold:effect
ContractGameplay framework, data stage

Entry

A record, written Ability(..); the name before the parentheses is optional.

FieldTypeRequiredDefaultDescription
idstringyesThe ability’s key, <mod-id>:<name>.
tagslist of stringnononeTags describing the ability, which other abilities’ cancels and removal triggers test.
requiredTagQuery or Nonenono requirementThe activator’s tags must match.
blockedTagQuery or Nonenonever blockedActivation fails while the activator’s tags match.
cancelsTagQuery or NonenononeStarting it cancels the activator’s running abilities whose tags match.
blocks_while_activeTagQuery or NonenononeWhile it runs, the activator cannot start abilities whose tags match.
owned_tagslist of stringnononeTags the activator holds while it runs (manifold:state.casting).
costslist of stringnononeInstant effects that only change resources, paid at Commit (on activation without one); activation fails when they cannot be afforded.
cooldownstring or NonenononeThe cooldown effect, applied at Commit (on activation without one); activation fails while it is active.
chargesu16 or Noneno1Uses before the cooldown blocks: the cooldown (an Aggregate effect with expire: One) blocks once it holds this many stacks. Needs a cooldown when above 1.
targetingTargetingnoNoneWhat it aims at.
interruptInterruptnonothingWhat interrupts it.
predictPredictPolicy or NonenoNoneWhat the activating client predicts.
inputstring or NonenononeFor players: the input action whose press activates it (declared by the game’s input declarations). An action no declaration names fails the data stage (DATA010).
passivelist of GrantedModifiernononeConstant stat modifiers the holder has while the ability is granted.
rootAbilityNodeyesThe chain it runs (at most 256 nodes, 8 deep).
uiAbilityUi or NonenononePlayer-facing text.

Example

From game/flagship-game/data/abilities/m14.ron:

Ability(
    id: "flagship-game:m14_reload",
    tags: ["flagship-game:ability.reload"],
    input: Some("flagship-game:reload"),
    owned_tags: ["flagship-game:state.reloading"],
    blocked: (any: ["flagship-game:state.reloading"]),
    predict: Presentation,
    root: OneShot(play: "rifle_reload", stop_on_end: true),
    ui: Some((name: Some("flagship-game.ability.m14_reload.name"))),
)

Types

TagQuery

A tag query: which tag sets match. Every part written must hold; () matches everything.

A record: TagQuery(..) or (..).

FieldTypeRequiredDefaultDescription
alllist of tag-matchnononeEvery one of these tags.
anylist of tag-matchnononeAt least one of these tags.
nonelist of tag-matchnononeNone of these tags.
orlist of TagQuerynononeAt least one of these queries.
notTagQuerynononeThis query must not match.

Targeting

What an ability aims at.

VariantWrittenDescription
NoneNoneNothing.
AimAimThe activator’s view.
TargetTarget(range: .., relation: .., requires_sight: ..)An entity, checked at activation.
PointPointA point the activating input supplies.

Target fields:

FieldTypeRequiredDefaultDescription
rangef32yesThe farthest target, in metres (players get half a metre more).
relationrelation-masknoanyThe relations a target may have to the activator.
requires_sightboolnofalseWhether the target must be in line of sight.

Interrupt

What interrupts a running ability.

A record: Interrupt(..) or (..).

FieldTypeRequiredDefaultDescription
on_tagsTagQuery or NonenoneverInterrupted when the activator’s tags match.
on_damage_fractionf32 or NonenoneverInterrupted once the activator has taken damage of at least this fraction of its maximum health since the ability started.
before_commit_onlyboolnofalseWhether interrupts apply only before Commit.

PredictPolicy

What the activating client predicts.

VariantWrittenDescription
NoneNoneNothing: the client waits for the server.
PresentationPresentationOne-shot plays and presentation counters.
LocalLocalTags, cooldowns, costs and dashes too. The cooldown’s duration must be constant and each cost must change a predicted stat by a constant.

GrantedModifier

A stat modifier granted while its source lasts: an item while equipped, or an ability while granted.

A record: GrantedModifier(..) or (..).

FieldTypeRequiredDefaultDescription
statstringyesThe stat (manifold:stat key). Not a resource: modify its maximum.
opModOpyesHow it combines.
valuenumberyesThe amount: a constant. A value that scales with its holder is a derived stat.
scopecondition or Nonenoalways countsA condition in the damage context: the modifier counts only when the stat is read while a hit is resolved and the condition holds (“+100 against undead”).

ModOp

How a stat modifier combines with the stat’s other modifiers. A stat’s value is (base + Σ Flat) × (1 + Σ Increased) × Π (1 + More) + Σ Final, then the last Override, then the stat’s clamp and rounding.

VariantWrittenDescription
FlatFlatAdded to the base.
IncreasedIncreasedSummed with the other Increased modifiers, then multiplies.
MoreMoreMultiplies on its own (0.5 is +50%, -0.5 is half).
FinalFinalAdded after the multipliers.
OverrideOverrideReplaces the value; the last applied wins.

AbilityNode

A node of an ability’s chain: a structure node, or an element. An element with one required value may be written positionally (Wait("0.2s"), EmitCue("x:cue.snort"), Noise(48.0), WaitWindow("swing")). A node succeeds or fails; a failure ends the chain unless a structure node handles it.

VariantWrittenDescription
SerialSerial([AbilityNode])Runs the nodes in order; fails when one fails.
ParallelParallel(until: .., children: ..)Runs up to four nodes at once.
SelectSelect([(condition, AbilityNode)])Runs the first branch whose condition holds: [(condition, node), ..], conditions in the ability context (which can test the outcome bits, AbilityOutcome(HIT_ANY)).
RepeatRepeat(count: .., until: .., body: ..)Runs body repeatedly. A repeat without a count must wait.
NextNext(string)Ends the chain and starts the named ability with the same target, point and input in the same tick. It must be last.
CommitCommitPays the costs and starts the cooldown; interrupts with before_commit_only stop applying.
WaitWait(ticks: ..)Waits.
OneShotOneShot(play: .., section: .., rate: .., stop_on_end: ..)Plays an animation once.
BumpCounterBumpCounter(string)Bumps a counter presentation field (manifold:presentation-field key of kind Counter).
SetPresentationSetPresentation(field: .., value: ..)Sets a presentation field until the ability ends.
FaceFace(to: .., turn_rate_deg_per_s: ..)Turns the caster.
TelegraphTelegraph(shape: .., anchor: .., lock: .., ticks: .., cue: ..)Shows a shape on the ground that a later AreaHit resolves against.
AreaHitAreaHit(shape: .., hit: ..)Hits everything in an area once.
SweepVolumeSweepVolume(shape: .., ticks: .., timeout: .., hit: ..)Hits what a volume sweeps through over some ticks, each target once.
TraceTrace(origin: .., range: .., shape: .., hit: ..)A lag-compensated trace along the view: the nearest hit.
DashDash(speed: .., ticks: .., direction: .., stop: ..)Moves the caster at a speed for some ticks.
ApplyEffectApplyEffect(to: .., effect: .., level: ..)Applies an effect to the caster or its target.
EmitCueEmitCue(cue: .., anchor: ..)Plays a cue.
NoiseNoise(loudness: ..)Makes a noise AI hearing perceives.
SetOutcomeSetOutcome(OutcomeBit)Sets an outcome bit Select branches test.
LeapLeap(speed: .., vertical: .., ticks: .., direction: .., stop: ..)Jumps the caster: a dash with a vertical push at its start.
WaitTagsWaitTags(query: .., timeout: ..)Waits until the caster’s tags match.
WaitWindowWaitWindow(window: .., timeout: ..)Waits for the caster’s named animation window to open.
SpawnProjectileSpawnProjectile(archetype: .., speed: .., gravity: .., lifetime: .., radius: .., hit: ..)Fires a projectile from the caster’s eye along its view (or toward its target, for an AI).

Parallel fields:

FieldTypeRequiredDefaultDescription
untilUntilnoAllWhen it ends.
childrenlist of AbilityNodeyesThe nodes.

Repeat fields:

FieldTypeRequiredDefaultDescription
countnumbernountil untilHow many times.
untilUntil or NonenononeStops when its input action is released (Released, a held channel), or on the body’s result (All, Any).
bodyAbilityNodeyesThe repeated node.

Wait fields:

FieldTypeRequiredDefaultDescription
ticksdurationyesHow long.

OneShot fields:

FieldTypeRequiredDefaultDescription
playstringyesThe play’s name in the caster’s animation graph.
sectionstring or Nonenothe whole playA section of the play.
ratef32no1The playback rate.
stop_on_endboolnofalseWhether the node waits for the play to end, and stops it if the ability ends first.

SetPresentation fields:

FieldTypeRequiredDefaultDescription
fieldstringyesThe field (a manifold:presentation-field key, not a counter).
valuef32yesThe value.

Face fields:

FieldTypeRequiredDefaultDescription
toFaceTonoTargetWhat it faces.
turn_rate_deg_per_sf32no0A turn rate in degrees per second, carried on the turn request. The caster turns at its locomotion profile’s rate, which this cannot raise.

Telegraph fields:

FieldTypeRequiredDefaultDescription
shapeShapeyesThe shape.
anchorTelegraphAnchornoCasterFacingWhere it is placed.
lockLocknoOnStartWhether it stays where it started or follows its anchor.
ticksdurationyesHow long it shows before it resolves.
cuestring or NonenononeA persistent cue while it shows.

AreaHit fields:

FieldTypeRequiredDefaultDescription
shapeHitAreayesThe area: a shape, or Telegraph(i) for the ability’s i-th telegraph.
hitHityesWhat a hit does.

SweepVolume fields:

FieldTypeRequiredDefaultDescription
shapeShapenothe blade (windowed sweeps only)The volume. A windowed sweep without one sweeps the held item’s blade.
tickssweep-ticksyesHow long it sweeps, or Window("<name>") while that animation window is open.
timeoutdurationno2 secondsHow long a windowed sweep waits for its window.
hitHityesWhat a hit does.

Trace fields:

FieldTypeRequiredDefaultDescription
originTraceOriginnoEyesWhere it starts.
rangef32yesIts length, in metres.
shapeTraceShapenoRayA ray or a sphere.
hitHityesWhat a hit does.

Dash fields:

FieldTypeRequiredDefaultDescription
speedf32yesThe speed, m/s.
ticksdurationyesHow long.
directionDashDirectionnoLockedWhich way.
stoplist of DashStopnonothingWhat ends it early.

ApplyEffect fields:

FieldTypeRequiredDefaultDescription
tosubjectnoThisThis or Target.
effectstringyesThe effect (manifold:effect key).
levelnumbernothe ability’sThe effect’s level, a number in the ability context.

EmitCue fields:

FieldTypeRequiredDefaultDescription
cuestringyesThe cue (manifold:cue key).
anchorCueAtnoCasterWhere it plays.

Noise fields:

FieldTypeRequiredDefaultDescription
loudnessf32yesHow loud: the distance in blocks at which it is just audible (a rifle shot is about 48).

Leap fields:

FieldTypeRequiredDefaultDescription
speedf32yesThe horizontal speed, m/s.
verticalf32yesThe vertical speed, m/s.
ticksdurationyesHow long.
directionDashDirectionnoLockedWhich way.
stoplist of DashStopnonothingWhat ends it early.

WaitTags fields:

FieldTypeRequiredDefaultDescription
queryTagQueryyesThe tags (not empty).
timeoutduration or Nonenono limitThe longest wait; the node fails after it.

WaitWindow fields:

FieldTypeRequiredDefaultDescription
windowstringyesThe window’s name.
timeoutdurationno2 secondsThe longest wait; the node fails after it.

SpawnProjectile fields:

FieldTypeRequiredDefaultDescription
archetypestringyesThe projectile’s archetype (manifold:archetype key); it should not be saved.
speedf32yesThe launch speed, m/s.
gravityf32no0Gravity, m/s².
lifetimedurationyesHow long it flies before it despawns.
radiusf32no0Its radius, in metres.
hitHityesWhat a hit does; it stops at its first hit unless the hit names max_targets.

Until

When a Parallel ends, or a Repeat stops.

VariantWrittenDescription
AllAllEvery child succeeded (fails as soon as one fails).
AnyAnyOne child succeeded (fails when all failed).
FirstFirst(u8)Child i finished; its result is the node’s (Parallel only).
ReleasedReleasedThe ability’s input action was released: a held channel.

FaceTo

What Face turns to.

VariantWrittenDescription
TargetTargetThe ability’s target.
PointPointThe ability’s point.

Shape

A hit area’s shape, on the ground in front of the caster.

VariantWrittenDescription
CircleCircle(radius: ..)A circle.
RectRect(width: .., length: ..)A rectangle ahead.
BoxBox(half: ..)A box.
ConeCone(radius: .., angle_deg: ..)A cone ahead.

Circle fields:

FieldTypeRequiredDefaultDescription
radiusf32yesIts radius, in metres.

Rect fields:

FieldTypeRequiredDefaultDescription
widthf32yesIts width, in metres.
lengthf32yesIts length ahead, in metres.

Box fields:

FieldTypeRequiredDefaultDescription
half(f32, f32, f32)yesIts half extents, (x, y, z) in metres.

Cone fields:

FieldTypeRequiredDefaultDescription
radiusf32yesIts length, in metres.
angle_degf32yesIts full angle, in degrees.

TelegraphAnchor

Where a telegraph is placed.

VariantWrittenDescription
CasterFacingCasterFacingAt the caster, facing its way.
CasterCasterCentred on the caster.
TargetTargetCentred on the target.

Lock

Whether a telegraph moves.

VariantWrittenDescription
OnStartOnStartPlaced once, when it starts.
FollowFollowFollows its anchor.

HitArea

An AreaHit’s area.

VariantWrittenDescription
CircleCircle(radius: ..)A circle.
RectRect(width: .., length: ..)A rectangle ahead.
BoxBox(half: ..)A box.
ConeCone(radius: .., angle_deg: ..)A cone ahead.
TelegraphTelegraph(u8)Exactly the shape and pose of the ability’s i-th telegraph (from 0), at its resolve tick.

Circle fields:

FieldTypeRequiredDefaultDescription
radiusf32yesIts radius, in metres.

Rect fields:

FieldTypeRequiredDefaultDescription
widthf32yesIts width, in metres.
lengthf32yesIts length ahead, in metres.

Box fields:

FieldTypeRequiredDefaultDescription
half(f32, f32, f32)yesIts half extents, (x, y, z) in metres.

Cone fields:

FieldTypeRequiredDefaultDescription
radiusf32yesIts length, in metres.
angle_degf32yesIts full angle, in degrees.

Hit

What a hit does.

A record: Hit(..) or (..).

FieldTypeRequiredDefaultDescription
damageDamageSpec or NonenononeDamage dealt to each target.
effectslist of stringnononeEffects applied to each target (manifold:effect keys).
filterrelation-masknoAnyThe relations a target may have to the caster, or Any.
tagsTagQuery or Nonenoany targetA target’s tags must match.
max_targetsu8nono limit (one for traces and projectiles)The most targets, at least 1. A trace hits one.
cuestring or NonenononeA cue played at each hit.

DamageSpec

Damage to deal: an effect’s damage, or an ability hit’s.

A record: DamageSpec(..) or (..).

FieldTypeRequiredDefaultDescription
damage_typestringyesThe damage type (manifold:damage-type key).
basenumberyesThe base amount, before the formula, a number in the use site’s context.
elementstringnothe damage type’s elementThe element (manifold:element key).
context_tagslist of stringnononeTags the hit carries for hooks and conditions (ContextTags(..)).
can_critboolnotrueWhether the formula may roll a critical hit.

TraceOrigin

Where a trace starts.

VariantWrittenDescription
EyesEyesThe caster’s eyes.
CameraCameraThe player’s camera.

TraceShape

A trace’s shape.

VariantWrittenDescription
RayRayA thin ray.
SphereSphere(radius: ..)A sphere swept along the trace.

Sphere fields:

FieldTypeRequiredDefaultDescription
radiusf32yesIts radius, in metres.

DashDirection

Which way a dash or leap goes.

VariantWrittenDescription
LockedLockedThe way the caster faced when it started.
TargetTargetToward the target.

DashStop

What ends a dash or leap early.

VariantWrittenDescription
CollisionCollisionRunning into a wall (sets HIT_WALL).
HitTargetHitTargetHitting a target.
TagMatchTagMatchA tag match.

CueAt

Where EmitCue plays.

VariantWrittenDescription
CasterCasterAt the caster.
TargetTargetAt the target.

OutcomeBit

An ability outcome bit.

VariantWrittenDescription
HIT_ANYHIT_ANYSomething was hit.
HIT_WALLHIT_WALLA wall was hit.
HIT_NONEHIT_NONENothing was hit.
INTERRUPTEDINTERRUPTEDThe ability was interrupted.

AbilityUi

An ability’s player-facing text, as message keys.

A record: AbilityUi(..) or (..).

FieldTypeRequiredDefaultDescription
namestring or NonenononeThe name’s message key.
descriptionstring or NonenononeThe description’s message key.
iconstring or NonenononeAn icon asset.

Value forms used here: condition, duration, number, relation-mask, subject, sweep-ticks, tag-match.