OreCruncher / DynamicSurroundingsFabric

Dynamic Surroundings mod for Minecraft
MIT License
62 stars 25 forks source link

[1.20.x] No elytra sounds when flying #80

Closed MotMomet closed 5 months ago

MotMomet commented 5 months ago

I just noticed while playing there is no sounds with elytra. I tried to open minecraft without dsurround and then i was able the hear the elytra sounds. Then i thought is there a mod that makes this when both installed? well no i tried to using only dsurround and fabric api in my modpack but there is still no elytra sounds. Is there a quick way to fix this? like removing something from mod resourcepack like sound or editing config files?

OreCruncher commented 5 months ago

I am not aware of anything in my mod that would prevent it. Will have to look into it. Is the modpack available online somewhere?

EDIT: Think I found it. I will do more testing and work on a fix. DS has logic that calculates the distance to where a sound is being played. This only applies to sounds that aren't global, music, etc. It looks like the elytra sound has linear attenuation (meaning volume decreases over distance), with a sound origin of 0, 0, 0. Go figure. DS will cancel the sound play for any sounds that are considered too far to hear in order to reduce client load.

EDIT2: Rant on Minecraft code. The elytra sound handling is similar to entity bound sound handling. Problem is that elytra sound handling does not initialize the coords during construction whereas entity bound sounds do. Not sure why the elytra sound processing didn't inherit from entity sound handling.

EDIT3: You can disable sound pruning in the configuration options. This will tell DS not to cancel sounds that are too far to play.

MotMomet commented 5 months ago

Thanks for the reply and informations. And about modpack its a custom one i made. If you still need it i can upload for you. I'll try to do what you said on EDIT3 tomorrow, also if i do the EDIT3, is it going to affect my game experience too much? or is it like going to disable some of features?

OreCruncher commented 5 months ago

No, I don't need the modpack at this point. I was able to identify the issue testing in one of my test environments. As for turning of sound pruning it shouldn't affect game experience. I added this feature because sometimes mods will cause sounds that are outside of hearing range, and depending on the quantity it could impact client-side performance.

OreCruncher commented 5 months ago

Pushed update to CurseForge and Modrinth. CurseForge is dragging its feet per usual.