Overlay system¶
An overlay is a pose layered on top of locomotion. The legs keep walking, running and turning with motion matching; the overlay decides how the upper body is held: a rifle at the ready, a torch held up, a box carried in both arms, hands tied, an injured stance. This is the layering approach of the Advanced Locomotion System (ALS), on the Game Animation Sample.
There are two independent overlays:
- Overlay pose: what the character holds or how it holds itself. Item poses come from the equipment system; stance poses (Default, Injured, HandsTied) from the overlay menu.
- Overlay body: a body style applied to the whole figure: Default, Masculine, Feminine.
| Folder | /GASPALS/Systems/OverlaySystem |
| Component | AC_OverlaySystem (on both pawns) |
| Interface | BPI_OverlaySystem (RefreshOverlayPose, used by the equipment system) |
| Layer interfaces | OverlayPose/ALI_OverlayPose, OverlayBody/ALI_OverlayBody, FirstPerson/ALI_OverlayFirstPerson |
| Pose Anim Blueprints | OverlayPose/ABP_OverlayPose_Base and children OverlayPose/<Name>/ABP_Overlay_<Name> |
| Body Anim Blueprints | OverlayBody/ABP_OverlayBody_Base and children OverlayBody/<Style>/ABP_OverlayBody_<Style> (Default, Masculine, Feminine) |
| First-person poses | FirstPerson/ABP_OverlayFirstPerson_Base and children (Rifle, Pistol2H, Pistol1H, Bow) |
| Data | Data/Struct_OverlayCurves (pose + curve map), OverlayPose/Enum_OverlayPose, OverlayBody/Enum_OverlayBody |
| Blending | ABP_LayerBlending (linked into both character Anim Blueprints) |
| Menus | Widgets/OverlayPose/W_Switcher_Pose, Widgets/OverlayBody/W_Switcher_Body |
| Input | V or gamepad Menu (hold, pose menu), B (hold, body menu, keyboard only), mouse wheel / D-pad up / down to move the highlight. |
| Settings | Overlay reference |
How it works¶
The character Anim Blueprints call two linked anim layers, OverlayPose and OverlayBody. Which Anim Blueprint implements them is decided at runtime with Link Anim Class Layers on the character mesh:
AC_OverlaySystemlinks the class its Overlay Pose Layers map gives for the selected stance (ABP_Overlay_Default,_Injured,_HandsTied), and the class from Overlay Body Layers for the body (ABP_OverlayBody_<Style>). A value with no row, or a row with no class, links nothing: the mesh keeps its layers and an orange warning names the pawn and the value.AC_EquipmentSystemlinks the item's pose (ABP_Overlay_Rifle...) from its data asset.
The last link wins: equipping an item replaces a stance pose, and choosing a stance in the menu replaces the item pose. With nothing in hand (Unequip), the equipment system applies the selected stance instead of a pose of its own, so an Overlay Pose set on the pawn's component shows at spawn and comes back when the item is put away.
Overlay changes are instant (no transition animation plays). Each linked Anim Blueprint outputs a pose; ABP_LayerBlending blends it onto locomotion per body part using curves. See Animation pipeline for where this sits in the full graph.
The pawn sets the component up at start (Overlay_Initialize > InitializeSystem with the third-person mesh). The component can be turned off with Enable Overlay or deleted from the pawn; see System switches.
Pose Anim Blueprints¶
ABP_OverlayPose_Base holds the logic; its children only hold data. A state machine (SM_OverlayPose) chooses between three states:
| State | Meaning | Enters when |
|---|---|---|
| Relaxed | Item lowered | Start state. From Ready: when sprinting, after Ready Hold Time Moving (2 s) in Ready while moving, or after Ready Hold Time Idle (3 s) in Ready. |
| Ready | Item raised, not aiming | From Relaxed: aim pressed (and not sprinting). From Aiming: aim released or sprint, after at least Aim Min Time (0.75 s) of aiming. |
| Aiming | Aiming | From Ready: aim held, once Ready is a quarter blended in. |
With Can Aim off (box, barrel, default and the stance poses), the machine stays in Relaxed. Within each state, the pose is picked by stance (stand, crouch) and speed:
| Variable (class defaults of the child) | Used for |
|---|---|
Stand_Relax_Idle, _Walk, _Run, Stand_Relax_Sprint | Standing, relaxed |
Stand_Ready_Idle, _Walk, _Run | Standing, ready |
Stand_Aim_Idle, _Walk, _Run | Standing, aiming |
Crouch_Relax_Idle, _Move; Crouch_Ready_Idle, _Move; Crouch_Aim_Idle, _Move | Crouched |
Stand_Aim_Sweep, Crouch_Aim_Sweep | Additive aim sweep: arms up and down with the aim pitch |
Each pose variable is a Struct_OverlayCurves with two fields: Overlay Pose (an animation) and Curve Map (curve name to value). The Anim Blueprint plays the animation's first frame as a still pose, so a single-frame animation is enough. It writes the curve map onto the pose, and ABP_LayerBlending reads those curves.
Curves¶
The curve map decides how much of the body each pose takes over. Names are lowercase:
| Curve | 0 | 1 |
|---|---|---|
layering_legs, layering_pelvis | Locomotion legs and pelvis | Overlay legs and pelvis (carry stances) |
layering_spine | Locomotion spine | Overlay spine |
layering_spine_add | No additive | Locomotion spine motion added on top |
layering_head, layering_head_add | Locomotion head | Overlay head / additive |
layering_arm_l, layering_arm_r | Locomotion arm | Overlay arm |
layering_arm_l_add, layering_arm_r_add | No additive | Arm swing added on top of the overlay arm |
layering_arm_l_ls, layering_arm_r_ls | Arm in mesh space (keeps its aim while the spine moves) | Arm in local space (follows the spine) |
layering_hand_l, layering_hand_r | Locomotion fingers | Overlay fingers |
enable_handik_l, enable_handik_r | Hand IK off | Hand IK to the item's HandIK socket |
enable_cr_aimoffset | Aim offset rig off | Aim offset rig on |
disable_cr_aimoffset_pitch, _yaw | Axis on | Axis off |
A curve that neither the map nor the animation sets is 0. Two shipped examples:
- Rifle, ready (
Stand_Ready_Idle):layering_pelvis,layering_spine,layering_spine_add,layering_head_add, both arms, both hands andlayering_legsat 1;layering_arm_r_ls0.5;enable_handik_l1 (support hand on the handguard). The head, the arm additives andlayering_arm_l_lsstay at 0. - Box (every pose), Injured and HandsTied:
layering_pelvis,layering_spine,layering_spine_add,layering_head, both arms, both arms'_ls, both hands andlayering_legsat 1;layering_head_add0.5; no arm additives and no hand IK.
Aim sweep¶
While aiming, the arms follow the camera pitch through the aim sweep additive, blended by AimSweepValue (the pitch from +90 to -90 degrees mapped to 0..1). Aim Sweep Interp Speed Local (0) and Remote (10) set how fast it follows on the owning machine and on others. 0 means no interpolation: the owning player's arms follow the camera pitch exactly (interpolating there makes the weapon lag behind the view and step while turning). See Animation pipeline.
An aim sweep animation (for example OverlayPose/Rifle/AO_Rifle_Stand_Sweep) is 1 second long: aiming straight up at the start, level in the middle, straight down at the end. AimSweepValue is the time it is sampled at. Its additive settings are Additive Anim Type Mesh Space and Base Pose Type Selected animation frame (the middle, level frame).
Body Anim Blueprints¶
ABP_OverlayBody_Base picks one of four poses by stance and movement: Pose Stand Idle, Pose Stand Move, Pose Crouch Idle, Pose Crouch Move. The children set those four animations: ABP_OverlayBody_Default uses BasePoses/Pose_Base_Stand and Pose_Base_Crouch; Masculine and Feminine use their own Pose_<Style>_Stand and Pose_<Style>_Crouch (one pose for idle and moving).
First-person poses¶
ABP_OverlayFirstPerson_Base has the same pose variables (without the aim sweeps) for the first-person arms, with curves for the first-person rigs. The equipment data's Overlay Pose FP links it. See First person.
The menus¶
Hold V (pose) or B (body): the world slows to Menu Time Dilation (0.35), the Overlay Pose Menu Widget Class / Overlay Body Menu Widget Class opens with one entry per enum value, mouse wheel up or D-pad up moves the highlight up the list and down moves it down (wrapping at the ends), and releasing the key selects it. As with the equipment menu, the component keeps the highlight (HighlightedOverlayPose / HighlightedOverlayBody) and the widgets only read it, so a replacement widget only has to display it. The entries come from Enum_OverlayPose (Default, Injured, HandsTied) and Enum_OverlayBody (Default, Masculine, Feminine); a new enum entry appears automatically.
If the pawn is destroyed while a menu is open, the component's EndPlay calls CloseOverlayMenus: it closes both menus, removes their widgets and sets the world speed back to normal.
Shipped overlays¶
| Overlay pose | Can aim | First-person version |
|---|---|---|
ABP_Overlay_Default | no | |
ABP_Overlay_Injured | no | |
ABP_Overlay_HandsTied | no | |
ABP_Overlay_Rifle | yes | ABP_OverlayFirstPerson_Rifle |
ABP_Overlay_Pistol1H | yes | ABP_OverlayFirstPerson_Pistol1H |
ABP_Overlay_Pistol2H | yes | ABP_OverlayFirstPerson_Pistol2H |
ABP_Overlay_Bow | yes | ABP_OverlayFirstPerson_Bow |
ABP_Overlay_Torch | yes | |
ABP_Overlay_Binoculars | yes | |
ABP_Overlay_Box | no | |
ABP_Overlay_Barrel | no |
ABP_Overlay_Default sets no pose and no curves, so it adds nothing: plain locomotion. Injured holds one hand to the side and HandsTied keeps the hands behind the back. Their relaxed standing poses use Pose_Injured_Stand / Pose_HandsTied_Stand and their relaxed crouch poses Pose_Injured_Crouch / Pose_HandsTied_Crouch, with the same layering curve values as the box. They are complete examples of a stance overlay: see Add an overlay state. Pistol1H is the one-handed pose set of the Revolver item.
Settings¶
| Where | Setting | Default |
|---|---|---|
AC_OverlaySystem | Enable Overlay | true. Off: the pawn keeps the default pose and body and the overlay menus do nothing. Read at start. |
AC_OverlaySystem | Overlay Pose | Default (the starting stance) |
AC_OverlaySystem | Overlay Body | Default (the starting body style) |
AC_OverlaySystem | Overlay Pose Layers | Default, Injured, HandsTied > their ABP_Overlay_* |
AC_OverlaySystem | Overlay Body Layers | Default, Masculine, Feminine > their ABP_OverlayBody_* |
AC_OverlaySystem | Overlay Pose Menu Widget Class / Overlay Body Menu Widget Class | W_Switcher_Pose / W_Switcher_Body |
AC_OverlaySystem | Menu Time Dilation | 0.35 (world speed while a menu is open; 1 = no slow motion) |
ABP_OverlayPose_Base and its children | Can Aim | per overlay (see Shipped overlays) |
ABP_OverlayPose_Base and its children | Ready Hold Time Idle / Moving, Aim Min Time | 3 / 2 / 0.75 s. A very large hold time keeps the item raised. |
ABP_OverlayPose_Base and its children | Aim Sweep Interp Speed Local / Remote | 0 / 10 |
| Pose children | pose variables and aim sweeps | per overlay |
| Body children | the four body poses | per style |
The component settings are under Overlay in the Details panel of the component (select AC_OverlaySystem in the pawn Blueprint); the Anim Blueprint settings are in each child's Class Defaults.
Networking¶
Overlay Pose and Overlay Body are replicated with RepNotify. The owner changes them locally and sends a reliable Server RPC; every machine links the Anim Blueprints in the RepNotify. Test with a listen server and a client (see Networking).
Limitations¶
- The menus slow the whole world while open. Time dilation is global: on a listen server, the host's menu slows every player.
- An item's pose replaces the stance while the item is held (see How it works).
- The stance poses (Default, Injured, HandsTied) and the item poses share the pose layer, so a stance and an item cannot be combined.
- Adding a value to
Enum_OverlayPoseneeds a row with a class in Overlay Pose Layers (otherwise the warning OverlayPoseLayers has no anim layer class for <pose> shows and the layers are unchanged). - Variables added to
ABP_OverlayPose_Basedo not reach existing children's class defaults: set them on each child. - All overlay animations are authored on the UEFN mannequin skeleton; other characters copy or retarget the final pose (see Characters and visual overrides).