Skip to main content

Walls

The stage walls (the HalfWidth of the stage) are more than limits. By default AFT plays them like Street Fighter 6:

  • a wall bounce sends a juggled fighter back from the wall, for a longer combo;
  • a wall splat sticks it to the wall for a moment, then it falls into a knockdown.

Each hit says which wall reaction it carries, and the Wall Rules of the battle rules play it. The Wall Rules are a pluggable class: the template ships a Guilty Gear style wall break example, and you can write your own wall system in Blueprint or C++. Everything runs inside the deterministic simulation, so walls are rollback safe online.

Set the wall reaction of a hit​

In the hit definition of an action (Fighter Editor > Hits):

FieldValues
WallReactionAuto (default): Bounce when the hit's reaction is WallBounce, else None. None: no wall reaction, the fighter slides down the wall. Bounce: wall bounce. Splat: wall splat.
CounterHit > WallReactionOverride on counter hit (Auto = same as a normal hit). For example a punish counter that wall splats.

The hit gives the defender a pending wall reaction:

  • the Wall Rules play it if the defender reaches a wall before landing;
  • each hit sets it, so a later hit replaces it;
  • it is cleared on landing or knockdown, and when the combo ends;
  • wall bounces are counted per combo.

The WallBounce reaction (GroundReaction or AirReaction) launches the defender toward the wall like Launch (AirLaunchVelocity), with the Hit Launch animation. The Wall Bounce reaction plays when it reaches the wall. A hit with the WallBounce reaction and WallReaction on Auto is all you need for a wall bounce move.

Animations and effects​

AssetUse
AFT.Action.Hit.WallBounce slotBouncing off the wall.
AFT.Action.Hit.WallSplat slotStuck to the wall. Falls back to Hit.WallBounce, then Hit.Air.
AFT.Cue.Wall.Bounce cueA fighter bounces off the wall (impact, dust, camera shake).
AFT.Cue.Wall.Splat cueA fighter sticks to the wall.
AFT.Cue.Wall.Break cueThe wall breaks (wall break rules).

Add the cues to your cue set. The simulation also emits the Wall Bounce, Wall Splat and Wall Break events: the battle presentation plays their cue, and UAFTBattleSubsystem::OnSimEvent broadcasts them to Blueprint, for example to play a stage transition on a wall break.

Default rules (Street Fighter 6)​

Battle Rules > Wall > Wall Rules holds an instanced object: pick its class, then edit its settings in place. The default is AFT Wall Rules (SF6 Bounce) (UAFTWallRules). Existing battle rules assets get it automatically.

Wall bounce​

A juggled fighter with a pending Bounce that hits a wall bounces back toward the attacker, once per combo:

SettingDefaultDescription
MaxBouncesPerCombo1Wall bounces allowed in one combo (Street Fighter 6: one). 0 disables the bounce.
MinImpactSpeed2Slower impacts don't bounce (cm per frame).
BounceSpeedPercent45Speed back from the wall, percent of the impact speed.
MinBounceSpeed3Speed back from the wall at least (cm per frame).
BounceUpSpeed10Upward speed after the bounce at least (cm per frame): the juggle window.
BounceHitStop8Hit stop of the impact.
BounceHitStun60Hit stun after the bounce at least: the fighter can't recover before landing.

Wall splat​

A fighter with a pending Splat that hits a wall sticks to it, back to the wall, then falls into a knockdown: a combo opportunity. A Splat hit on a grounded defender close to the wall slams it into the wall at once (the Drive Impact in the corner of Street Fighter 6).

SettingDefaultDescription
SplatFrames30Frames stuck on the wall.
SplatHitStop10Hit stop of the impact.
SplatMinHeight80Height on the wall at least (cm): a grounded fighter is slammed up the wall and slides down.
SplatWallDistance80A Splat hit on a grounded defender this close to the wall (cm) splats it at once.
BounceCue, SplatCueNoneCues of the bounce and the splat (None: AFT.Cue.Wall.Bounce / AFT.Cue.Wall.Splat).

Without a pending reaction (or after the last allowed bounce), the wall stops the horizontal motion and the fighter slides down the wall.

Guilty Gear wall break​

AFT Wall Rules (Guilty Gear Wall Break) (UAFTWallRules_WallBreak) is a complete C++ example built on the default rules: wall bounces and splats keep working.

  1. Every hit on a defender within WallDistance of the wall damages the wall: WallDamagePerHit plus WallDamagePercent of the hit damage.
  2. When the wall damage reaches WallHealth, the wall gives: the defender sticks to it for StickFrames.
  3. The next hit on the stuck defender breaks the wall:
    • a Wall Break event and cue;
    • the fight freezes for BreakFreezeFrames (the stage transition);
    • both fighters start again around the stage center, BreakDistance apart, with the defender knocked down, on the side of the broken wall;
    • the camera is centered and the projectiles are removed;
    • the attacker gets AttackerMeterBonus meter (the positive bonus of Guilty Gear).
  4. The wall heals when the combo ends.
SettingDefaultDescription
WallHealth3000Wall damage before it gives.
WallDistance150Hits on a defender this close to the wall (cm) damage it.
WallDamagePerHit150Wall damage of every hit on a defender close to the wall...
WallDamagePercent50...plus this percent of the hit damage.
StickFrames45Frames the defender stays stuck to the giving wall: the window for the breaking hit.
BreakFreezeFrames60Fight freeze during the break.
BreakDistance300Distance between the fighters after the break (cm).
AttackerMeterBonus2500Meter given to the attacker.
BreakCueNoneCue of the break (None: AFT.Cue.Wall.Break).

It keeps its state in the wall memory: fighter memory 0 is the wall damage, fighter memory 1 says the wall is giving, and match memory 0 counts the broken walls (for example to pick the next stage section).

Custom wall rules​

The simulation calls the Wall Rules on three events:

EventWhen
Wall ContactA fighter in hit stun moves into a wall, once per impact (after the stage limits are applied).
HitA hit landed, at any distance (Is Cornered tells whether the defender is close to the wall it is pushed toward).
Combo EndThe combo received by a fighter is over: back to neutral, or wake up.

Blueprint​

  1. Create a Blueprint class whose parent is AFT Wall Rules (SF6 Bounce) or AFT Wall Rules (Guilty Gear Wall Break).
  2. Add the settings of your rules as variables and tick Instance Editable: they are edited in the battle rules, with the settings of the parent class.
  3. Override On Wall Contact, On Hit and / or On Combo End (My Blueprint > Functions > Override). Each receives a context (UAFTWallBlueprintContext), valid during the event only.
  4. Pick the class in Battle Rules > Wall > Wall Rules and set its variables.

Call Run Default in an event to play the parent class behavior and add to it, instead of replacing it.

The template has an example, /AFT/Data/WallRules/BP_AFT_WallRules_CornerMeter: its On Hit calls Run Default (the SF6 bounce and splat), then, when Is Cornered, gives the attacker Meter Bonus (500 by default) with Add Meter.

Context functionDescription
Get Event, Get Fighter, Get Attacker, Get Fighter DataThe event, the fighter at the wall / hit / whose combo ended, its last attacker (-1 when none), the fighter data of a fighter.
Get Wall Side, Get Impact Speed, Get Distance To WallWall side (-1 left, 1 right), contact speed toward the wall (AFT Fixed, cm per frame), distance between a fighter and a wall (AFT Fixed, cm).
Get Hit, Get Hit Damage, Is Counter Hit, Is Cornered, Was StuckHit events: the hit definition, its damage, counter hit, defender close to the wall, defender stuck on the wall before this hit.
Get Pending Reaction, Get Wall Bounces, Get Combo Count, Is KOState of the fighter.
Random Range, Random ChanceDeterministic random numbers (the simulation random).
Get / Set Fighter Memory, Get / Set Match Memory4 integers per fighter and 4 for the match, saved and restored with the simulation.
Bounce, StickWall bounce (minimum speeds in cm per frame: SF6 uses 3 back and 10 up), wall splat / stick (minimum height in cm: SF6 uses 80; works on Hit events too, for a Guilty Gear wall stick).
Set Velocity, Set Pending Reaction, Add Hit Stun, Freeze, Add MeterChange the fight (velocity in cm per frame, X away from the wall).
Emit EventA presentation event with a cue tag (played by the battle presentation, broadcast to Blueprint).
Reset PositionsStage transition: both fighters around the center, at a distance (cm), the fighter optionally knocked down.
Run DefaultThe parent class behavior for this event.

Distances and speeds are AFT Fixed values in cm (cm per frame for speeds): build them with the deterministic AFT Fixed nodes (Fixed From Int, + - * /, < >...), never from Float math, which can differ between two machines. The Instance Editable variables of your class are added to the content hash: online peers with different values refuse to play. The events are const functions: they can't change the variables, keep state in the memory below.

C++​

Derive from UAFTWallRules (or UAFTWallRules_WallBreak):

  • override NativeWallContact, NativeHit and / or NativeComboEnd. Blueprint subclasses of your class keep working and reach them with Run Default;
  • or override OnWallContact, OnHit and OnComboEnd for full control (they call the Blueprint event, else the native version);
  • override HashSettings to add your settings to the content hash: online peers with different wall rules refuse to play.

FAFTWallContext gives the same reads and orders as the Blueprint context. Distances and speeds are fixed point: 1000 = 1 cm (per frame for speeds). UAFTWallRules_WallBreak in AFTWallRules.cpp is a short example to start from.

Determinism rules​

The Wall Rules run inside the rollback simulation, like the CPU brains:

  • the rules object is shared, read-only data: never store state in it;
  • keep what must be remembered in the fighter and match memory, saved and restored with the simulation;
  • draw random numbers with the context's Random only;
  • never read actors, time or anything outside the context.

See Writing Deterministic Code.

Current limits​

  • The GroundBounce reaction only plays its animation: there is no ground bounce physics yet.
  • No move of Quinn uses a wall bounce or a wall splat yet.
  • The CPU does not plan its combos around wall bounces.