Vai ai contenuti
File multimediali per l'articolo Momentum - Predicted Movement Abilities (Multiplayer): 1
0 commenti

Descrizione

Try it first: free playable Windows demo, no Unreal Engine needed. Sprint, dash, slide and wall run next to a bot at 150 ms of ping with Momentum, then the same abilities done the usual way through a server RPC, and feel the difference: https://drive.google.com/file/d/1cb1PvOvEgPJ1c7iozCYyyvYhyCI8eMjU/view

Momentum adds network-predicted movement abilities to Unreal Engine's CharacterMovementComponent: dash, sprint, slide and wall-run out of the box, and your own abilities with a few lines of C++.

Abilities run inside the movement update, on the owning client and on the server, with the same input. They are predicted exactly like walking: no RPCs and no rubber-banding, and they keep working when packets are lost. You stay on Epic's stack, so your character, animation blueprint, AI and Gameplay Ability System keep working as they are.

Measured in the included test setup (dedicated server, two bot clients running the same sprints and dashes for two minutes):

• 150 ms ping on a perfect connection: both 0 corrections (the RPC approach only breaks when packets are lost or delayed unevenly, which real connections do).

• 150 ms ping with 3% packet loss: RPC approach 93 corrections, Momentum 13 (half of them 0 cm follow-ups).

• 150 ms ping, 3% loss and 30 ms jitter: RPC approach 115, Momentum 24.

What you get

• UMomentumMovementComponent: a drop-in replacement for CharacterMovementComponent with up to 8 data-driven abilities, configured in the details panel.

• Sprint, Dash (ground and air, charges), Slide (keeps speed downhill, steerable) and Wall Run (with wall jump), each with its own settings.

• Correct prediction: ability input travels with every move, ability states are saved and replayed, and the server sends its ability states with every correction so cooldowns and charges never drift.

• Lost-move reconstruction: when client moves are lost, the server rebuilds the gap the way the client moved instead of starting dashes early.

• Ready-to-play MomentumCharacter: third-person camera and a built-in keyboard, mouse and gamepad layout, so it plays with no assets.

• Gameplay Ability System bridge: Momentum Gameplay Ability (pulse or hold) and a Tag Sync component that mirrors active abilities as gameplay tags on every machine.

• Events for animation and effects (OnAbilityStarted / OnAbilityEnded, also on simulated proxies; never during replays).

• Diagnostics: momentum.Debug draws states above characters; momentum.LogCorrections explains every correction (real error, velocity error, movement mode and which ability states disagreed).

• Extensible: derive from UMomentumAbility and override SimulateTick, PhysCustom or OverrideCalcVelocity.

• MomentumLab demo project (download link in the version notes): test arena, tutorial-style RPC character for comparison, HUD with ping and corrections, and a repeatable bot.

Requirements and limits

• Unreal Engine 5.6, 5.7 and 5.8. Dedicated and listen servers.

• C++ is optional for using it (Blueprint characters can reparent to MomentumCharacter); custom abilities are written in C++.

• Mover 2.0 is not supported yet. Root motion montages during an active Momentum ability are not supported.

• Under heavy packet loss some corrections are unavoidable; Momentum keeps them rare and small.

Documentation and support

The included README covers setup (three options), every ability setting, custom abilities, networking details and debugging. Support: [email protected]

Formati inclusi