bibendovsky / bstone

Unofficial source port for Blake Stone series
Other
298 stars 33 forks source link

Use linear distance model for audio #425

Closed bibendovsky closed 2 years ago

bibendovsky commented 2 years ago

Test builds: bstone-bin-win32-v1.2.12-wip-fec30e4d0262fb162ed915e35ec93248e2f8495e.zip bstone-bin-win64-v1.2.12-wip-fec30e4d0262fb162ed915e35ec93248e2f8495e.zip

Linear distance model parameters (see p.3.4.4 of OpenAL 1.1 Specification): Min distance: 2.0 Max distance 8.0 Rolloff factor: 0.9 The gain outside of max distance: 0.1

mrmatteastwood commented 2 years ago

Tested this real quick on my laptop with built-in stereo speakers and I get the impression the volume fluctuations have greatly improved. Awesome!

XBRZ still doesn't work though, and the game crashes right after dying (as mentioned in two other bug reports).

I'll be more than happy to test this again on my desktop PC in 7.1 surround on Monday, when I'm back from vacation.

mrmatteastwood commented 2 years ago

@bibendovsky Checked again on my desktop using 7.1 sound and my home theatre system. I do think the volume fluctuations have dramatically improved, though the digitized (Sound Blaster) SFX still seem softer than some Adlib effects, e.g. when pushing a wall, trying to open a locked door or dying.

Also, it feels a bit like the sounds fade fast over short distances, i.e., they become fairly quiet even when the emitter (an enemy for example) is not far away.

bibendovsky commented 2 years ago

Test builds: bstone-bin-win32-v1.2.12-wip-c9c4641b37d23ca42fda58301e7640a1c2e9ffc4.zip bstone-bin-win64-v1.2.12-wip-c9c4641b37d23ca42fda58301e7640a1c2e9ffc4.zip

Updated attenuation to match the vanilla one. Note, that since OpenAL does not provide API to alter the mixing it will sound quieter comparing to SDL.