Mechromancer Behavior Graph
Design Intent:
We wanted to make a boss feel responsive to the environment around the player and the
playstyle the player takes on.
Attacks vary based on the distance the player is at from the boss,
however, we wanted to still have clear combat patterns.
System Design
I implemented a phase-based AI using Unity's behavior graph system, that incorporated navigation
and combat running in parallel. I also
created a custom weighted composite node in order to have it
select the attacks dynamically based on player distance. This allows the boss
to adapt and feel more fluid.
Key Implementation
- Blackboard variables coordinate states across systems and scripts (attackFinished, comboLanded, alreadyResurrected)
- A custom weighted sequence composite that evaluates player distance and applies weighted randomness
to attack selection
- Decision logic is decoupled from execution, allowing attack logic to be added or tuned without modifying
scripts which makes it easier for designers to tweak.
Lightning Attack
Design Intent:
Lightning needed to pressure long-range players without becoming unfair or impossible to dodge.
System Design
Instead of a homing projectile, the lightning attack targets the player's last known position at the moment
of firing and creates an area of effect.
Key Implementation
- Captures the player's position before firing
- Launches a non-homing projectile toward the location
- Uses VFX-based visuals to maintain clarity and telegraphing
Lunge Attack
Design Intent:
The lunge attack was designed to close the distance when the player is trying to stay outside
of the combo range.
System Design
The lunge is selected randomly based on player distance and executed as a small burst of
movement towards the player, synchronized with the animation.
Key Implementation
- Triggered by the weighted decision node when the player is within mid-range distance
- Movement speed and direction are controlled during the attack window only
- Animation events signal attack start and end and returns back to the weighted sequence node
Resurrection
Design Intent:
We wanted it to feel as a dramatic start to the boss fight in order to overwhelm the player.
They havebeen fighting hordes of basic enemies, and we wanted to throw in a challenge.
System Design
The resurrection system is implemented as a one-time behavior integrated at the start of the
Behavior Graph after the player activates the fight. It is set to be the first attack
the boss makes
in order to start the fight one-sided.
Key Implementation
- Resurrection state is stored in the Blackboard and is set to true after the animation completes (alreadyResurrected)
- The AI temporarily halts combat while playing the animation
- Minions are spawned through an animation event
- After successful completion, the boss enters the combat loop