Jump to content

Sound traveling Upwards or The Haunted Mansion


tony Liberatto

Recommended Posts

So after a lot of work, I finish the exterior of my Medieval House. There is still a lot to do to decorate and small touches here and there.

The only issue, there is a cave under the house, One of those drop down caves that look like a well. 

Going down to level -59 I finally found the source of the never-ending, day and night growling of the Drifters.

I would understand if the Drifters were 16 blocks down, but 60 is a little extreme.

The question is: Could we have sound behave Up and down the same way that it behaves horizontally?

 

2018-02-26_00-50-43.png

Link to comment
Share on other sites

It's in the server, so, no way for me to go in creative.

I will look through. 

Sorry I did not fully understand your answer:

1 hour ago, Tyron said:

There's no mechanic in the game that would make the sound travel further or shorter vertically. Perhaps you can verify your findings in creative mode. 

You mean that the sound is uniform vertically, and only considers horizontal distances, which is what I thought?

Or that the sound travels the same distance vertically as it does horizontally?  Meaning a sound produced 16 deep in a straight line will have the same volume as a sound produced 16 blocks far in the same level?

BTW, just for curiosity could you share some of those numbers? And are they dynamically generated having the player distance and position in consideration? Will the sound be higher on my right speaker if the sound is coming from that direction? Does the sound gradually fade as it gets farther or it is just one volume and suddenly stops after so many blocks?

 

Link to comment
Share on other sites

Sound does increase and decrease with distance, but can have a fairly dramatic cutoff point.  This is most apparent with lava.  One block nothing, the next block fairly loud lava.  I think the range is around 24 blocks or something, it's pretty significant.  I feel like drifters have a more tapered cutoff point, where you can just barely hear them before they're gone.

Link to comment
Share on other sites

That's true.  Maybe it's a general liquids problem.  With the way mining works, I think it's really important that the player be able to use sound to find caverns, if they're blind mining.  I've been trying to sound-locate whenever I get the opportunity, but sometimes it's really hit and miss.  I find myself wishing there were some device that I could like, place against the side of the tunnel, and it would amplify any sounds in a cone outward from that point, while diminishing sounds in other directions.  One of the most furstrating parts of trying to find a sound is when you've close, but it might be above or below.

Link to comment
Share on other sites

I meant the sound travels the same distance in every direction. I can share the numbers, but you might not understand all of it, OpenAL is really weird with sound attenuation. This is the current distance model and its parameters

// See also https://www.openal.org/documentation/openal-1.1-specification.pdf page 25
float rf = -(float)(Math.Log(0.01f) / Math.Log(soundParams.Range));
AL.DistanceModel(ALDistanceModel.ExponentDistanceClamped);
AL.Source(sourceId, ALSourcef.RolloffFactor, rf);
AL.Source(sourceId, ALSourcef.ReferenceDistance, 3);
AL.Source(sourceId, ALSourcef.MaxDistance, 9999f);

Most sounds are direction dependent, yes. So a left sound source should be in your left speaker. Sound does attenuate gradually and it's range is sound specific. That is why you can hear wolf howls from very far away. Redram correctly identified the liquid ambient sound cut off as a problem localized to the liquids, this is due to the limited scanning range of nearby blocks, which is like 36 blocks or so. A linear increase of the scanning range means your client has a quadratic amounts more blocks to scan every tick, so i tried to keep that number low. Might be optimizable in the future. Also the ambient sound system needs improvement, it tends to play at a high volume where it shouldn't

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.