Skip to content

Fix various issues with sound movement and attenuation - #21

Open
Tisawesomeness wants to merge 7 commits into
gecolay:mainfrom
Tisawesomeness:fix/movement
Open

Fix various issues with sound movement and attenuation#21
Tisawesomeness wants to merge 7 commits into
gecolay:mainfrom
Tisawesomeness:fix/movement

Conversation

@Tisawesomeness

Copy link
Copy Markdown
Contributor

If a sound is playing at the player's position, moving quickly or turning your head can cause the sound to lag behind you, which is especially noticeable with long sounds such as portal wooshes. Sounds can instead follow the player as they move with Sound.Emitter.self(). However, since stereo works by modifying the location sound plays from, there is no easy way to let stereo sounds follow the player. So, this PR:

If a sound is playing at a jukebox (location jukebox sounds enabled), differences in attenuation distance (defined client-side in sounds.json) mean players far away from the jukebox can hear some instruments but not others. For example, note blocks can only be heard close to the jukebox, while portal wooshes can be heard far away, giving the illusion of "random" portal noises. To fix this issue, this PR:

  • Boosts all instrument volume by 1 + (range - 16) * 0.06 (same formula NBS datapack export uses) so quieter instruments can be heard across the entire jukebox range. Volume > 1 does not make the instrument any louder, but it does increase the attenuation distance.
  • Re-enables configuring jukebox range.
  • Sets the default jukebox volume to 100% since lower volumes cause instruments with lower attenuation distance to cut out earlier.

These changes fix several issues I've received from players and make the listening experience much more pleasant.

Also allows range setting to be used with locational sounds, fixes issues where note blocks cannot be heard but other sounds (portal wooshes) can
Jukebox volume 100 (should) allow all instruments to be heard inside the entire range
Fixes issues where boosting sound volume causes quiet instruments to be too loud. No auditory artifacts even at elytra speed.
@Tisawesomeness

Copy link
Copy Markdown
Contributor Author

Boosting all instrument volume means quiet notes in a song are just as loud as other notes when players are close to the jukebox. To fix this issue, Options.Jukebox.locational-close-to-player (default true, only effective when locational-sounds true) causes jukebox music to always play 8 blocks or less away from the player, in the direction of the jukebox. Both quiet and loud notes play at their intended volume regardless of how far away the player is from the jukebox.

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