GAMEPLAY PROGRAMMING / UNITY
Mechanisoul
Unity
C#
Behavior Graphs
Enemy AI
Combat Systems
Mechanisoul features a phase-based boss encounter designed to make combat
responsive, varied, and challenging. My work focused on gameplay programming and
boss behavior, including weighted attack selection, navigation and combat coordination,
and a resurrection mechanic that introduces additional pressure during the encounter.
01
Boss AI & Behavior Graph
Goal
Create a boss that responds to the player's position while maintaining
recognizable combat patterns. The boss needed to vary its attack without
making the encounter feel unpredictable or unfair.
Implementation
I implemented phase-based enemy behavior using Unity's Behavior Graph
system. Navigation and combat logic run in parallel, allowing the boss
to move while coordinating its attacks.
I also implemented a custom weighted composite that considers player distance
and randomized weights when selecting attacks. Blackboard variables coordinate
behavior across the relevant gameplay systems.
Technical Highlights
- Phase-based boss behavior
- Parallel navigation and combat
- Distance-aware weighted attack selection
- Blackboard-driven state coordination
- Extensible behavior logic
Result
The system allows attack selection to adapt to the player's
position while preserving control over the boss's combat
patterns. Separating decision-making from attack execution also
makes the behavior easier to extend and tune.
02
One-Time Resurrection System
A coroutine-based sequence that controls the resurrection animation, timing,
minion spawning, and completion state.
BossResurrection.cs
C#
public void StartResurrection()
{
if (HasResurrected || IsResurrectionActive) return;
StartCoroutine(ResurrectionRoutine());
}
private IEnumerator ResurrectionRoutine()
{
IsResurrectionActive = true;
animationController?.SetIsResurrecting(true);
yield return new WaitForSeconds(1.0f);
float timer = 0f;
while (timer < resurrectionTime)
{
timer += Time.deltaTime;
yield return null;
}
SpawnMinions();
animationController?.SetIsResurrecting(false);
HasResurrected = true;
IsResurrectionActive = false;
}
Goal
Create a boss mechanic that activates under the appropriate conditions,
executes a controlled sequence, and cannot be triggered repeatedly.
Implementation
I used state checks to prevent duplicate activation and a Unity
coroutine to manage the sequence over time without blocking the game
loop. The routine coordinates the animation, delay, minion spawning,
and final state updates.
Key Technical Decisions
- Guard conditions prevent repeated triggers
- Coroutines manage timed sequences
- Separate flags track active and completed states
- Animation calls use null-conditional access
Result
The mechanic adds another layer of pressure to the boss
encounter by introducing minions during the fight. Its explicit state
checks keep the sequence controlled and prevent unintended repeated
activation.