in latest master (since 23. Feb. 2010, or 195a5e71fbe1c95e63dd466dd4f5eba957cb8364), spring uses OpenAL air absorption. Details can be seen here (straight forward, easy to understand code): http://github.com/spring/spring/commit/ ... a957cb8364
Effectively this means, in addition to decaying volume by distance, there is a low pass filter (also distance relative). So from far away, you will only hear the low frequency sounds. While the decay in volume does not happen when zooming out, just for (x,z) distance, the air-absorption uses the real 3D distance, so eg. laser sounds will not be hearable from far away, while explosions usually are still heard.
This is currently set to a fixed factor (0.1f). The reasons for the change are realism and to make the general sounds less annoying (additionally you could say for health, as high frequency sounds will damage the ears more over time, though... well ).
side note: as you can see from the code, this needs the ALC_EXT_EFX OpenAL extension to work, and there will be an warning message in infolog if your system/OpenAL version does not support this, though it will work for most modern distributions.
- I really couldn't hear the difference, and i was testing with a 24 by 24 map, used the sounds of thuds and llts firing.
Other stuff: - If I zoomed out all the way, I could hear all sounds on the map just as if I was zoomed in, even from areas that were out of view. Meaning the sounds didn't get neither quieter nor low-passed as I increased Y. Is this intentional? - If I zoomed in to normal view, I could only hear the sounds of stuff nearby, but also couldn't notice the low pass filter
Your avatar reminds of Mashed Potato Johnson btw :)
Joined: 24 Jun 2007, 07:34 Location: 50┬░ 56' N, 11┬░ 35' O
Beherith wrote:
- I really couldn't hear the difference, and i was testing with a 24 by 24 map, used the sounds of thuds and llts firing.
Me neither
Beherith wrote:
- If I zoomed out all the way, I could hear all sounds on the map just as if I was zoomed in, even from areas that were out of view. Meaning the sounds didn't get neither quieter nor low-passed as I increased Y. Is this intentional?
That it won't become quieter is intentional. But what I get from hoijui, it still should be low-passed.
On a somewhat related note, there should be a way to prevent being able to hear things that shouldn't be heard from across the map. For example, in the current spring you can easily guess the location of your opponent very early on in the game (most noticeably by the sounds of a lab building), because the sound is (as far as I know) only controlled by the position of your camera, not the position of your units. It'd be nice if sound volume was changed based on the location of your nearest unit, although I don't know how easy that would be to code or how well it would perform.
It's not a huge issue (it's not like it's hard to find the enemy with scouts), but it would be nice to have it fixed, to add some amount of unpredictability.
air absorption does use 3D distance, which includes zoom-out. volume uses a 2D distance (basically), this is nothing new though. the reason for this is, as i guess, so you do not have to manually adjust your speaker volume whenever you zoom in or out. this would be especially bad on big maps, where you TAB out while the game is quiet, adjust volume so you still hear stuff, and when battle starts, TAB right into the action -> BAWW! -> *heart attack* -> spring devs being sued -> community revolting -> civil war -> extinction of humanity -> NO MORE SPRING GAMES GETTING PLAYED!
On a related dev-note, these commits mute (ie. totally silence, regardless of volume) all sounds for me, which I can fix only by commenting the airAbsorption = factor assignment in SoundSource::SetAirAbsorption. Any value > 0.0 will cause this, so it seems alSourcef is broken / unimplemented for AL_AIR_ABSORPTION_FACTOR. Details if you need them:
Quote:
Sound: OpenAL info: Sound: Vendor: OpenAL Community Sound: Version: 1.1 Sound: Renderer: OpenAL Soft Sound: AL Extensions: AL_EXT_EXPONENT_DISTANCE AL_EXT_FLOAT32 AL_EXT_IMA4 AL_EXT_LINEAR_DISTANCE AL_EXT_MCFORMATS AL_EXT_OFFSET AL_LOKI_quadriphonic Sound: ALC Extensions: ALC_ENUMERATE_ALL_EXT ALC_ENUMERATION_EXT ALC_EXT_CAPTURE ALC_EXT_EFX Sound: Device: ALSA Software on default Sound: Available Devices: Sound: ALSA Software on default Sound: ALSA Software on Audigy 2 ZS [SB0350] Sound: ALSA Software on USB Device 0x46d:0x8d9 Sound: OSS Software Sound: Wave File Writer Sound: air absorption enabled, value: 0.1
if openal soft is only showing version "1.1" it's a really old version.
EFX was added to openal soft in 1.2, and I think I added the extended version info around 1.4 or so.
normally what I've seen done with binary apps in Linux, they provide their own libopenal.so.1 with their other libs (eg. SDL, stdc++). users that want to use the system openal can just rename the provided one, and it'll fall back to it.
Auswaschbar packaged OpenAL Soft with mingwlibs now, i do not know which version though, but.. this is likely to be the problem here (too old OpenAL versions).
about the last paragraph/sentence (libopenal.so.1): i would say it is not worth doing this for spring, just for air-absorption.
This idea sounds awesome, I hope it works for me on the next release.
But there are some infamous mappers who will grow angry at the use of air absorption because some maps don't have air. They will claim it ruins immersion and tramples on mapper's rights.
Users browsing this forum: No registered users and 1 guest
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum