Attenuation for 3rd person cammera

Hey! How can I achive the effect described in the video using Unreal? The goal here would be to have a component, that the attenuation is being calculated from. The question is actually more if it’s possible without making changes into fmod source itself?

http://www.gdcvault.com/play/1022060/How-to-Write-an-Audio - 17:34 (Listeners part)

1 Like

At the moment it looks like you would have to make some changes to the integration source code. Although I believe it should be just a matter of changing the FMODAudioComponent position to be relative to the listener instead of the absolute world position. You would need to do the calculations, as mentioned in the video, but it should be fairly straight forward to do.

You can attach the UE4 listener to the camera using SetAudioListenerOverride, which is what FMOD uses for the listener position. Then use the player position as the attenuation position to calculate the new position of the sound. In the FMODAudioComponent we use the GetComponentTransform’s location as the position to give to FMOD, you could intercept this and use the new camera relative position instead.

This is something we could look at adding to the integration in the future that could be enabled by a setting.

This is something we could look at adding to the integration in the future that could be enabled by a setting.

Yes, please.

Unreal has SetAudioListenerAttenuationOverride which does exactly this for Unreal’s build in sound system.
Since FMOD already uses SetAudioListenerOverride, it could also just implement the usage of SetAudioListenerAttenuationOverride.

Any chance this feature will be added soon?

I’ve digged into the plugin’s code but found it’s pretty hard to inject properly: there should be 2 different positions – 1st for the listenere, to calculate the 3d effects/stereo/etc, 2nd is purely for the attenuation purposes.

I can’t find how to use these 2 separate positions in the plugin’s code…

p.s. for the context, I’m working on a top-down game where the camera is pretty far from the ground/characters

This is currently scheduled for the July release, rather than doing all the work in the UE4 integration, we have decided to add this functionality to the API and then implement in our integrations.

4 Likes

Will this feature be available with the UE 4.23 plugin release? or not yet?

After further investigation, this feature will need to be added in a new major version of FMOD because the information in the spatializer will change and not be compatible with the current spatializer.

1 Like

A bit late to the party but this is my go to tip for 3rd person listener : https://www.youtube.com/watch?v=KBzHTX-9BvE

Is this feature already in the current fmod release?

In 2.01.00 a new argument was added to Studio::System::setListenerAttributes which allows you to specify a separate attenuation position.

Although at this point it doesn’t look like the functionality has been added to the UE4 integration, I have bumped the task for adding this to see if we can get it added sooner.

2 Likes

Has this been implemented in the UE4 plugin yet? I’m hoping to be able to do this in the character blueprint just like you would use setaudiolistenerattenuationoverride as @Shanyu described.

Unfortunately this has not been implemented yet, I have bumped the task again and suggested raising its priority.

1 Like

Thanks for the update! :slightly_smiling_face:

Hey Jeff, we got the attenuation on the character and the spacialization on the camera, but for some reason the camera is triggering my reverb audio volumes instead of the character so if the character passes through a door, the reverb doesn’t engage until the camera enters the room. Any ideas on how to fix this?

Sounds like you might need to tweak the collision settings on your character and camera, removing collisions on the camera and making sure they are enabled on your player character.

1 Like

Hey dshodge, just wondering how you got the attenuation to be on the character?

I’ve tried UE’s “set audio listener attenuation override” node, but it doesn’t seem to change anything. I’m guessing because it’s setting the Native UE listener, or I’m just doing something wrong.

Cheers

Hey afrech, so sorry I missed this before, but you can find my current solution in my technical reel. It’s basically setting the audio listener override using a tick event in the character blueprint. You can pause the video around 2:50 to see how I did it. https://youtu.be/e33BYpZWaRo?si=2fNQ2_wiyZs1zyHO&t=168

2 Likes