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

Performance Bottleneck #77

Closed haubna closed 1 year ago

haubna commented 1 year ago

A user reported to me that in combination with the Physics Mod + explosions they get huge lag spikes. I guess due to large amounts of sounds played (max. 2 per minecraft tick = 40 per second). I will lower the amount of sound effects that can be played when the sound physics remastered mod is installed so it reduces/eliminates the lag spikes but I thought I would share where the bottleneck is located with you.

Here is the spark profile: https://spark.lucko.me/5tap27zG76 stack

henkelmax commented 1 year ago

The mod is not designed to handle a lot of sounds at once. You should at all cost avoid a lot of repeating sounds. You can exclude sounds with a regex. The config entry is called sound_blacklist_regex.

There also are a lot of performance settings that you can adjust to increase the performance of the mod.

haubna commented 1 year ago

Yup I am aware of that. An API to play regular sound effects instead of raytraced ones for mod devs would be helpful (or a simple flag that you can set before playing block sound effects and then reenabling it after that).