Animation Design


In the game development, the animation part is different between game projects because we have different skeletons for different types of game. Therefore, the animation part is hard to be included in the universal framework.

In our project, we directly adjust the animation content of Lyra to adapt our framework design. In this document, we explain the design and usage of animation blueprints in Lyra Demo, so as to make you have more clear understanding of this part and then apply or extend it for your own project.


1 Lyra Animation Design


1.1 Animation Blueprint Design


The structure of Lyra animation blueprint design is given below.

lyraanim


Key parts of the design:

  • Using animation blueprint linking to uncouple different animation blueprint of different character states, such as unarmed state and holding pistol. The benifit of this design is that you can use one animation layer blueprint to config all related animations for one specific state.

  • ALI_ItemAnimLayers: The animation layer interface includes the animation interfaces, which should be implemented in the animation layer blueprint.

animif


  • ABP_Mannequin_Base: The basic animation blueprint includes the common state machines to control the animation of character. Add the animation layer interface (ALI_ItemAnimLayers) for this animation blueprint and leave the interfaces unimplemented, unless the interface is universal for different animation layers. Anywhere, these interfaces will be used inside the anim graph.

animbase


  • ABP_ItemAnimLayersBase: This is the basic animation layer blueprint which is mainly use to implement the interfaces of ALI_ItemAnimLayers and add the animation configuration properties for different states. For the specific animation layer, just create a child blueprint from this basic blupeint and config these properties.

animlayerbp


  • Finally, create child blueprints from ABP_ItemAnimLayersBase for different states and call the function LinkAnimClassLayers to change the animation layer as follow.

layerusage


1.2 Animation State Alias


To simplify the animation state machine, you can use the State Alias in state machine desgin. We cite the description of unreal engine offical document as follow.

  • As you build more complicated State Machines with many states and ways to transition between them, you may want to use state aliases to improve your graph. State aliases are shortcut-type nodes you can add to your State Machine to reduce line clutter, consolidate transitions, and improve the readability of your graph.

stateal


The above state machine requires the land and locomotion states to transition to both the jump and fall loop states. In this case, we can add a state alias for these states.

The animation bluprint of Lyra also used this state alias to simplify the animation state machine.


2 USGT Animation Design


2.1 Using Animation Blueprint Linking


The animation blueprint linking is very good design or idea for animation application in the game development. We cite the description of unreal engine offical document Using Animation Blueprint Linking as follow.

  • The Animation Blueprint Linking system is an extension of Sub Anim Instances. It enables dynamic switching of sub-sections on an Animation Graph, making possible both multi-user-collaboration and memory savings, as the Animation Blueprint will no longer load animation assets that are not in use.

In our project, we directly adjust the animation content of Lyra to adapt our framework design. We mainly use the idea of animation blueprint linking for the animation in different systems, it means that we use animation layers blueprints to config different animations for the character.


2.2 Animation Extension


After learning the structure of Lyra animation from section 1, you can customize it by yourself or adpat it for your own project.

Firstly, you can modify the state machine here.

animbasemd


Secondly, you can change the character states source to your own character logic.

animbasech


Finally, modify the ABP_ItemAnimLayersBass blueprint to add new animation configurations for your requirement.

animlayerbpmd


References


[1] Animation State Machines

[2] Using Animation Blueprint Linking