Fixes/Changes suggestions in UE implementation [UE4.27, 2.02.07]



I’ve been extending some functionalities in the FMOD plugin for UE4 for my own purposes and noticed a few things that confused me a little bit. I’d like to ask about some of them and also suggest a few small mistakes I noticed in the code.
I’d like to point out that I’m using UE4.27 implementation with 2.02.07 version of FMOD, so there’s a chance my concerns might be outdated, but they might not.

  1. Why is UFMODAudioComponent::SetParameter method without bool bIgnoreSeekSpeed in the argument list by default? I find it weird, because having IgnoreSeekSpeed, even in Blueprint, is very useful.
    BTW, declaring SetParameter(FName Name, float Value, bool bIgnoreSeekSpeed = false) will be compatible with previous usage of SetParameter and won’t require developers to change anything in their implementation.
  2. Possible overlook: In UFMODAudioComponent::EndPlay(const EEndPlayReason::Type EndPlayReason) there’s no Super::EndPlay().
  3. Possible overlook: In FMODBlueprintStatics.h line #include “Kismet/BlueprintFunctionLibrary.h” is doubled.
  4. Possible overlook: In FMODBlueprintStatics.h you don’t need “class” in static class UFMODAudioComponent* PlayEventAttached method, because UFMODAudioComponent is already forward declared below the include paths.
  5. Have you thought about assigning variables to their default value in the class declarations? Like assigning nullptr to the pointers and, for example, zeros to floats or doubles etc. My friend, who is much better programmer than me, said that leaving those variables without default values in declaration or even constructor is a mistake and might be a cause of some problems.

Looking forward to your answer!

1 Like


Thank you for these suggestions and solutions. I will pass them on to our development team to look into further.

None of them have any particular reason other than simple mistakes. If you’d like to provide code as well I can point you toward our GitHub repo: GitHub - fmod/fmod-for-unreal: FMOD Studio integration with Unreal. where you can create pull requests with supplied code.

Thank you again,