# Co-op Two players get each other over what neither can climb alone. One holds a key to help: standing with solid floor in front, it braces for a boost; at an edge with a drop in front, it kneels and reaches down. The other just plays: a jump at the one bracing goes up off its hands, and a jump at the wall under the one kneeling is caught and pulled up. Nothing new is sent for it. Each machine finds the helper the same way it finds a ledge, from the characters around, so the boost and the pull are predicted on the owner and checked on the server like any other move. ## Helping Call **Set Helping** (`SetHelping(true)`) while the key is held and `SetHelping(false)` when it is let go, as for crouching. Only the owning player can ask. The example's character uses **E** (left shoulder on a gamepad). | Stance | When | What the other does | |---|---|---| | Boost | On the ground, nothing below **Reach Down Min Drop** (150 cm) in front of the feet | Runs at it and jumps within **Boost Reach** (90 cm) of it, coming at it from the front half. Goes up at **Boost Launch Speed** (850 cm/s, the feet about 3.7 m up) and on toward it at **Boost Forward Speed** (150 cm/s), to grab whatever it braces against | | Reach down | On the ground with a drop of at least **Reach Down Min Drop** in front | Jumps at the wall under it. In the air, a ledge up to **Reach Down Extra** (150 cm) higher than it could grab alone is caught, beside the helper, and it climbs on up by itself | The stance is taken the way the character faces, or the way it pushes: pushing toward an edge while helping turns it into a reach down there, and pushing away from it back into a brace. The helper stands still for as long as it helps, and jumping does nothing then. **Get Help Stance** says which stance it is in, the same on every machine. ## Who may help By default anyone helps anyone. To limit it (a team, a downed player), add the **Traversal Help Gate** interface to the character being helped and answer **Can Be Helped By** with the helper. Each machine asks it, so its answer has to be the same on all of them: decide it from replicated state. **Allow Helping** and **Allow Being Helped** turn each side off on a character. ## Events and animation | | | |---|---| | **On Help Given** | On the helper, on every machine, when its boost or pull is used. Its help kind says which | | **On Help Received** | On the one helped, on every machine that runs its moves | | **Help Boost Animation**, **Help Reach Down Animation** | Looped while in the stance | | **Help Boost Push Animation**, **Help Pull Animation** | Once on the helper when it is used, then back to the loop | | **Boosted Animation** | Once on the one boosted, as it goes up | Leave any of them empty and read **Get Help Stance** in your Animation Blueprint instead. The example map has a wall 480 cm high beside the start, out of reach alone: run two players (Play, Net Mode **Play As Listen Server** or **Play As Client**, 2 players) and take turns. ## Mover `UTRCCharacterMoverComponent` has it all: **Set Helping**, **Get Help Stance**, the events and two more modes, `TraversecraftHelpBoost` and `TraversecraftHelpReachDown`. The request to help goes to the server inside each move (`FTRCMoverHelpInputs`). A Character Mover Component of your own needs the two modes under **Movement Modes** (**TRC Mover Help Boost Mode**, **TRC Mover Help Reach Down Mode**, or run **Set Up for Traversecraft** on its Blueprint again) and **Set Helping** on its **TRC Mover Traversal Events** component. That component adds the request to each move by itself on Unreal Engine 5.7 and later. On 5.6 the Mover reads input from a single producer, so add `FTRCMoverHelpInputs` to the input your own producer makes. ## Measured Dedicated server and two clients, 150 ms of lag and 5% packet loss. Client B braces, client A runs at it and is boosted up a wall 480 cm high, then kneels at its edge and pulls B up. | | CMC | Mover | |---|---|---| | Runs with every step done | 4 of 4 | 4 of 4 | | Corrections on A | 0 to 9 per run, the largest 9.4 cm | no rollback | The corrections on A come in the grab after the boost: a grab in the air is looked for once a move, and a frame's difference in where it starts carries through the climb. The CMC no longer sends two frames in the air as one move, which took most of them away.