Enemies and AI¶
All · 10 min · No code
Problems with enemies: damage, death, stats, Art choice, movement and loot. For the model behind them, read Enemies and AI.
An enemy takes no damage and can't die¶
Why: one of three:
- Enemy Pawn Data is empty. Damage and death come from the abilities its pawn data grants.
This one logs an error:
<name> has no EnemyPawnData. It will have no stats, no abilities and cannot die. - Its pawn data's ability sets grant no death ability. Nothing is logged.
- It is possessed by the wrong AI controller. Lyra only lets a character damage another on a
different team, and an enemy gets its team from its controller. Only
Characters/Enemies/Core/BP_AIC_XenoCore_Enemyand its children supply one. A plain AI controller leaves the enemy on no team, and every hit on it is applied with zero effect. Nothing is logged.
Fix:
- In the enemy Blueprint's Class Defaults, set Enemy Pawn Data. Duplicate
PawnData_XenoCore_Minion_Meleerather than starting empty; its ability set (AbilitySet_XenoCore_Enemy_Common) carries death. - Set the enemy's AI Controller Class to
BP_AIC_XenoCore_Enemyor your child of it. - Keep the controller's Team Id (XenoCore › Teams) different from the party's. The default
is
2.
Avoid it next time: Add an enemy type.
An enemy's stats aren't what the curve table says, or they double after a level change¶
Why: an enemy's stats come from its Stats Effect, which reads rows of
CT_XenoCore_EnemyStats at the enemy's level. Two things change the result:
- A modifier's magnitude is the curve value times the modifier's own coefficient. The minion
types share the
Minion_Melee.*rows and differ only by that coefficient: Brute1.45, Bulwark1.15, Skirmisher0.9(Melee1.0). A stats effect duplicated from one of them inherits its multiplier. - Every modifier must use Override. An Add modifier stacks on the old value each time the effect is re-applied.
Fix: open the stats effect, check each modifier's coefficient and set it to the multiplier you
want (1.0 for the table's own number), and set every modifier's operation to Override.
Avoid it next time: Author an enemy statline.
An enemy takes almost no damage, whatever the party does¶
Why: enemy and party defence work differently. On a party member, Physical Defence and
Ether Defence are flat points subtracted from the attacker's stat. On an enemy, they are
fractions from 0 to 0.9: damage is multiplied by 1 - defence. A value typed as points,
such as 40, is clamped to 0.9, so the enemy shrugs off 90% of every hit.
Fix: set enemy defence rows in CT_XenoCore_EnemyStats as fractions, for example 0.15 for
15%. The 90% cap is fixed in C++.
Avoid it next time: Author an enemy statline.
An enemy ignores the party and walks past¶
Why: one of three things.
- Its Detection (XenoCore › AI › Detection) is None (passive): it only fights once hit.
- It detects by Sound and the leader is walking: only a running leader is heard.
- It is too far below the party: an enemy Ignore When Levels Below (
6) or more levels under the leader notices nothing. The threshold is on its AI controller (XenoCore › AI). Such an enemy still fights back if attacked.
Fix: change its Detection, raise its Enemy Level (or the spawner's level range), or tick Unique Monster on it or Always Aggro on a child controller for bosses and unique enemies.
Avoid it next time: Place enemies.
An enemy never uses its Arts, or uses one and never the other¶
Fails silently
The enemy keeps auto-attacking normally, so nothing looks broken.
Why: enemies choose Arts with the same scorer as companions, from the Art definitions on the enemy Blueprint's Arts list (XenoCore › Enemy › Arts). One of these is usually the cause:
- The Art is not on the Arts list. Nothing in the ability set or the StateTree grants enemy Arts.
- Usable By AI is off in the Art's Art › Companion AI section.
- The Art's Distance is shorter than the distance the enemy fights from, so it is never in reach.
- The Art plays the same montage asset as the enemy's auto-attack. The auto-attack's swing is stopped by montage, so the Art is stopped on its first frame and never lands.
- A Topple or Daze Art with AI Wait For Reaction on is held until the target is Broken (or Toppled). With no Break Art on the enemy, it is never used.
- Two Arts share one Cooldown Tag, so using one puts both on cooldown.
Fix: press the backquote key (`) in Play to open the console, type
log LogXenoAI Verbose, and fight the enemy. Each decision prints as
<enemy>: decision - <Art>=<score> .... An Art that never appears there is not on the body or not
usable; an Art that appears but never wins needs a higher AI Priority or a condition bonus. Give
every Art its own montage and its own Cooldown Tag.
Avoid it next time: Give an enemy Arts.
An enemy uses Arts back to back¶
Why: each Art waits for its own cooldown, and the enemy also waits its AI Profile › Post-Art Cooldown after any Art. An Art with no Cooldown Duration, on an enemy with a short post-art cooldown, is ready again almost at once.
Fix: give the Art a Cooldown Duration and its own Cooldown Tag, and raise Post-Art Cooldown on the enemy (XenoCore › Enemy › Arts › AI Profile).
Avoid it next time: Give an enemy Arts.
A state I added to a StateTree is never entered¶
Fails silently
The StateTree compiles with no errors and looks correct in the editor.
Why: a new state's Selection Behavior defaults to Try Select Children In Order. That behaviour looks for a child to enter, so a state with no children finds nothing and is never entered. The tree sits in its parent doing nothing.
Fix: on every leaf state (one with no children), set Selection Behavior to Try Enter. Keep Try Select Children In Order only on states that have children.
Avoid it next time: Enemies and AI.
A Toppled or Dazed enemy stands still instead of falling, or keeps attacking¶
Fails silently
The TOPPLE or DAZE popup still appears, and nothing is logged.
Why:
- Stands still: its ability set has no knock-down ability for that reaction, or the ability still plays the minion's montage on a different skeleton. The rule that stops it acting is on the auto-attack, so it cannot act, but nothing plays the fall.
- Keeps attacking: its auto-attack Blueprint sets its own Incapacitated Tags (XenoCore › AutoAttack). A list set on a Blueprint replaces the default (Topple and Daze) rather than adding to it, and an empty list turns the rule off.
Fix: grant copies of GA_XenoCore_Minion_Topple and GA_XenoCore_Minion_Daze with your
enemy's montages, with Hold Until Montage Ends and Hold While Trigger Tag Present on. Reset
Incapacitated Tags to its default, or list Topple and Daze in it. Test with
XenoCore.Reaction 2 enemy while locked on.
Avoid it next time: Add an enemy.
An enemy slides sideways or backwards in an idle or forward-running pose¶
Fails silently
The enemy fights correctly; only its legs are wrong.
Why: its anim Blueprint plays a blend space with no direction. A forward-only (1D) blend space has nothing to play when the enemy strafes round its attackers or backs off, so it plays a forward clip, or half-blends into idle, while the body moves sideways. The minion's anim Blueprint uses a 2D blend space for this reason.
Fix:
- Give the enemy a 2D blend space with Direction (-180 to 180) on the horizontal axis and
speed on the vertical axis, with forward, left, right and back clips. Copy the layout of
Characters/Enemies/Minion/Animations/BS_XenoCore_Minion_Locomotion2D. - In its Animation Blueprint (whose parent class is
XenoCoreAnimInstance), drive the blend space's two axes from the Direction and Ground Speed variables. - Drive the Idle and Move transitions from Ground Speed too, with a gap between them: enter
Move above
20, return to Idle below8. One threshold both ways makes the legs flicker between idle and run while the enemy shuffles.
Avoid it next time: Add an enemy type.
An enemy never patrols¶
Why: the enemy has no Patrol Points, or it is provoked. An enemy walks its route only while
unprovoked. With no points it wanders within Wander Radius of home, or stands still if that is
0. An enemy made by a spawner takes the spawner's Wander Radius and has no patrol route.
Fix: select the placed enemy and add Patrol Points (XenoCore › AI › Patrol). Each point is relative to where the enemy stands, and shows as a handle you can drag in the viewport. Check the route is on the navigation mesh (press P).
Avoid it next time: Place enemies.
A defeated enemy drops no chest, or the chest opens empty¶
Why:
- No chest at all: the enemy has a Drop Table but no Chest Class. Logged as an error:
<name> has a DropTable but no ChestClass. Its loot is unreachable. - No chest from most of a group: the enemy came from a spawner with Squad Loot Rule on (the default), so only the last member killed drops a chest, at least silver, with the leader's loot (the first enemy of the first Members entry). Untick it on the spawner for one chest per enemy.
- A squad's chest holds the wrong enemy's loot: it is the leader's, not the last kill's. Reorder the spawner's Members so the type you want is first.
- Empty chest: the drop table has no pool, or no usable entries, for the tier the chest rolled
(Wooden, Silver or Gold). Logged as a warning:
<table> has no pool for tier <n>. The chest will be empty. - Fewer items than expected, or empty at some levels: the pool's entries have Min Level /
Max Level bands, and none (or too few) cover the dying enemy's level; with No Duplicate
Equipment on, a small pool can also run out of pieces. Run
XenoCore.Loot.Simulate <table> <level>to see what a table pays at a level.
Fix: set Chest Class on the enemy (XenoCore › Loot), and give the drop table a pool with at least one entry for every tier. Always Gold Chest forces the Gold tier.
Avoid it next time: Author a drop table.