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:
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:| Threshold | Context | Example Taunts |
|---|---|---|
| 75% | self_health_75 | ”I’m not done yet!”, “This is just a scratch!“ |
| 50% | self_health_50 | ”You’ll have to do better than that!”, “I’ve been through worse!“ |
| 25% | self_health_25 | ”I’m still standing!”, “Not going down that easy!“ |
| 10% | self_health_10 | ”One last push!”, “I won’t give up!” |
Opponent Health Thresholds
Triggered when opponent’s health drops below threshold:| Threshold | Context | Example Taunts |
|---|---|---|
| 75% | opponent_health_75 | ”You’re looking weak!”, “I’m just getting started!“ |
| 50% | opponent_health_50 | ”Almost got you!”, “Halfway there!“ |
| 25% | opponent_health_25 | ”You’re done for!”, “One more hit should do it!“ |
| 10% | opponent_health_10 | ”Say goodnight!”, “This is the end!” |
Ambient Taunts
Triggered periodically (every 15-25 ticks) with no specific health trigger:| Context | Example Taunts |
|---|---|
ambient | ”Let’s see what you’ve got!”, “This is what I trained for!”, “May the best fighter win!” |
Configuration
Cooldown: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
- 14 of 14 tests passing
- 5 new trash talk tests added
Performance Impact
CPU:- Negligible - taunts are fire-and-forget
- LLM generation runs async (doesn’t block combat)
- Scripted fallbacks are instant (array lookup)
- ~50-200 bytes per taunt message
- Max 1 taunt per 8 seconds per agent
- Broadcast to spectators + participants
- 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)