Skip to content

Add Japanese radio comms on hover select - #21

Open
wannerdev wants to merge 1 commit into
mainfrom
feature/japanese-radio-comms
Open

Add Japanese radio comms on hover select#21
wannerdev wants to merge 1 commit into
mainfrom
feature/japanese-radio-comms

Conversation

@wannerdev

Copy link
Copy Markdown
Owner

Description

Adds audio feedback that plays Japanese radio communications when hovering over and selecting satellites, enhancing the space theme and providing audio confirmation of selection.

Changes

  • Added RadioCommsPlaying component to track radio comms sound
  • Implemented play_radio_comms_on_hover system
  • Plays sound when satellite is selected (NavigationInstruments component added)
  • Uses Changed<NavigationInstruments> to detect selection events
  • Stops any previously playing radio comms before playing new one
  • Added necessary imports: Satellite, NavigationInstruments
  • Integrated into SoundPlugin update systems
  • Using warning_sound as placeholder (needs replacement with actual Japanese audio)

Audio Behavior

  • Trigger: When hovering over satellite (NavigationInstruments added)
  • Action: Plays Japanese radio comms sound
  • Cleanup: Stops previous radio comms if still playing
  • Frequency: Once per satellite selection
  • Duration: Plays to completion (DESPAWN setting)

Implementation Details

  • Queries satellites with Changed<NavigationInstruments> filter
  • Detects when NavigationInstruments component is added (selection event)
  • Despawns any existing RadioCommsPlaying entities first
  • Spawns new audio entity with RadioCommsPlaying tag
  • Uses PlaybackSettings::DESPAWN for automatic cleanup
  • Only processes first selection per frame (breaks after first)

Placeholder Audio

  • Current: Using warning_sound (beepx3.wav) as placeholder
  • TODO: Replace with actual Japanese radio communications audio
  • Recommended: Short Japanese voice clip (1-2 seconds)
  • Examples: "了解" (Ryōkai - Roger), "確認" (Kakunin - Confirmed), "接続" (Setsuzoku - Connected)
  • Format: WAV or OGG format
  • Location: Add to assets/sounds/ directory
  • Asset Loading: Add to SolarSystemAssets in src/sun_system/mod.rs

How to Replace Placeholder

  1. Add Japanese audio file to assets/sounds/japanese_comms.wav
  2. Load in SolarSystemAssets:
    japanese_comms: Handle<AudioSource>,
  3. Update asset loading:
    japanese_comms: asset_server.load("sounds/japanese_comms.wav"),
  4. Replace in play_radio_comms_on_hover:
    AudioPlayer::new(assets.japanese_comms.clone()),

Benefits

  • Enhances space/sci-fi atmosphere
  • Provides audio confirmation of satellite selection
  • Adds unique character to the game
  • Makes selection events more noticeable
  • Complements visual selection feedback
  • Adds immersive audio detail

Technical Details

  • Uses Bevy's change detection for efficiency
  • Only triggers on actual selection changes
  • Prevents audio overlap by stopping previous sounds
  • Automatic cleanup with DESPAWN setting
  • No performance impact (event-driven)
  • Works with both mouse hover and touch selection

Testing

  • Hover over satellite with mouse
  • Verify sound plays when satellite is selected
  • Hover over different satellite
  • Verify new sound plays and previous stops
  • Rapidly hover over multiple satellites
  • Verify sounds don't overlap or spam
  • Check that sound plays on both desktop and mobile

Future Enhancement

  • Replace placeholder with actual Japanese radio comms
  • Consider multiple voice clips for variety
  • Add different comms for different satellite types
  • Volume adjustment for radio comms

Related Issue

Fixes: Twitch Feedback - On hover select, some Japanese radio comms talk in the background

- Added RadioCommsPlaying component to track radio sound
- Implemented play_radio_comms_on_hover system
- Plays sound when satellite is selected (NavigationInstruments added)
- Uses Changed<NavigationInstruments> to detect selection events
- Stops previous radio comms before playing new one
- Using warning_sound as placeholder for Japanese radio comms
- TODO: Replace with actual Japanese radio comms audio file
- Integrated into SoundPlugin update systems
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant