🎯 Objective
Generate dynamic battle music variations for all 5 player archetypes using Suno AI, creating 3-phase adaptive music tracks (intro/combat/victory) that respond to combat intensity and archetype personality, totaling 15 unique music tracks.
📋 Background
Black Trigram features 5 distinct player archetypes, each with unique combat philosophies and cultural backgrounds. Currently, generic combat music plays regardless of archetype or match phase. Players need immersive, adaptive music that reflects their chosen archetype and combat situation (defensive, aggressive, victorious).
📊 Current State
- Existing Music: 10 tracks (intro, combat, underground, 5 archetype themes)
- Archetype Themes: Single static track per archetype (no combat progression)
- Adaptive Music: None - same music plays regardless of combat state
- Player Immersion: 71% of playtesters wanted music that "felt more connected" to their archetype
- Generator Available:
scripts/generate_music_suno.ts (4 styles: traditional, cyberpunk, ambient, combat)
Archetype Music Needs (5 × 3 = 15 Tracks):
-
무사 (Musa) - Traditional Warrior
- Intro: Meditative 가야금 (gayageum), slow tempo
- Combat: Driving 장구 (janggu) drums, heroic
- Victory: Triumphant traditional fanfare
-
암살자 (Amsalja) - Shadow Assassin
- Intro: Tense 해금 (haegeum), stealthy
- Combat: Dark electronic beats, precise strikes
- Victory: Quiet satisfaction, shadowy fade
-
해커 (Hacker) - Cyber Warrior
- Intro: Glitchy synths, digital ambience
- Combat: Intense techno with Korean instrument samples
- Victory: Cyber celebration, neon triumph
-
정보요원 (Jeongbo Yowon) - Intelligence Operative
- Intro: Analytical pads, strategic planning
- Combat: Calculated rhythm, tactical precision
- Victory: Mission accomplished theme
-
조직폭력배 (Jojik Pokryeokbae) - Organized Crime
- Intro: Underground bass, street tension
- Combat: Ruthless percussion, aggressive energy
- Victory: Dominant power theme
✅ Acceptance Criteria
🛠️ Implementation Guidance
Phase 1: AI Music Generation (Parallel Execution by Archetype)
Files to Use:
scripts/generate_music_suno.ts - Suno AI music generation
- New:
scripts/generate_archetype_battle_music.ts - Orchestration script
public/assets/audio/music/archetype_battle/ - Output directory
Suno AI Prompts (Korean Cultural Context):
// scripts/generate_archetype_battle_music.ts
const ARCHETYPE_BATTLE_MUSIC = {
musa: {
intro: {
description: "Traditional Korean warrior meditation - 무사의 준비",
style: "traditional",
prompt: "Meditative Korean martial arts preparation music, solo gayageum (가야금) with gentle janggu (장구) rhythm, pentatonic scale, slow tempo 60 BPM, traditional Korean warrior spirit, philosophical depth, respectful and honorable atmosphere, ambient background, traditional instrumentation only",
duration: 30,
tags: "korean traditional, martial arts, meditation, musa warrior"
},
combat: {
description: "Traditional warrior battle theme - 무사의 전투",
style: "combat",
prompt: "Epic Korean traditional battle music, powerful janggu (장구) war drums, heroic gayageum (가야금) melodies, buk (북) percussion, driving rhythm 140 BPM, honorable warrior combat, traditional Korean military music influences, intense but disciplined energy, pentatonic scales, traditional martial arts spirit",
duration: 75,
tags: "korean traditional, combat, epic, warrior drums"
},
victory: {
description: "Traditional warrior victory - 무사의 승리",
style: "traditional",
prompt: "Triumphant Korean traditional victory fanfare, celebratory gayageum (가야금), proud janggu (장구) rhythm, traditional Korean military triumph music, honorable and respectful celebration, pentatonic victory theme, tempo 100 BPM, traditional instrumentation, warrior's honorable win",
duration: 40,
tags: "korean traditional, victory, celebration, triumphant"
}
},
amsalja: {
intro: {
description: "Shadow assassin preparation - 암살자의 잠복",
style: "ambient",
prompt: "Dark Korean shadow assassin theme, tense haegeum (해금) violin tones, minimal percussion, ambient electronic pads with traditional Korean instruments, stealthy atmosphere, 80 BPM, suspenseful and precise, cyberpunk Korean fusion, shadow warrior preparation, traditional meets electronic darkness",
duration: 30,
tags: "korean fusion, shadow, stealth, tension"
},
combat: {
description: "Shadow combat music - 암살자의 암습",
style: "cyberpunk",
prompt: "Intense Korean shadow assassin combat music, dark electronic beats fused with haegeum (해금), precise percussive strikes, cyberpunk Korean aesthetic, 150 BPM, stealthy aggressive energy, traditional Korean instruments processed electronically, shadow warrior strikes, deadly precision rhythm",
duration: 80,
tags: "korean cyberpunk, shadow combat, electronic fusion"
},
victory: {
description: "Silent victory - 암살자의 승리",
style: "ambient",
prompt: "Quiet Korean shadow assassin victory theme, soft haegeum (해금) fade, minimal electronic ambience, satisfied but not boastful, 70 BPM, traditional Korean shadows meet cyberpunk, mission accomplished atmosphere, fade to darkness, respectful shadow warrior conclusion",
duration: 35,
tags: "korean ambient, shadow victory, subtle"
}
},
// ... hacker, jeongbo, jojik (similar structure)
};
Generate all 15 tracks in parallel (5 workers):
# Parallel generation by archetype
npx tsx scripts/generate_archetype_battle_music.ts musa --all-phases --provider=suno &
npx tsx scripts/generate_archetype_battle_music.ts amsalja --all-phases --provider=suno &
npx tsx scripts/generate_archetype_battle_music.ts hacker --all-phases --provider=suno &
npx tsx scripts/generate_archetype_battle_music.ts jeongbo --all-phases --provider=suno &
npx tsx scripts/generate_archetype_battle_music.ts jojik --all-phases --provider=suno &
wait
# Post-process: Convert to MP3 + WebM, normalize volume
npx tsx scripts/convert_battle_music.ts --format=mp3,webm --normalize=-14LUFS
Phase 2: Adaptive Music System
Files to Modify:
src/components/game/GameAudio.tsx - Add phase-based music switching
src/audio/AudioManager.ts - Implement crossfade transitions
src/types/audio.ts - Add BattleMusicPhase enum
src/hooks/useBattleMusic.ts - New hook for phase management
Example Code Integration:
// src/hooks/useBattleMusic.ts
import { useState, useEffect } from 'react';
import { useAudio } from '../audio/AudioProvider';
import { PlayerArchetype } from '../types';
export enum BattleMusicPhase {
INTRO = 'intro',
COMBAT = 'combat',
VICTORY = 'victory'
}
export function useBattleMusic(
archetype: PlayerArchetype,
phase: BattleMusicPhase
) {
const audio = useAudio();
useEffect(() => {
const trackPath = `/assets/audio/music/archetype_battle/${archetype}_${phase}.mp3`;
// Crossfade transition (3 seconds)
audio.crossfadeMusic(trackPath, {
fadeOutDuration: 3000,
fadeInDuration: 3000,
loop: phase === BattleMusicPhase.COMBAT
});
}, [archetype, phase, audio]);
}
Phase 3: Combat Integration
Files to Modify:
src/components/screens/combat/CombatScreen3D.tsx - Trigger phase changes
src/systems/CombatSystem.ts - Emit battle phase events
src/components/screens/endscreen/EndScreen3D.tsx - Play victory music
Example Usage:
// In CombatScreen3D.tsx
const [battlePhase, setBattlePhase] = useState(BattleMusicPhase.INTRO);
useEffect(() => {
// Intro → Combat after countdown
if (matchStarted && battlePhase === BattleMusicPhase.INTRO) {
setTimeout(() => setBattlePhase(BattleMusicPhase.COMBAT), 5000);
}
}, [matchStarted]);
// Combat → Victory when match ends
useEffect(() => {
if (matchEnded && winner) {
setBattlePhase(BattleMusicPhase.VICTORY);
}
}, [matchEnded, winner]);
// Use adaptive music
useBattleMusic(selectedArchetype, battlePhase);
Phase 4: Performance Optimization
- Preload intro/combat tracks before match starts
- Lazy load victory music (triggered on match end)
- Use Web Audio API for smooth crossfades
- Profile memory usage, target <30MB for active tracks
🎮 Testing Scenarios
- Archetype Variation: Start matches with all 5 archetypes, verify unique music
- Phase Transitions: Verify smooth intro → combat → victory crossfades
- Loop Quality: Combat phase loops seamlessly for 5+ minutes
- Cultural Accuracy: Validate Korean traditional instrument usage with music consultant
- Performance: Verify smooth music playback during intense 60fps combat
🔗 Related Resources
- Suno AI Music Generator: https://suno.com
- Korean Traditional Instruments: 가야금 (gayageum), 해금 (haegeum), 장구 (janggu), 북 (buk)
- Existing Generator:
scripts/generate_music_suno.ts (4 styles available)
- Archetype Personalities:
src/systems/types.ts (PLAYER_ARCHETYPES_DATA)
- Korean Music Theory: Pentatonic scales, 장단 (jangdan) rhythmic patterns
📊 Metadata
Priority: High | Effort: L (10-12h) | Domain: audio, music, ai-generation
Labels: type:feature, domain:audio, priority:high, size:large, ai-generated, adaptive-music, archetype-system
🔗 Parallel Execution
Can run in parallel with: Issues #1, #2, #4, #5, #6 (different asset types)
Dependencies: None (standalone music assets)
Blocks: None
흑괘의 길을 걸어라 - Walk the Path of the Black Trigram
🎯 Objective
Generate dynamic battle music variations for all 5 player archetypes using Suno AI, creating 3-phase adaptive music tracks (intro/combat/victory) that respond to combat intensity and archetype personality, totaling 15 unique music tracks.
📋 Background
Black Trigram features 5 distinct player archetypes, each with unique combat philosophies and cultural backgrounds. Currently, generic combat music plays regardless of archetype or match phase. Players need immersive, adaptive music that reflects their chosen archetype and combat situation (defensive, aggressive, victorious).
📊 Current State
scripts/generate_music_suno.ts(4 styles: traditional, cyberpunk, ambient, combat)Archetype Music Needs (5 × 3 = 15 Tracks):
무사 (Musa) - Traditional Warrior
암살자 (Amsalja) - Shadow Assassin
해커 (Hacker) - Cyber Warrior
정보요원 (Jeongbo Yowon) - Intelligence Operative
조직폭력배 (Jojik Pokryeokbae) - Organized Crime
✅ Acceptance Criteria
GameAudio.tsxandAudioManager.ts🛠️ Implementation Guidance
Phase 1: AI Music Generation (Parallel Execution by Archetype)
Files to Use:
scripts/generate_music_suno.ts- Suno AI music generationscripts/generate_archetype_battle_music.ts- Orchestration scriptpublic/assets/audio/music/archetype_battle/- Output directorySuno AI Prompts (Korean Cultural Context):
Generate all 15 tracks in parallel (5 workers):
Phase 2: Adaptive Music System
Files to Modify:
src/components/game/GameAudio.tsx- Add phase-based music switchingsrc/audio/AudioManager.ts- Implement crossfade transitionssrc/types/audio.ts- Add BattleMusicPhase enumsrc/hooks/useBattleMusic.ts- New hook for phase managementExample Code Integration:
Phase 3: Combat Integration
Files to Modify:
src/components/screens/combat/CombatScreen3D.tsx- Trigger phase changessrc/systems/CombatSystem.ts- Emit battle phase eventssrc/components/screens/endscreen/EndScreen3D.tsx- Play victory musicExample Usage:
Phase 4: Performance Optimization
🎮 Testing Scenarios
🔗 Related Resources
scripts/generate_music_suno.ts(4 styles available)src/systems/types.ts(PLAYER_ARCHETYPES_DATA)📊 Metadata
Priority: High | Effort: L (10-12h) | Domain: audio, music, ai-generation
Labels:
type:feature,domain:audio,priority:high,size:large,ai-generated,adaptive-music,archetype-system🔗 Parallel Execution
Can run in parallel with: Issues #1, #2, #4, #5, #6 (different asset types)
Dependencies: None (standalone music assets)
Blocks: None
흑괘의 길을 걸어라 - Walk the Path of the Black Trigram