Traversal system¶
Traversal moves the character over obstacles: vault (over and land on the other side), hurdle (over and keep running), mantle (climb up onto). It is the Game Animation Sample traversal, shared by both pawns and triggered by jump and by vaulting from cover.
| Folder | /GASPALS/Systems/TraversalSystem |
| Components | AC_TraversalLogic (orchestration), AC_TraversalTracer (ledge measurement) |
| Preview actor | BP_TraversalTester |
| Choosers | /GASPALS/Characters/UEFN_Mannequin/Animations/Traversal/CHT_TraversalMontages_Mover, _CMC |
| Montages | Traversal/Vault, Hurdle, Mantle, Climb, Catch folders |
| Collision | The Traversable trace channel |
| Input | Space (jump) |
| Settings | Traversal reference |
How a traversal happens¶
flowchart LR
J[Jump pressed] --> CV{In cover?}
CV -->|facing away| Turn[Turn to the wall] --> T
CV -->|no| T[TryTraversalAction]
T --> Tr[Capsule trace<br>Traversable channel]
Tr --> L[Measure ledges<br>AC_TraversalTracer]
L --> R[Room checks]
R --> C[Chooser picks montage]
C --> P[Play montage<br>with motion warping]
T -->|nothing found| Jmp[Normal jump] - Trigger. Jump calls
TryTraversalActionwith inputs from the pawn'sGetTraversalCheckInputs: a trace forward whose length grows with speed (on the ground) or a short trace (in the air). In cover, the cover system first turns the character to the wall (RequestCoverVault). Held jump keeps retrying every frame. - Find the obstacle. A capsule trace on the Traversable channel. No hit: the pawn jumps instead.
- Measure it.
AC_TraversalTracerfinds the front ledge, checks the width (Min Ledge Width, 70 cm), and finds the back ledge and the floor behind. - Room checks. Capsule traces check the character fits on top of the front ledge and between the ledges. They give the obstacle height and depth, and whether there is a back ledge and a back floor.
- Pick the montage. The chooser (
CHT_TraversalMontages_Moveror_CMC) gets the action type, ledge data, height, depth, distance, movement mode, gait, speed and the pose history, and returns a montage with a start time and play rate. No match: the pawn jumps. - Play it. The montage plays with motion warping targets
FrontLedge,BackLedgeandBackFloor, so the animation lands exactly on the measured ledges. During the montage the character ignores the obstacle's collision and moves in flying mode; afterwards it returns to falling (vault) or walking.
Mover and CMC¶
| Mover pawn | CMC pawn | |
|---|---|---|
| Montage playback | Mover's montage support (root motion through the movement modes) | Anim instance montage with root motion |
| Movement mode during the move | Flying (queued) | MOVE_Flying |
| Replication behavior | Prediction handles it | Client-authoritative position during the move |
| Can traverse when | On the ground or in the air, no montage playing, not already traversing | Not already traversing |
Set Is Mover Character on AC_TraversalLogic to match the pawn (on for Mover pawns): it selects the chooser and the movement path.
Networking¶
The owner predicts: it runs the checks and plays the montage at once, then sends the result to the server (PerformTraversalAction_Server, reliable). The server plays it too, except for a pawn it controls locally (a listen-server host, a standalone player or a server AI), which already started the move itself, so every traversal starts once. Other machines see the montage through the movement component's montage replication. AC_TraversalLogic has Component Replicates on in both sample pawns.
Debugging¶
| Tool | Shows |
|---|---|
DDCvar.Traversal.DrawDebugLevel 1 | Ledge points |
... 2 | Plus the initial trace |
... 3 | Plus the room checks and printed ledge data |
DDCvar.Traversal.DrawDebugDuration | How long the shapes stay |
BP_TraversalTester | Place it in a level: it previews the tracer in the editor without playing |
Show Trace / Persistent Show Trace on AC_TraversalTracer | Tracer debug lines |
Settings¶
AC_TraversalTracer:
| Setting | Default | Use |
|---|---|---|
| Min Ledge Width | 70 | Narrowest traversable ledge. |
| Min Front Ledge Depth | 37.52 | Depth of the width check into the obstacle. |
| Trace Complex | true | Trace complex collision for the ledges. |
| Show Trace / Persistent Show Trace | false | Debug drawing. |
AC_TraversalLogic: Is Mover Character. The trace lengths and capsule sizes are in each pawn's GetTraversalCheckInputs.
Requirements¶
- Obstacles must block the Traversable channel. See Make objects traversable.
- The montages' motion warping windows must be named
FrontLedge,BackLedgeandBackFloor. - The pawn implements
Get_PropertiesForTraversal(capsule, mesh, motion warping component, mode, gait, speed) andGetTraversalCheckInputs.
Limitations¶
- Only geometry on the Traversable channel is considered; everything else is jumped.
- Very thin or narrow obstacles (under Min Ledge Width) are not traversed.
- In first person the view turns toward the ledge during the move when it is more than 15 degrees off.