AnimBP Tour #1

This AnimBP does not run any logic in its Event Graph. Logic in the Event Graph is processed on the Game Thread. Every tick, the Event Graph for each AnimBP must be run one after the other in sequence, which can be a performance bottleneck.

For this project, we’ve instead used the new BlueprintThreadsafeUpdateAnimation function (found in the MyBlueprint tab). Logic in BlueprintThreadsafeUpdateAnimation can be run in parallel for multiple AnimBP’s simultaneously, removing the overhead on the Game Thread.

AnimBP Tour #2

This function is primarily responsible for gathering game data and processing it into useful information for selecting and driving animations.

A caveat with Threadsafe functions is that we can’t directly access data from game objects like we can in the Event Graph. This is because other threads could be running at the same time and they could be changing that data. Instead, we use the Property Access system to access data. The Property Access system will copy the data automatically when it’s safe.

Here’s an example where we access the Pawn owner’s location (search for “Property Access” from the context menu).

AnimBP Tour #3

This Anim Graph does not reference any animations directly. It instead provides entry points for Montages and Linked Animation Layers to play poses at certain points in the graph. This graph’s main purpose is to blend those entry points together (e.g. blending upper and lower body poses together).

This approach allows us to only load animations when they’re needed. For example, a weapon will hold references to the required Montages and Linked Animation Layers, so that data will only be loaded when the weapon is loaded.

E.g. B_WeaponInstance_Shotgun holds references to Montages and Linked Animation Layers. That data will only be loaded when B_WeaponInstance_Shotgun is loaded.

B_WeaponInstance_Base is responsible for linking animation layers for weapons.

AnimBP Tour #4

This state machine handles the transitions between high level character states.

The behavior of each state is mostly handled by the layers in ABP_ItemAnimLayersBase.

AnimBP Tour #5

As with AnimBP_Mannequin_Base, this animbp performs its logic in BlueprintThreadSafeUpdateAnimation.

Also, this animbp can access data from AnimBP_Mannequin_Base using Property Access and the GetMainAnimBPThreadSafe function. An example is below.

AnimBP Tour #6

This animbp was authored to handle the logic for common weapon types, like Rifles and Pistols. If custom logic is needed (e.g. for a weapon like a bow), a different animbp could be authored that implements the ALI_ItemAnimLayers interface.