Fire Crystal Ant - AI
Version 1.1 by Adam Janus on 2026/01/19 18:49
Fire Crystal Ant
1. Introduction
- A low-level, early-game hostile creature.
- Introduce directional combat and basic telegraphed enemy attacks.
- Drops basic loot.

2. Enemy Behaviours
Summary:
- Patrol
- 2 Attacks
- 1 special move
- Stagger
Detects player by:
- Sight
- Hearing
- Touch
- Damage

2.1 Patrol
- Triggered by: Not engaged in any other behaviour OR end of Disengage behaviour
- Shown behaviour: Picks a location within its [Patrol Distance], rotates towards it and moves until it reaches it at [Patrol Speed].
- This is handled by a Custom Task and the MoveTo task of UE’s Behaviour Trees
- A new random location is picked after [NextPatrolWait]
- Transition rule: Senses the Player by sight, hearing, touch or damage.
- Senses are handled by Unreal Engine’s AIPerception component
- Attacking an unaware Enemy triggers this behaviour
- Animation:
- Normal ant-walking animation, with antennas waving slightly.
- On reaching patrol destination, idle animation with antennas moving in a jerky fashion (as if assessing the surroundings).
2.2 Approach
- Triggered by: end of Patrol Behaviour
- Shown behaviour: the Enemy rotates towards the Player and moves towards their direction at [Approach Speed].
- This is handled by the MoveTo task
- Transition rule: the Enemy stops moving when they are closer than [Attack Distance] from the Player and they still have the Player in their Line of Sight
- [Attack Distance] overrides the [Acceptable Radius] value in the MoveTo Task and is edited on a per-enemy basis based on their Design
- Animation:
- Faster ant-walking animation, with antennas waving faster.
2.3 Enemy Attack

- Triggered by: end of Approach Behaviour
- Shown behaviour: the Enemy triggers an Attack Animation Montage or Move Animation Montage
- Pincer Attack is preferred usually.
- Stinger Attack is preferred when:
- Player is near the edge of [Attack Distance].
- Player has reached the [Hit Streak Limit].
- Burrow Move is preferred when:
- Player is out of [Attack Distance].
- Player has reached the [Hit Streak Limit].
- Lower preference than Stinger Attack.
- Transition rule: the Enemy evaluates if the Player is still within [Attack Distance] and in its Line of Sight and either Attacks again or starts the Approach Behaviour again
- Animation:
- Described in 3.2 Enemy Attack.
2.4 Enemy Staggered
- Triggered by: [Stagger Damage] >= [Stagger Limit]
- Shown behaviour: the Enemy aborts all other Behaviours and triggers a Stagger Animation Montage
- Transition rule: upon ending the Stagger Animation Montage and waiting [Stagger Time] the Enemy evaluates if the Player is still within [Attack Distance] and in its Line of Sight and either starts the Attacks Behaviour or the Approach Behaviour
2.5 Enemy Disengage
- Triggered by: the Player gets further than the Enemy’s [AreaOfInterest]
- Shown behaviour: the Enemy rotates towards its [SpawnLocation] and goes back there
- This is handled by the MoveTo task
- Transition rule: upon reaching the [SpawnLocation] and waiting [NextPatrolWait] the Enemy starts the Patrol Behaviour
3. Action and Reactions
3.1 Attacking the Enemy
Upon registering damage, the following happens:
- Particles are spawned at the first point of impact
- If the flesh is hit, slightly bright gold particles. 1 burst: Short-lived and sparse.
- If the armour is hit, dull grey particles. Smaller particles. 1 burst: Short-lived and even sparser.
- A 2D Sound Effect is spawned
- If the flesh is hit, a satisfying crunch sound.
- If the armour is hit, a dull clang sound.
- Additionally, if flesh is hit, the crystals on the ant’s body glimmer in dull red (emissive).
- The Enemy receives damage based on the calculations in the CombatSystem_Design Document.
- The Enemy receives Stagger Damage.
3.2 Enemy Attack
This enemy has 2 attacks, and 1 special movement while attacking.
3.2.1 Pincer attack
The ant uses the pincers on its face to “bite” the player.
3.2.1.1 Animation
Wind-up:
- Extend the pincers over 0.5 seconds.
- Also, tilt the head back by 5 degrees from normal position (or the closest that’s noticeable to the player)
- [Notify] Body crystals glow deep gold.
- [Notify] Sounds:
- Insect-like crittering sound, and
- “Knock-knock-knock” retracting sound (like small machine gears)
- Hold for 0.5 seconds.
Swing:
- Snap shut over 0.2 seconds.
- Snap the head forward by 5 degrees from normal position.
- [Notify] Body crystals stop glowing abruptly.
- [Notify] Sounds:
- Slam sound
- [Notify] Apply slashing damage according to the number of pincer colliders that overlap the player.
- If the player is blocking, apply [Low] stamina cost to the player according to the number of pincer colliders that overlap the blocking shield.
Recovery:
- Pincers reach normal positions over 0.2 seconds.
- Cooldown for 2 seconds.
3.2.2 Sting attack
The ant uses the stinger at the back to stab the player.
3.2.2.1 Animation
Wind-up:
- Extend the wings horizontally over 0.5 seconds.
- Start flapping the wings.
- Lift the entire body up by 10 cm over 0.3 seconds.
- Also, slightly curl the body (i.e. bring the stinger closer to the head)
- [Notify] Body crystals glow deep gold.
- [Notifies] Sounds:
- Insect-like crittering sound (same as in Pincer attack), and
- Gentle swooping sound
- Hold for 0.2 seconds.
Swing:
- Quickly twist the entire body mid-air such that the stinger pointed at the player over 0.3 seconds.
- [Notify] Body crystals stop glowing
- [Notifies] Sounds:
- Fast swooping sound
- Subtle “cling” sound (like metal hitting metal)
- [Notify] Apply damage if the stinger collider overlaps the player.
- If the player is blocking, apply [Low-Mid] stamina cost to the player if the stinger collider overlaps the blocking shield.
Recovery:
- Body uncurls completely and the ant lands back on the ground over 0.5 seconds.
- Also, wings retract completely.
- [Notifies] Sounds:
- Very dull thump sound
- Very subtle swooping sound
- Cooldown for 2 seconds.
3.2.3 Burrow Move
The ant burrows into the ground and pops out behind the player.
3.2.3.1 Animation
Wind-up:
- Raise the arms and front half of the body by 4 cm over 0.5 seconds, as if “bracing”.
- [Notifies] Sounds:
- Dulled version of the crittering sound.
- Hold for 0.1 second.
Swing:
- Dive entirely into the ground, over 0.2 seconds.
- Kick up a small mound, which disappears after 1 second.
- [Notifies] Sounds:
- Dull thump
- Crunch of stones and mud
- Burst out of the ground (roughly) behind the player over 0.2 seconds.
- Facing the player.
- Same as before, kick up a mound.
- [Notifies] Sounds:
- Sharp woosh
- Crunch of stones and mud
Recovery:
- Cooldown for 5 seconds.
3.3 Enemy Armor
- The ant’s body is not visibly armoured per se. However, hitting different areas of the ant impart different damage, as follows:
Each of these parts correspond to unique colliders along the body.
- A capsule collider that is only used for AI movement logic calculations
3.4 Enemy Stagger
- When the received [Stagger Damage] >= [Stagger Limit] the Enemy starts the Stagger Behaviour
- After completing the Staggered Behaviour the [Stagger Damage] gets reset to 0
- The received [Stagger Damage] goes down over time if new [Stagger Damage] is dealt every [Stagger Recovery Time]
3.5 Defeating the Enemy
3.5.1 Summary
- Upon reaching 0 HP the Enemy plays a Death Anim Montage and stops using its Behaviour Tree.
- All Colliders besides the Enemy Base Collider are Disabled
- The Base Collider is set to overlap all
- All physics, including Gravity, is disabled
- Loot is dropped
3.5.2 Animations
- The ant’s body rises up in the air by 10 cm, somersaults and flips over, and falls back to the ground. Legs up in the air and the wings splayed slightly.
- All of this happens in 1 second.
- Crystals stop glowing.
3.5.3 Loot
- Drops 3-6 [crafting crystals (type 1)].
- Drops 5-10 [energy].
4. Enemy Blueprint Structure
4.1 Base Enemy Blueprint
The Base Enemy Blueprint inherits from Character
Tuning of basic Components:
- Character Movement -> [Use controller rotation yaw] -> True
- Capsule Component -> ignore all Collisions besides the ones needed for Locomotion
Other Components and Tuning:
- AI Controller -> AI Perception -> Senses Config -> All Enemies have at least the Sight Sense
- Base Collider
- Attack Colliders
- Reference Point -> Located at the Center of Mass of the Enemy
- Area of Interest (sphere collider)
4.2 Enemy Blackboard
All Enemies share the same Blackboard, besides particularly unique and complex Enemies (like bosses)
4.3 Behaviour Tree
Briefly described at 2. Enemy Behaviours.
5. Instance Editables
5.1 Manually editable
5.2 Internally set