Reaction Set Editor

Documentation Unreal Engine AI Reactions Debugging

Lay an enemy's answers out as cards, draw an arrow from each rule to the reactions it may pick, and watch a live enemy answer.


One canvas for a whole defensive kit: a card for each event the enemy answers, a card for each answer, and an arrow saying which rule may pick which reaction.

Set it up

60 seconds
  1. 1

    Open a Reaction Set on its canvas

    Double-click the DA_ReactionSet_Grunt you created on the Reaction System page and it opens as cards, under a tab called Triggers and Reactions.
    DA_ReactionSet_Grunt
    Double-click to open
    This is the canvas that opens, not a details panel: a blue Trigger card for each event the enemy answers, wired to the purple Reaction cards it may pick.
    TRIGGERGuardFrontal
    on SEC.Stimulus.DamageTakenpriority 10answers with 2limited to SEC.Reaction1 condition(s)
    Out
    REACTIONBlock
    runs Ability: GA_SEC_Reactionpriority 1, weight 1.00in SEC.Reactioncooldown 3.0s
    In
    TRIGGERGuardSides
    on SEC.Stimulus.AttackTelegraphedpriority 5answers with 1limited to SEC.Reaction20% of the time1 condition(s)
    Out
    REACTIONDodge
    runs Ability: GA_SEC_DodgeBackpriority 0, weight 1.00in SEC.Reactioncooldown 15.0s
    In
    The Reaction Set editor's own canvas: a Trigger card's Out pin wired to every Reaction its rule may pick. GuardFrontal can answer with Block or Dodge; GuardSides only ever reaches for Dodge.
  2. 2

    Add the answer

    Right-click the empty canvas and choose Add Reaction. A card lands where you clicked, named Reaction_1, already carrying a Gameplay Ability execution method.
    Select it, press F2, and rename it Parry. In the panel on the right, set Ability Class to GA_SEC_MontageAbility and set the Montage on the payload that appears under it.
    DA_ReactionSet_Grunt
    Execution
    Ability ClassNone
    Montage
    None
    One card selected, one reaction in the panel.
  3. 3

    Add the rule

    Right-click the canvas again and choose Add Trigger. That card arrives as Trigger_1. Rename it ParryFrontal and set its On Stimulus to SEC.Stimulus.AttackTelegraphed.
  4. 4

    Draw the arrow

    Drag from the pin on the right of the trigger card to the pin on the left of the Parry card. The arrow reads: when an attack winds up nearby, answer with Parry.
  5. 5

    Press Play and watch it answer

    The Watching picker above the canvas lists every enemy running this Reaction Set and latches onto the first one it finds. The line beside it reads Running Parry the moment the enemy answers, and Nothing answering right now the rest of the time.
An attack that does not announce itself reaches no rule, so the canvas has nothing to report however the cards are wired. Add the SEC Attack Telegraph notify to the attacker's montage where the wind-up starts; without it the picker still names an enemy while the line beside it never leaves Nothing answering right now. The Watching picker fills from AI whose active Reaction Set is this asset, which they reach through a runtime override, an equipped weapon, their Enemy AI Config, or Default Reaction Set on their SEC Reaction Set Component, so a picker stuck on None while the game runs means none of those routes landed on this asset. See Attack Telegraphs and Reaction System.

Reading a Card

The canvas holds two families of card, and everything on either comes from the entry behind it.
A blue Trigger card is one rule, the event it answers and the conditions on it:
RowShows
TitleThe rule's Rule ID.
Event lineThe On Stimulus tag it answers, or answers nothing yet when none is set.
PriorityIts Rule Priority.
Answers withHow many arrows leave the card.
Limited toIts Reaction Category, when it has one.
ChanceHow often it fires, when Chance is below 1.
IntervalIts Min Interval in seconds, when one is set.
ConditionsHow many gates sit on it.
A purple Reaction card is one answer, what it runs and how it scores:
RowShows
TitleThe reaction's Reaction ID.
RunsIts execution method by name, runs nothing yet when none is set, or (incomplete) when the method is missing a field it needs.
Priority, weightIts Priority and Selection Weight.
InIts Reaction Category, when it has one.
CooldownIts Cooldown Duration in seconds, when it is above 0.
Rows appear only when they have something to say, so a plain parry card stays short. Hover a card for the same figures as sentences, plus one line per arrow naming the reaction it points at and the multiplier that arrow carries.
A card greys out when Enabled is unticked. A warning triangle and a red border appear when something would stop the entry working, and hovering the triangle names what.
Selecting a card puts that entry alone in the panel on the right, so the whole rule is editable without hunting through an array:
Trigger
Enabled
Rule ID
ParryFrontal
On Stimulus
SEC.Stimulus.AttackTelegraphed
Require Context Tags
0 Gameplay Tags
Block Context Tags
1 Gameplay Tag
SEC.Attack.Unblockable
Conditions
1 Array element
Index [ 0 ]
Incoming Angle Gate
Incoming Angle Gate
Half Angle Degrees
60.0
Pass Without Direction
Invert
Answers
Reaction Links
2 Array elements
Reaction Category
SEC.Reaction.Defensive
Rule Priority
20
Chance
0.60
Min Interval
1.5

Adding and Removing

Right-click empty canvas and choose Add Trigger or Add Reaction. A card appears where you clicked and a matching entry is added to the asset. A fresh reaction arrives with an ability execution method already on it, so it runs as soon as you pick an ability.
Right-click a card for Rename, Toggle Enabled and Delete. Toggle and delete apply to the whole selection, so switching a group of rules off is one action.
A new trigger takes the highest Rule Priority in the set plus ten, which puts it above the rules already there. Change that number to move it.
Deleting a reaction strips every arrow that pointed at it, so no rule is left naming a reaction the set does not hold.
Copy, cut, paste and duplicate work as they do in any Unreal graph. A copied reaction card gets a fresh ID and its own execution method, scorers and gates, so editing the copy leaves the card it came from alone. A copied trigger card gets a fresh ID, but its Conditions stay the same gate objects the original holds, so retuning a condition on the copy retunes it on the original too. Pick the gate's class again on the copy to give it a condition of its own. Right-click also offers Add Comment, which groups cards under a label and changes nothing about how the AI runs.
Copying a card from one Reaction Set and pasting into another carries only the name. An entry's settings live in the asset that holds it and cannot travel on the clipboard, so the pasted card arrives empty and says so in the message log. To reuse a tuned reaction across sets, copy its settings across in the details panel.

Wiring a Rule to a Reaction

Drag from the pin on the right of a trigger card to the pin on the left of a reaction card. That arrow is one entry in the rule's Reaction Links, seen from the other side.
One rule can answer with several reactions. Draw an arrow to each, and the usual priority and scoring on those reactions picks which of them runs.
Trigger
Reaction ID
Parry
Weight Multiplier
2.00
Leave Weight Multiplier at 1 and the reaction's own Selection Weight decides. A thicker, brighter arrow is a rule leaning harder on that answer.
Trigger cards have no incoming pin and reaction cards have no outgoing one, so an arrow between two rules, or between two reactions, cannot be drawn.

The two ways a rule names answers

Reaction Links names reactions one at a time, which is what the arrows write.
Reaction Category names a group instead, and every reaction carrying that category competes. No arrow appears for a category, because the rule names no reaction to draw one to.
Fill in both and the rule answers only with a reaction that appears in its links and carries that category. That narrows what a rule can do and never widens it.
An arrow from a rule with a category to a reaction outside that category reaches nothing, and the other arrows on that rule still answer. The rule falls silent only when every arrow it draws sits outside its category. The trigger card flags each such arrow and names both the reaction and the category. Clear the category, or give that reaction the category.

What the Cards Warn About

The canvas reports what a details panel cannot show you:
WarningWhat it means
Nothing reaches this reactionNo arrow points at it and it carries no Reaction Category, so only a Blueprint calling Execute Reaction by name can start it
This rule answers nothingThe rule has no On Stimulus tag, so no event matches it
Names neither a reaction nor a reaction categoryThe rule can never produce an answer, and the rule below it takes the event instead
Wired outside its categoryThe arrow and the category disagree, so that arrow reaches nothing
Chance is 0The rule never fires
No execution methodThe reaction has nothing to run
The execution method is missing dataA field it needs to run is still empty
This method takes the AI's brain overBehavior Tree Sequence replaces the brain for its duration, which a reaction cannot do. Pick a Gameplay Ability method.
This ID is used by more than one cardOnly the first card with that ID is ever selected
An unreachable reaction is the one worth reading twice. A reaction with no arrow and no category is dead unless something calls it by name, and nothing about the arrays tells you that.

Which Rule Is Asked First

Rule Priority on each trigger decides the order, highest first. Rules sharing a priority keep the order they sit in.
The array reorders itself to match, so reading the Trigger Rules array top to bottom is reading the order events are offered in.

Watching the AI Answer

Press Play and the picker above the canvas lists every enemy running this Reaction Set, latching onto the first one it finds. The line beside the picker names the reaction that enemy is running, or reports that nothing is answering right now.
The reaction the AI chose is the card you authored it on, so a rule that fired the wrong answer is one click from the setting that produced it.
Pick another entry from Watching to follow a different enemy mid-fight. If the enemy you are watching dies, or a role change moves it to a different Reaction Set, the canvas attaches to another one running this set, or falls back to None when there are none left.
Tuning weights, chances, intervals and gates while the game runs is safe. Adding, deleting or renaming a rule or a reaction mid-play is not, because a running AI holds a reference into the arrays. The editor warns you once per session in the message log when you do it, and the fix is to restart Play In Editor.

Debug it

The canvas follows one enemy at a time. For a record you can scroll back through:
SEC.Debug.LogReactions 1        // Which rule answered, which declined and why, which reaction won
SEC.Debug.Reactions 1           // Reaction list above each enemy, with priorities and cooldowns
SEC.Debug.Stimulus.Draw 1       // The announced shape, and every pawn it reached
SEC.Debug.All 1 turns every overlay on at once, and SEC.Debug.WatchPawn <name> narrows them to one enemy.
The rule log is the fastest way to tell a rule that never matched from a rule that matched and then found nothing to answer with. A rule skipped by its interval prints how much of the gap is left. A walk that answered nothing prints how many rules the set carries and how many of those were for that event.
Saving the asset runs validation into the Soulslike Enemy Combat message log, which names any reaction with nothing to run.

AlternativeEditing the arrays instead of the cards
Select nothing on the canvas and the panel on the right keeps the full Reactions and Trigger Rules arrays under Advanced, for reordering or editing several entries at once.
Renaming through those arrays is the one thing worth avoiding. Rename through the card or the Reaction ID row and every arrow that named the old ID follows in one undo step; rename through the raw array and the arrow is left pointing at nothing, which the card then flags.
AlternativeFiring a reaction without authoring any rules
A Reaction Set with cards but no arrows still works when your game decides the answer itself. Call Execute Reaction on the controller's Reaction Evaluation component with the Reaction ID and a context struct, and the trigger rules stay out of it.
Those reactions raise the "nothing reaches this reaction" warning, since the canvas cannot see a Blueprint calling by name. See Reaction System.
AdvancedA set authored before rules carried a priority
Opening such a set fills Rule Priority in from the order the rules already sat in, so the set keeps answering exactly as it did. The top rule takes the highest value, in steps of ten, leaving room to slot a rule between two without renumbering.
A set already carrying a priority anywhere is left alone. A set holding one authored priority and the rest at zero keeps the untouched rules in their relative order, sorted below the rule you typed a positive value on.
MultiplayerMultiplayer and dedicated servers
Reactions are chosen wherever the AI's decisions are made, so the picker lists the authoritative copy of each enemy. Under Play As Client that is the server's enemies rather than the client's.
A dedicated server launched as its own process cannot be inspected from the editor, because it has no world in the editor's process. Run the server in-process to watch its enemies.

PageWhy
Reaction SystemThe rules, scoring and gates every card shows.
Attack TelegraphsWhere the events a trigger answers come from.
Action Set EditorThe same canvas, for the poll-driven side of an enemy.
Combat RolesA role change swaps the Reaction Set, and the picker detaches when the AI moves to a different one.