henkelmax / sound-physics-remastered

A Minecraft mod that provides realistic sound attenuation, reverberation, and absorption through blocks.
GNU General Public License v3.0
69 stars 22 forks source link

Breaking a large nether portal lags the game and ruptures your eardrums #198

Closed djmrFunnyMan closed 1 month ago

djmrFunnyMan commented 3 months ago

Bug description

Breaking a large nether portal fires tens of thousands of rays because it plays a sound for every single portal block. This lags your game and makes your ears bleed (I almost fell off my seat) 2024-03-19_14 46 36

Minecraft version

1.20.4

Mod version

1.20.4-1.3.1

Mod loader and version

Fabric Loader 0.15.7

Steps to reproduce

Build a large nether portal and destroy it (Specifically somewhere where there'd be a lot of reverb)

Expected behavior

In this situation there should be a limit on how many sounds can play at once. Just one portal block breaking sound should be enough. That'll stop it from lagging your game and being too loud.

Log files

https://gist.github.com/djmrFunnyMan/9ef56e9d5973af58a4c3fb9b452eb306

Videos

https://github.com/henkelmax/sound-physics-remastered/assets/68905776/81a9dca6-824d-4590-a1b7-228fcf54cee0

henkelmax commented 3 months ago

You can exclude that sound from having sound physics in the config. But this is technically working as intended since these sounds are actually played by the game.

djmrFunnyMan commented 3 months ago

Well then I suppose this is an enhancement suggestion, not a bug report.

henkelmax commented 3 months ago

What would be your suggestion on how to "fix" this? Because just putting the sound on a blacklist isn't a real solution.

djmrFunnyMan commented 3 months ago

Well I'm no programmer, but as I suggested, maybe add some limit that this sound can play only once per tick. That way it'd eliminate the nether portal problem since all these blocks break in a single tick, and it wouldn't affect normal gameplay in any way, since you can't break glass blocks that fast. (Assuming this cannot be restricted to nether_portal only and will have to affect the glass breaking sound in general, I don't know that after all)

henkelmax commented 3 months ago

Alright, thanks for that suggestion. I'll look into it.

peow commented 2 months ago

Breaking a large nether portal fires tens of thousands of rays because it plays a sound for every single portal block. This lags your game and makes your ears bleed (I almost fell off my seat)

you can use this mod: https://modrinth.com/mod/nicer-portals with this setting enabled: dedupeBreakSound: true|false - Whether to makes portals emit only one sound when they break. Client-side only.

henkelmax commented 1 month ago

I'm gonna close this as its not directly an issue with this mod. As @peow already said, there are already mods that fix this issue.