Sound (BGM & Client UI)¶
Overview¶
UMIPBackgroundMusicSubsystem is a GameInstance subsystem that plays looping background music across map loads, with cursor persistence and soft-loop handling when the engine does not loop UAudioComponent reliably. UMIPClientSoundPlayer is a PlayerController component that owns client-side UI and combat feedback audio: 2D UI sounds, hit-reaction queues at locations, equipment/exchange/notification hooks, and life-skill crafting UI sound loops.
All paths below are relative to Plugins/ModularInventoryPlus/Source/ModularInventoryPlus/.
Key Classes & Files¶
| Class | File |
|---|---|
UMIPBackgroundMusicSubsystem |
Public/Sound/MIPBackgroundMusicSubsystem.h |
UMIPClientSoundPlayer |
Public/Sound/MIPClientSoundPlayer.h |
FMIPPlayerSoundAtLocationInfo etc. |
Public/Sound/MIPSoundTypes.h |
UMIPBackgroundMusicSubsystem¶
- Base:
UGameInstanceSubsystem. - Lifecycle:
Initialize/Deinitialize; binds to map load to fade/restart or resume tracks;HandleBgMusicFinishedfor soft-loop replay. - State:
UAudioComponentfor current track, saved cursor (SavedCursorSeconds), suppression flag during map teardown.
UMIPClientSoundPlayer¶
- Base:
UMIPBasePlayerControllerComponent. - API:
Play2DUISound,SpawnSound2D,PlaySoundAtLocation,AddHitReactionSoundToPlayQueue(with throttling), plus bindings to inventory/equipment/exchange/life-skill events. - Life skill:
BindLifeSkillCraftingDelegates/UnbindLifeSkillCraftingDelegates; tracks per-recipe looping UI sounds during craft.
Integration¶
- Life Skills — crafting start/complete/cancel drives UI audio.
- Equipment — equip/unequip sounds.
- Exchange — trade feedback (see
MIPExchangeTypesusage in header).