- Created project directory structure - Added docs/SETUP_PHASE1.md with tool installation instructions - Added docs/AUDIO_ANALYSIS.md with game audio architecture - Added src/HomuraHimeAudioMod/ BepInEx plugin skeleton - Added patch stubs for VoiceManager, AudioDucking, EnemyAudio - Configured .gitignore for build artifacts and game files - Initialized beads issue tracker
6.9 KiB
6.9 KiB
HomuraHime Audio System Analysis
Game Overview
- Engine: Unity 2022.3.x
- Audio Engine: FMOD Studio 2.02.x with Google Resonance spatial audio
- Voice Manager: UtageFmodVoiceManager (adapted Utage framework)
- Platform: Steam (uses Steamworks.NET)
Audio Architecture
Directory Structure
HomuraHime_Data\
├── Managed\
│ ├── Assembly-CSharp.dll (7.08 MB - main game logic)
│ ├── Assembly-CSharp-firstpass.dll (3.92 MB - runtime code)
│ ├── FMODUnity.dll (239 KB - FMOD Unity integration)
│ ├── FMODUnityResonance.dll (11 KB - FMOD Resonance extension)
│ └── UnityEngine.AudioModule.dll
├── Plugins\x86_64\
│ ├── fmodstudio.dll (3.16 MB - FMOD core)
│ └── resonanceaudio.dll (817 KB - Google Resonance spatial)
└── StreamingAssets\FMOD\Desktop\
└── (49 FMOD bank files - ~1.3 GB total)
FMOD Bank Files
| Bank | Purpose | Size (streams) |
|---|---|---|
| Master.bank | Main mixer and routing | 98.5 KB |
| BGM.bank | Background music (general) | 63.83 MB |
| BGM_Default.bank | Default BGM | 224.07 MB |
| BGM_Hub.bank | Hub area music | 14.67 MB |
| BGM_Lv0-Lv5, BGM_LvF | Level-specific music | 14-64 MB each |
| Ambience.bank | Environmental sounds | 150.97 MB |
| SFX.bank | Sound effects | 188.97 MB |
| Voice.bank | Character voice | 19.83 MB |
| PreLoad_Jump.bank | Pre-cached jump sounds | ~533 KB |
| PreLoad_FootStep_Land.bank | Pre-cached footstep sounds | ~1 MB |
Total Audio: ~1.3 GB across 49 bank files
Key Audio Classes
Voice Management
- UtageFmodVoiceManager - Main voice manager (Utage framework adapted)
- CFVoiceData / CFVoiceEventUtility - Custom voice event system
- CharacterVoiceData - Character voice data handling
- FmodVoiceStopper - Voice stop controller
- get_CountVoice / get_IsPlayingVoice - Voice count monitoring
Sound Management
- FMODSoundManager - Main FMOD sound manager
- SoundManager (Utage base) - Base sound manager
- FmodSFXEventSO, FmodSFXEventRef, FmodSFXEventDispatcher - Custom SFX system
- FMODEventInstance - FMOD event instance wrapper
Channel/Volume Control
- FMOD_Channel - Custom FMOD channel wrapper
- VCASetting - Volume control area settings
- TaggedMasterVolume - Per-tag master volume control
- BGMChannel - BGM channel management
Audio Effects
- UpdateDucking / DuckVolume - Audio ducking system
- SnapshotManager - Snapshot management
- FmodReverbEventController - Reverb control
- ZoneReverbHandler - Zone-based reverb
Spatial Audio
- HHFmodListenerPosController - FMOD listener position controller
- resonanceaudio.dll - Google Resonance spatial audio
Pooling
- SimplePool / ObjectPool - Generic object pooling
- DEFAULT_POOL_SIZE, VfxObjectPoolSize - Pool size constants
Voice Event Constants (CFVOICE Events)
The game triggers voice events for various situations:
CFVOICE_REWARD- Reward soundsCFVOICE_CHALLENGEBATTLE- Challenge battle startCFVOICE_BATTLE- Battle startCFVOICE_NOTE- Note/commentaryCFVOICE_MHCHASING- Chasing sequencesCFVOICE_ELECTRIFYING- Electrifying eventsCFVOICE_HH/HH_Behaviour- HomuraHime behavior eventsCFVOICE_ENEMY- Enemy-related voiceCFVOICE_QTE_SHIKIGAMI- QTE shikigami eventsCFVOICE_BATTLERANK- Battle rank announcements- And many more...
Enemy System
Enemy Audio Triggers
- EnemyBehaviorManger - Enemy behavior management
- EnemyAttackBase, EnemyAttackAction, EnemyAttackBlockedAction - Attack handling
- EnemyIndicatorController - Visual indicators for enemies
- SetEnemyAI - AI setting method
- EnemyState - Enemy state tracking
HUD/Indicator Classes
- HUDIndicatorPhase / HUDIndicatorPhaseHandler - Phase indicator handling
- CDHUDIndicatorHandler - Cooldown HUD indicator
- IndicatorManager - Indicator management
Audio Configuration
Pool-Related Constants
DEFAULT_POOL_SIZE- Default pool sizeVfxObjectPoolSize- VFX pool sizeObjectPoolSize- Generic object pool sizepoolPreloadnum- Pool preload countpreloadCountPerPrefab- Per-prefab preload count
FMOD Channel Constants
MAXCHANNELS- Maximum channel countERR_TOOMANYCHANNELS- Channel overflow errorERR_CHANNEL_ALLOC- Channel allocation errorVIRTUALVOICE- Virtual voice managementCHANNELPRIORITY- Channel priority settingMAX_CHANNEL_WIDTH- Maximum channel width
Key Findings
- No explicit voice limit constants visible in string analysis - voice limit may be managed internally by FMOD or Utage framework
- Audio ducking system exists -
UpdateDuckingandDuckVolumepresent - Voice pooling exists - Object pooling with
DEFAULT_POOL_SIZEconstants - Lip-sync support - Using
uLipSyncFMODfor voice synchronization - Priority system -
CHANNELPRIORITYandPriorityfields for channel prioritization - Event-driven voice system - Voices triggered via CFVOICE event constants
Source File Paths (from DLL strings)
These are the original Unity asset paths in the game source:
Assets/4.Developer/Andy/UtageVoiceManager/UtageFmodVoiceManager.csAssets/4.Developer/Andy/UtageVoiceManager/UtageFmodVoiceSetting.csAssets/4.Developer/Andy/UtageVoiceManager/FmodVoiceStopper.csAssets/4.Developer/Andy/UtageVoiceManager/DEAudioFadeManager.csAssets/4.Developer/Andy/UtageVoiceManager/SnapshotManager.csAssets/4.Developer/Andy/UtageVoiceManager/FmodReverbEventController.csAssets/1.HonoHime/Core/FMODUtility/Scripts/FMODSoundManager.csAssets/1.HonoHime/Core/FMODUtility/Scripts/MMFeedbacks/FMOD_Channel.csAssets/1.HonoHime/Core/mLibrary/ObjectPool/SimplePool.cs
Game Data Files
Audio-related configuration may exist in:
HomuraHime_Data\StreamingAssets\HomuraHimeData\csv\EnemyData.jsonHomuraHime_Data\StreamingAssets\HomuraHimeData\json\BattleRound.jsonHomuraHime_Data\StreamingAssets\HomuraHimeData\json\EnemyData.json
Potential Audio Glitch Causes
Based on architecture analysis:
- Voice Limit Exhaustion - Too many simultaneous FMOD events
- Missing Audio Ducking Rules - No automatic volume reduction during intense combat
- Improper Event Instance Cleanup - Voices not being released properly
- CPU Pressure from Spatial Audio - Resonance audio processing overhead
- Pool Size Limitations - Object pool too small for audio components
Enemy Behavior Indicator Issues
Potential causes for unclear enemy audio cues:
- Low Mix Volume - Enemy sounds mixed too low in Master.bank
- Insufficient Spatial Positioning - Sounds not directional enough
- Lack of State Variation - Same sounds for all enemy states
- Audio Masking - Other sounds drowning out enemy cues
- Missing Parameter Changes - No FMOD parameter automation for enemy state