C++ Framework functions that are implemented in BP

There are many important functions that in their implementation simply call a “BP” handler, a function that is waiting to be implemented in BP. For example NotifyActorBeginOverlap. How does it work? Where is the implementation defined in BP for that assumption? It adds a lot of darkness to the understanding of the system.


It’s generated by UHT when function has BlueprintImplementableEvent.

UE4 C++ compilation is tool assisted, all those UPROPERTY, UCLASS etc. macros are in reality empty and ignored by compiler (i mean it simply pastes nothingness on those places). Before compilation starts UnrealBuildTool (tool that manages compilation) runs UnrealHeaderTool (UHT) that parses the header files in search of those macros, read there specifier content and parse functions or variables after them, based on that it generates extra code that is placed in Intermediate folder (it *.generated.h per feder file and extra .genrated.cpp file per module) and compiled together with your code.

It mainly registers function, varables etc, all code structure to reflection system, without that tool you would need to do this manually because C/C++ is low level, compiles directly to CPU machine code and strips code from any structural information, there for code reproducibility to track that and UE4 does that with UnrealHeaderTool to make things easier.

But this tool also have extra features like auto implementation of functions so you don’t need to do repetitive implementations, so if you either to BlueprintImplmentabaleEvent, BlueprintNativeEvent it will generate extra code that will call function in blueprint in VM. in case of BlueprintNativeEvent it will also generate decleration of FunctionName_Implementaion to add C++ code to blueprint event.

This method has a draw back, since it block C++ programmer to redeclere and redefine those functions as generated code occupies those, to market C++ functions to be used and overrided more straight forward for C++ programmer, they needed to create this work around. Generally you should not even touch Notify or Receive functions, or else you do some weird override that you want to wipe entire base code from execution and you want blueprint call to still to work.

You seem to be interested in trying to call Blueprint function, normally (and thats what generated code does too) you get UFunction representing function in Blueprint and call ProcessEvent for example

I recomed you to explore UField classes as object of those classes are created by UHT generated class to store information about them, it part of reflection system and Blueprint VM use that make calls to native code.