-
Notifications
You must be signed in to change notification settings - Fork 2
AI-Generated Combat Impact SFX for 70 Vital Points (๊ฒฝํ)ย #1388
Description
๐ฏ Objective
Generate 70 AI-powered combat impact sound effects using ElevenLabs/procedural synthesis, one for each vital point (๊ฒฝํ) in the Korean martial arts system, providing authentic and varied audio feedback for precision strikes.
๐ Background
Black Trigram's combat system features 70 anatomically accurate vital points (๊ธ์) based on Korean martial arts (Hapkido, Taekwondo) and traditional pressure point targeting. Currently, combat uses generic impact sounds that don't differentiate between striking the head, liver, or knee. Players need audio feedback that reflects the specific body part hit and impact severity.
๐ Current State
- Existing SFX: ~300 generic combat sounds (dodge, stance_change, perfect_strike)
- Vital Point System: 70 anatomical targets implemented in
BoneImpactAudioMap.ts - Audio Differentiation: None - all hits sound the same
- Player Feedback: 63% of playtesters couldn't tell where they hit opponent without visual indicators
- Generator Available:
scripts/generate_sfx.tswith Korean martial arts context
Vital Point Categories (70 Total):
- Head Region (12): Crown, temples, eyes, nose, jaw, ears, throat, neck
- Torso (18): Heart, solar plexus, ribs, liver, spleen, kidneys, diaphragm
- Arms (16): Shoulders, elbows, wrists, fingers, nerve clusters
- Legs (16): Hips, knees, shins, ankles, toes, nerve points
- Back (8): Spine points, shoulder blades, lower back, tailbone
โ Acceptance Criteria
- 70 unique SFX generated (one per vital point in BoneImpactAudioMap)
- Each sound reflects anatomical characteristics (e.g., head = hollow, ribs = crack, soft tissue = thud)
- 3 intensity variations per point: light tap, medium strike, critical hit (210 total sounds)
- Korean martial arts cultural context integrated (respectful, authentic)
- Integrated into
BoneImpactAudioMap.tsanduseCombatAudio.ts - All sounds 0.2-1.5s duration, WebM format (Ogg Vorbis fallback)
- Volume normalized to -14 LUFS for consistency
- Tested across all 5 player archetypes in combat scenarios
- Performance: Sound loading and playback <10ms per hit
๐ ๏ธ Implementation Guidance
Phase 1: AI SFX Generation (Parallel Execution by Category)
Files to Create:
scripts/generate_vital_point_sfx.ts- Orchestration scriptpublic/assets/audio/sfx/vital_points/- Output directory structure
AI Generation Strategy:
// scripts/generate_vital_point_sfx.ts
const VITAL_POINT_SFX_MAP = {
// Head region - hollow, resonant impacts
head_crown: {
korean: "์ ์๋ฆฌ ํ๊ฒฉ์",
description: "Hollow skull impact with slight ring",
baseFrequency: "200-800Hz",
characteristics: "dull thud with resonance",
intensities: { light: 0.3, medium: 0.6, critical: 1.0 }
},
head_temple: {
korean: "๊ด์๋์ด ํ๊ฒฉ์",
description: "Precise nerve strike with sharp crack",
baseFrequency: "1000-3000Hz",
characteristics: "sharp crack with echo",
intensities: { light: 0.4, medium: 0.7, critical: 1.0 }
},
// Torso - deep, muffled impacts
torso_solar_plexus: {
korean: "๋ช
์น ํ๊ฒฉ์",
description: "Breath-stopping body blow",
baseFrequency: "100-500Hz",
characteristics: "deep whump with air expulsion",
intensities: { light: 0.5, medium: 0.8, critical: 1.0 }
},
// Joints - crack and pop sounds
arm_elbow: {
korean: "ํ๊ฟ์น ํ๊ฒฉ์",
description: "Joint manipulation impact",
baseFrequency: "300-1200Hz",
characteristics: "crack with cartilage pop",
intensities: { light: 0.3, medium: 0.6, critical: 0.9 }
},
// ... all 70 vital points
};Generate all sounds in parallel by category:
# Parallel generation (5 workers, one per category)
npx tsx scripts/generate_vital_point_sfx.ts --category=head --provider=elevenlabs --parallel &
npx tsx scripts/generate_vital_point_sfx.ts --category=torso --provider=elevenlabs --parallel &
npx tsx scripts/generate_vital_point_sfx.ts --category=arms --provider=elevenlabs --parallel &
npx tsx scripts/generate_vital_point_sfx.ts --category=legs --provider=elevenlabs --parallel &
npx tsx scripts/generate_vital_point_sfx.ts --category=back --provider=elevenlabs --parallel &
wait
# Post-process: Normalize volume and convert formats
npx tsx scripts/normalize_vital_sfx.ts --target=-14LUFSPhase 2: Integration into Audio System
Files to Modify:
src/audio/BoneImpactAudioMap.ts- Map vital points to SFX filessrc/audio/types.ts- Add VitalPointIntensity typesrc/components/screens/combat/hooks/useCombatAudio.ts- Play context-aware soundssrc/audio/AudioAssetRegistry.ts- Register vital point sounds
Example Code Integration:
// src/audio/BoneImpactAudioMap.ts
import { VitalPoint, HitIntensity } from '../types';
export const VITAL_POINT_SFX_REGISTRY: Record<VitalPoint, {
light: string;
medium: string;
critical: string;
}> = {
head_crown: {
light: '/assets/audio/sfx/vital_points/head/crown_light.webm',
medium: '/assets/audio/sfx/vital_points/head/crown_medium.webm',
critical: '/assets/audio/sfx/vital_points/head/crown_critical.webm'
},
// ... all 70 vital points ร 3 intensities
};
// Enhanced playback with intensity
export function playVitalPointImpact(
vitalPoint: VitalPoint,
intensity: HitIntensity,
audioManager: AudioManager
): void {
const sfxPath = VITAL_POINT_SFX_REGISTRY[vitalPoint][intensity];
audioManager.playSFX(sfxPath, {
volume: getIntensityVolume(intensity),
rate: getIntensityPitchShift(intensity)
});
}Phase 3: Combat Integration
Files to Modify:
src/systems/CombatSystem.ts- Emit vital point + intensity on hitsrc/components/screens/combat/CombatScreen3D.tsx- Wire audio playbacksrc/hooks/useCombatAudio.boneimpact.test.tsx- Add intensity tests
Example Usage:
// In CombatSystem hit detection
const hitResult = this.detectHit(attacker, defender, attackType);
if (hitResult.hit) {
const vitalPoint = hitResult.vitalPoint; // e.g., "head_temple"
const intensity = calculateIntensity(hitResult.damage); // light/medium/critical
// Audio system plays correct sound
eventBus.emit('vitalPointHit', { vitalPoint, intensity });
}Phase 4: Performance Optimization
- Implement sound pooling (max 10 concurrent vital point sounds)
- Lazy load sounds (load on first use, keep 30 most recent in memory)
- Use spatial audio for 3D positioning (optional enhancement)
- Profile memory usage, target <50MB for all vital point sounds
๐ฎ Testing Scenarios
- Vital Point Variety: Hit all 70 vital points, verify unique sounds
- Intensity Scaling: Light tap vs critical hit on same point, verify audio difference
- Rapid Combat: 20 hits in 5 seconds, verify no audio lag or pooling issues
- Memory Test: Load all sounds, verify <50MB memory footprint
- Cultural Accuracy: Validate Korean martial arts authenticity with Hapkido consultant
๐ Related Resources
- Vital Point System:
src/audio/BoneImpactAudioMap.ts(70 points defined) - Korean Vital Points (๊ฒฝํ): Traditional Korean medicine and martial arts
- SFX Generator:
scripts/generate_sfx.ts(Korean martial arts context) - ElevenLabs Sound Effects API: https://elevenlabs.io/sound-effects
- Hapkido Vital Point Targeting: http://www.hapkido.com/vital-points
๐ Metadata
Priority: High | Effort: L (8-12h) | Domain: audio, combat, ai-generation
Labels: type:feature, domain:audio, priority:high, size:large, ai-generated, vital-points, combat-feedback
๐ Parallel Execution
Can run in parallel with: Issues #1, #3, #4, #5, #6 (different asset types)
Dependencies: None (standalone audio assets)
Blocks: None
ํ๊ด์ ๊ธธ์ ๊ฑธ์ด๋ผ - Walk the Path of the Black Trigram