thedocruby / resounding

A New Minecraft mod that provides realistic audio physics using parallel wave tracing and an improved physics algorithm.
https://thedocruby.dev/resounding
GNU Lesser General Public License v3.0
84 stars 4 forks source link

Block borders: incorrect reverb #38

Open YurgenSchn opened 2 years ago

YurgenSchn commented 2 years ago

Most of times, player sounds will have significantly less reverb while grounded compared to when flying of falling. I couldn't tell if this happens on the latest commit - more about that in the My Hypothesis section.

Expected behavior I think it is expected that footsteps have a bit shorter reverbs (not lower volume), but throwables and other sounds should have the same qualities of reverb regardless of me being grounded of flying.

To Reproduce

  1. Create a world with "reverbtest" seed on 1.18.1 (without quotes), using Resounding 1.0.0 alpha-3;
  2. Teleport to -35 -34 -800. A big cave with flat ground;
  3. Increase reverb volume to 1.0 and strength to 5.0. Increase Minecraft or PC volume if you need to hear it better;
  4. Walk, use snowballs, eat steak and fall from creative mode into survival. These are the sounds i used to test.

TESTS Test 1: Throw snowballs/eat steak on flat ground. Reverb is lower compared to when: flying (no matter how high), sneaking at (beyond) the edge of a block, or climbing/holding shift in a ladder; Test 2: Walk around and compare its reverb to a creeper walking (maybe create an amethyst patch on the ground). The player sounds, despite beign louder as a source, seem to have less reverb; Test 3: Stand in a less reflective block (even 1 block) such as wool or a tuff patch (there should be one naturally generated if you followed step 2). The reverb is MUCH quieter in these scenarios; Test 4: Go near a corner and make sounds. Even if it's just one block tall (the different Y levels in the cave), or in a 1x1x1 hole on the floor, reverbs go quieter too; Test 5: Picking up items on the floor doesnt seem affected by me - that is, me beign flying or grounded, and the materials imediately beneath me. Catching an item in the air doesnt produce louder reverbs than on the floor. But if the item is sitting on a less reflective block (wool), the grabbing sound will have less reverb (i guess this is expected). The same is partially the same for picking up arrow entities, except that the material beneath it doesn't change the reverb for the pickup sound. Test 6 (conducted on alpha-4): lighting TNT on ground produces very little reverb (on the hissy activation sound). The more blocks there are beneath it (the larger its "base area"), less reverb on activation. Test 7 (conducted on alpha-4): sounds made while standing on top of a fence pole don't have reverb volume issues, even running along a fence wall.

My Hypothesis In this alpha-3 version, short-tailed reverbs don't play. What might be happening is: these grounded player sounds may be preferentially filling lower reverb slots instead of longer ones correctly (something in raycasting or slot-filling processing), causing the perceived lowered volume. Why I think that? Because if you increase Reverb Strength to 10.0 or 20.0, all reverbs tend to become just as long, no matter the situation - even the bugged ones seem to be "fixed".

Update: while testing in alpha-4, these sounds still produce noticeably quieter reverbs. Thus, i think my hypothesis of such sounds preferentially filling up shorter-tailed reverb slots is wrong.

My Machine:

thedocruby commented 2 years ago

Apparently the issue is only fixed for footsteps.

mikenrafter commented 2 years ago

This seems to be a common problem, my hypothesis is that rays are getting started inside of block geometry, causing less geometrical accuracy, and resulting in over-occlusion, or misunderstandings surrounding reverb...

This could be solved by altering raytracing locations based on a tagging system. The issue with this is that there will be strange edge-cases with this approach.

Another solution would be to create some type of sound-emitter detection and false-positive filtering-system. This will (likely) be needed to properly apply the doppler effect, so it's worth looking into, I'm just not sure how one would go about this.

mikenrafter commented 2 years ago

This is a very in-depth write-up, thank you. There are just so many versions of this same bug in the issue tracker. All with slightly different circumstances. So I'm marking this as a duplicate - as to prevent new issues from surfacing over this same problem.