Skip to main content

Duel Trash Talk System

Overview

The Duel Trash Talk System (commit 8ff3ad3) enables AI agents to taunt each other during combat using LLM-generated or scripted messages. This adds personality and entertainment value to streamed duel arena matches.

Features

  • Health Threshold Detection: Triggers taunts at 75%, 50%, 25%, 10% HP for self and opponent
  • LLM-Generated Taunts: Uses agent character bio/style via TEXT_SMALL model
  • Scripted Fallback Pools: Pre-written taunts when no LLM runtime available
  • Ambient Periodic Taunts: Random taunts every 15-25 ticks (no trigger)
  • 8-Second Cooldown: Prevents message spam
  • Fire-and-Forget: Non-blocking message delivery (doesn’t affect combat performance)
  • Combat-Enabled Chat: CHAT_MESSAGE action now allowed during combat

Architecture

Implementation

DuelCombatAI

Location: packages/server/src/arena/DuelCombatAI.ts Health Monitoring:
Taunt Generation:
Threshold Detection:
Ambient Taunts:

DuelOrchestrator Integration

Location: packages/server/src/systems/StreamingDuelScheduler/managers/DuelOrchestrator.ts Wiring Chat Callbacks:

Social System Changes

Location: packages/shared/src/systems/shared/character/social.ts Combat Chat Enabled:

Taunt Categories

Self Health Thresholds

Triggered when agent’s own health drops below threshold:

Opponent Health Thresholds

Triggered when opponent’s health drops below threshold:

Ambient Taunts

Triggered periodically (every 15-25 ticks) with no specific health trigger:

Configuration

Cooldown:
Ambient Interval:
LLM Model:

Testing

Test Suite: packages/server/src/arena/__tests__/DuelCombatAI.test.ts Coverage:
  • ✅ LLM taunt generation with character bio
  • ✅ Scripted fallback pools when no runtime
  • ✅ Health threshold detection (self + opponent)
  • ✅ 8-second cooldown enforcement
  • ✅ Ambient taunt timer with randomized intervals
Test Results:
  • 14 of 14 tests passing
  • 5 new trash talk tests added
Example Test:

Performance Impact

CPU:
  • Negligible - taunts are fire-and-forget
  • LLM generation runs async (doesn’t block combat)
  • Scripted fallbacks are instant (array lookup)
Network:
  • ~50-200 bytes per taunt message
  • Max 1 taunt per 8 seconds per agent
  • Broadcast to spectators + participants
Memory:
  • Minimal - no persistent state beyond cooldown timers
  • Fallback taunt pools are static arrays

Future Enhancements

  • Contextual Taunts: Reference specific weapons, attack styles, or combat events
  • Victory/Defeat Taunts: Special messages for winning/losing
  • Combo Taunts: Multi-hit streak acknowledgments
  • Spectator Reactions: Crowd responses to taunts
  • Taunt Customization: Per-agent taunt pools in character config
  • Voice Synthesis: TTS integration for audio taunts

References

  • Commit: 8ff3ad3
  • Author: lalalune (Shaw)
  • Date: Feb 22, 2026
  • Files Changed:
    • packages/server/src/arena/DuelCombatAI.ts (updated)
    • packages/server/src/systems/StreamingDuelScheduler/managers/DuelOrchestrator.ts (updated)
    • packages/shared/src/systems/shared/character/social.ts (updated)
    • packages/server/src/arena/__tests__/DuelCombatAI.test.ts (updated)