makamys / MAtmos

Minecraft Atmospheric sounds simulator (1.7.10, 1.12.2)
Other
27 stars 5 forks source link

Indoor/Outdoor transition is a bit slow #30

Open calreveraster opened 1 year ago

calreveraster commented 1 year ago

First off, thank you for this absolutely amazing mod. The sounds are nothing short of flawless. I love what you've done so far.

Not sure if this is really an issue, as I doubt it's the result of a code bug, but is more of an observation I wanted to point out.

When transitioning between indoors and outdoors, the sound effects take a second or two to change over. For example, if I run in and close the door, I'll keep hearing wind for about 2 seconds before it transitions to indoor noise

I'm using the 1.7.10 version of the mod, if that makes a difference. and the 2020 Zen sound pack.

I've also noticed that sound physics seems to help if I use the dynamic environment analysis feature, but sound physics comes with a host of other problems and the environment analysis is still pretty broken on the 1.7.10 port.

For reference, I'm also currently using Dynamic Surroundings and Sound Filters to try and create a cohesive sound experience. Everything is going well so far but because everything else is so clean, the transition latency stands out.

Thanks again for your work and for continuing to support 1.7.10 ^^

MagmaBro123 commented 1 year ago

Also noticed this.

calreveraster commented 1 year ago

Tentatively it seems like the issue arises because the system allows the entire sound to play to completion, so on longer loops like environment sounds, that can take some time before the transition occurs.

It might be a better option to immediately begin a 1/2 second linear fade-out as soon as the transition occurs.

That said, I know that something like sound physics has a flat scan of the environment every tick, whereas MAtmos seems to have the scan frequency deterministic based on what it's used for and how the sound pack chooses to implement those sounds.

So I think the point I'm trying to get at is this: is there a way within the sound pack to optimize when the scan happens so that it's frequent enough as to make the transition feel more responsive, or is this a larger issue with the way MAtmos fades in and out loops?

makamys commented 1 year ago

This happens because of how the algorithm I use to detect if you're indoors works. I shoot a few rays in random directions every tick and check how far away they land, and add up the results. This means the environment is scanned over multiple ticks rather than instantaneously, which is done to reduce the performance impact of scanning, but it does make it less responsive. I agree that this could use some improvement.

IIRC Dynamic Surroundings just checks what blocks are directly above your head, which is faster but not very accurate. Not sure about Sound Physics.

calreveraster commented 10 months ago

I'm only just now getting to catch up on github notifs, so sorry for the late reply here, but first off thank you for the explanation - wanted to toss some feedback out there on it from the perspective of a modpack guy working to make as clean of a modpack as humanly possible, and someone consequently chronically stuck to 1.7.10. Please do not consider this criticism, just more food for consideration for you.

I see in the soundpacks that there's a number of different qualifiers which check whether a sound can be played, based on the various update cycles for certain rays, so what you're saying makes sense - however, the current implementation of that approach makes it extremely noticeable under certain conditions. For example, transitioning from indoor to cave taking some time isn't a big deal - but transitioning from rainy outdoor to indoor taking 2-3 seconds is- same with transitioning from windy outdoor to indoor.

With that in mind, I see a column-based overhead in the zen back called "can rain on" - for checks like that, would it be possible to do the raycast each tick?

If the overhead check is done every tick then it would immediately disqualify a lot of sounds from playing that shouldnt play or should stop playing, and probably make the pack feel much more accurate.

the 3 second fade out for those things is also probably contributing to the issue as well - if a player crosses a threshold from rain, to no rain, and 1 second into the cross still hears 70% of the rain, they may feel like it's not updating in a timely way - though that fade out also probably helps cover up the fact that overhead isnt updating each tick, too, or else it would be more noticeable when the tick actually happens.

tl;dr could the overhead cast be done each tick (or could a configurable option be added to enable that functionality), so that sounds triggered based on that event could be faded out more rapidly? it would, in my opinion, make a major difference in immersion.