Archived on 2026-10-24. The Godot rewrite is cancelled. Migration decisions and work checklists below are withdrawn. Original claims, code examples, file paths, and completion statements have not all been revalidated. Use the current documentation and issue register for maintenance decisions.
Audio And Feedback Analysis¶
Purpose¶
This system covers music, sound effects, footstep audio, UI sounds, damage popups, hit flashes, announcements, particles, and tweened UI feedback.
Current Unity Implementation¶
Main scripts:
| Path | Script | Role |
|---|---|---|
Assets/Script/TinyChaos/Services/Audio/AudioService.cs |
AudioService |
Runtime audio service with music/effect/footstep sources. |
Assets/Script/Game/Resources/AudioResources.cs |
AudioResources |
Singleton MonoBehaviour holding AudioClip references. |
Assets/Script/Game/Resources/AbilityResources.cs |
AbilityResources |
Singleton holding shared ability/effect prefabs. |
Assets/Script/Game/Resources/UIResourceProvider.cs |
UIResourceProvider |
Static loader for UI colors/icons/materials/damage popup. |
Assets/Script/Shared/ScriptableObjects/UIResourcesConfig.cs |
UIResourcesConfig |
UI colors, rarity icons, gradients, damage popup prefab, damaged material. |
Assets/Script/Game/Stage/DamagePopUp.cs |
DamagePopUp |
Floating damage text animation. |
Assets/Script/Game/Utilities/Announcer.cs |
Announcer |
Special/miniboss/bonus announcements. |
Assets/Script/Shared/Entity.cs |
Entity |
Damage blink and damaged material handling. |
Assets/Script/Game/Managers/GameManager.cs |
GameManager |
Damage popup cap, reward particles, game-over audio stopping. |
Key Data¶
AudioService:
- Hidden root object
[AudioService]. - One looping music source.
- One effect source.
- Four looping footstep sources.
lastPlayedTimedictionary to prevent sound stacking.- Save volume writes through
Save.
AudioResources:
- BGM clips.
- Reward/card/game-over clips.
- Potion clips.
- Ability clips.
- Button/UI clips.
- Tutorial, creep, miniboss, boss clips.
UIResourcesConfig:
- Rarity icons/colors.
- Unlock/locked colors.
- Rainbow/star/Neo Sword gradients.
- Damage popup prefab.
- Damaged material.
- Difficulty icons.
Runtime Flow¶
ServicesRoot.InitializeServices()createsAudioService.AudioResourcespersists as a singleton and provides clip references.- Systems call:
Game.Audio.PlayMusic(clip)Game.Audio.PlaySound(clip, stackingDelay)Game.Audio.PlaySoundOnPause(clip)- footstep assign/stop/volume methods.
AudioService.PlaySound()suppresses repeated clips within a stacking delay usingTime.time.- Damage feedback:
Enemy.TakeDamage()pulls aDamagePopUpfrom pool if damage indicators are enabled.DamagePopUp.DamageText()colors text by damage type and runs DOTween animation.GameManager.HardLimitPopUpDamage()caps active popups usingSave.DamageIndicatorLimit.- Entity feedback:
Entity.BlinkOnDamage()swaps damaged material briefly.- Player/enemy scripts spawn blood/particle effects.
- Reward/UI feedback uses DOTween for cards, bars, gates, panels, and chest displays.
Dependencies¶
AudioServicedepends onSavefor volume persistence.- Gameplay scripts depend on
AudioResources.Instance. - Feedback spawning depends on
PoolManager. - UI feedback depends heavily on DOTween.
UIResourceProviderusesResources.Load<UIResourcesConfig>("UIResources").
Problems / Risks¶
- Audio clip references are globally accessed through a singleton resource holder.
AudioService.ApplyVolumeFirstTime()initially sets all volumes andAudioListener.volumeto 0; later settings must reapply them. If settings load fails, audio may stay muted.PlaySoundOnPause()setseffectSource.clipandPlay(), notPlayOneShot, so rapid paused UI sounds can interrupt each other.- Damage popup throttling happens after popup spawn.
- DOTween calls are spread through gameplay managers and UI code.
- Feedback code is embedded in damage/gameplay scripts instead of routed through a feedback layer.
Migration Notes for Godot¶
Preserve:
- Audio categories: music, sfx, footstep.
- Volume settings and save behavior.
- Anti-stacking behavior for repeated sound clips.
- Damage type colors: normal, crit, magic, supercrit, poison.
- Damage popup cap setting.
- Reward/game-over/announcement feedback timing where player-facing.
Redesign:
AudioService
- autoload
- named buses: Master, Music, SFX, Footstep
- play_sfx(id, cooldown_key = id)
- play_music(id)
FeedbackService
- damage popups
- hit flash requests
- announcements
- screen/UI effects
ResourceCatalog
- maps ids to audio/visual resources
Do not copy:
- Audio singleton object with hidden Unity
AudioSources. - Direct clip references scattered through gameplay scripts.
- Popup cap after spawn; enforce before or within popup pool.
Open Questions¶
- Which Unity audio mixer/bus settings exist outside the inspected scripts?
- Whether all audio clips should be referenced by ids in Godot resources.
- Whether damage popup limit should be global or per-player/per-screen.
- Unknown / needs manual confirmation.