
Emotion‑Driven AI System in Unity (Fear, Aggression, Morale, Stress)
September 4, 2026
Contextual Shouts / AI Voice Cues in Unity (AAA Combat Communication System)
September 8, 2026Leader Auras allow a squad leader to influence the emotions and morale of nearby NPCs.
This creates coordinated group behaviors such as boosted aggression, reduced fear, faster recovery, or even frenzy states.
It is a perfect extension on top of the Emotion-Driven AI system.
1. What is a Leader Aura?
A Leader Aura is an emotional field emitted by a squad leader that affects all allied NPCs within range.
Auras can:
- Reduce allies’ fear
- Boost morale
- Increase aggression
- Speed up emotion recovery
- Stabilize stress
- Trigger special group behaviors (charge, hold position, frenzy)
This makes a group behave more like an organism rather than isolated units.
2. Aura Types
- Commander Aura → +Morale, -Fear (calm & control)
- Berserker Aura → +Aggression, -Discipline (chaos & frenzy)
- Guardian Aura → -Stress, +Fear Resistance
- Tactician Aura → +Awareness, +Group Coordination
- War Cry (temporary) → Attack boost, morale spike
A leader can mix or dynamically change auras.
3. Leader Aura Component
Each leader has an aura radius and modifiers for emotional stats.
using UnityEngine;
using System.Collections.Generic;
public class LeaderAura : MonoBehaviour
{
public float radius = 10f;
public float moraleBoost = 0.2f;
public float fearReduction = 0.15f;
public float aggressionBoost = 0.25f;
public float stressReduction = 0.2f;
public float auraTickRate = 0.5f;
private float timer = 0f;
void Update()
{
timer += Time.deltaTime;
if (timer >= auraTickRate)
{
ApplyAuraEffects();
timer = 0f;
}
}
void ApplyAuraEffects()
{
Collider[] hits = Physics.OverlapSphere(transform.position, radius);
foreach (var hit in hits)
{
EmotionSystem ally = hit.GetComponent<EmotionSystem>();
if (ally != null && ally.gameObject != this.gameObject)
{
ally.state.morale += moraleBoost * Time.deltaTime;
ally.state.fear -= fearReduction * Time.deltaTime;
ally.state.aggression += aggressionBoost * Time.deltaTime;
ally.state.stress -= stressReduction * Time.deltaTime;
}
}
}
}
4. Smooth Application (Multipliers Instead of Raw Additions)
Better AAA method: use percentage multipliers instead of raw stat changes.
public float moraleMultiplier = 1.2f; public float fearMultiplier = 0.8f; public float aggressionMultiplier = 1.3f; public float stressMultiplier = 0.85f;
Then apply like this:
ally.state.morale *= moraleMultiplier; ally.state.fear *= fearMultiplier; ally.state.aggression *= aggressionMultiplier; ally.state.stress *= stressMultiplier;
5. Aura Priority System (Leader Hierarchy)
If multiple leaders overlap, we pick the strongest leader or merge auras with special rules.
Rule Options
- Highest-Rank Wins
- Strongest Aura Wins
- Merge With Weight
Example: Highest-Rank Wins
public int leaderRank = 1; // higher = stronger
public static LeaderAura GetBestAura(List<LeaderAura> auras)
{
LeaderAura best = null;
foreach (var aura in auras)
{
if (best == null || aura.leaderRank > best.leaderRank)
best = aura;
}
return best;
}
6. War Cry (Temporary Burst Aura)
War Cry is a timed massive emotional spike — perfect for cinematic encounters.
public IEnumerator WarCry(float duration)
{
float t = 0f;
while (t < duration)
{
Collider[] allies = Physics.OverlapSphere(transform.position, radius);
foreach (var c in allies)
{
EmotionSystem ally = c.GetComponent<EmotionSystem>();
if (ally)
{
ally.state.morale += 0.8f;
ally.state.aggression += 0.5f;
ally.state.fear -= 0.6f;
}
}
t += 0.2f;
yield return new WaitForSeconds(0.2f);
}
}
Trigger example:
StartCoroutine(WarCry(4f));
7. Leader Death → Group Panic
Leader’s death can trigger:
- Fear spike among allies
- Morale collapse
- Panic contagion
- Retreat behavior
public void OnLeaderDeath()
{
Collider[] allies = Physics.OverlapSphere(transform.position, radius);
foreach (var hit in allies)
{
EmotionSystem ally = hit.GetComponent<EmotionSystem>();
if (ally != null)
{
ally.state.fear += 0.6f;
ally.state.morale -= 0.5f;
ally.state.stress += 0.3f;
}
}
}
8. Behavior Tree Integration
Leaders can change squad behavior globally:
- Commander Aura → defensive formation
- Berserker Aura → rush
- Tactician Aura → flank maneuvers
Example: Emotional State Influence
If aura is Commander:
Fear tolerance = High
Retreat threshold = Low
If aura is Berserker:
Attack frequency = High
Dodge behavior = Disabled
If aura is Guardian:
Stress-based behaviors reduced
9. Visual Aura Debug Display
void OnDrawGizmosSelected()
{
Gizmos.color = new Color(0.2f, 0.6f, 1f, 0.25f);
Gizmos.DrawSphere(transform.position, radius);
}
10. Advanced Features (Pro Tips)
- Adaptive Aura Strength (leaders lose influence when stressed)
- Dynamic Aura Radius based on animation or stamina
- Aura Chains (leaders empowering sub-leaders)
- Enemy Leader Debuffs (fear spikes when enemy warlord arrives)
- Mood Echo (recent auras linger after leaving radius)
- Aura Synergy (Commander + Guardian = Super Stability)
- AI “Rally Point” System (leaders pull squad toward them)
Summary
Leader Auras elevate your emotion-based AI into squad-level behavior simulation.
NPCs start behaving like coordinated units reacting to leadership presence, battlefield tension, and emotional flow.
Combined with Emotional Memory + Sensory System, this creates immersive, emergent AI encounters that feel hand-scripted.









