Skip to content

How to verify Motion multiplayer

Use this guide when Motion works locally and multiplayer verification is necessary. This procedure verifies replicated movement, Gameplay Ability System (GAS) state, and client prediction.

Necessary setup

  1. Make sure that the active GameMode uses a PlayerState that owns or exposes an Ability System Component (ASC). IAbilitySystemInterface is the preferred method. Motion can also find an ASC component directly.
  2. Make sure that the ASC replicates. Initialize it with the PlayerState or character as owner and the character as avatar.
  3. Make sure that Motion components find the ASC at runtime.
  4. Use GameplayEffects for replicated state tags. Treat loose tags as predicted or locally derived state, never replicated truth.

Run a local multiplayer PIE session

  1. In the Unreal Editor Play menu, set Number of Players to 2 or more.
  2. Set Net Mode to Play as Client.
  3. Disable single-process PIE when more realistic networking behavior is necessary.
  4. Select Play.
  5. Move, sprint, crouch, and jump on each client.

Simulate network conditions

Use console commands to add latency or packet loss:

bash
NetEmulation.PktLag 100
NetEmulation.PktLoss 2
NetEmulation.PktDup 1

You can also enable Network Emulation in Unreal Editor Preferences.

Network emulation editor preference

Inspect replication

Use these commands while the multiplayer behavior occurs:

bash
showdebug abilitysystem
stat net
p.NetShowCorrections 1
log LogMotionAbilitySystem Verbose

If tags or attributes do not synchronize, make sure that the server applies the applicable GameplayEffects.

Use the GAS overlay while you move a client. Make sure that tags, effects, and attributes are visible during the multiplayer run.

Symptoms

SymptomCheck
Movement does not syncThe ASC is replicated and initialized, and actor replication is enabled
Tags do not replicateState is granted by GameplayEffect, not only loose tags
Sprint or crouch flickersServer validation and prediction cleanup agree
A later jump stays held after a very short tapMake sure that the jump release gets to the server
Camera effects appear on remote clientsCamera effects are gated to locally controlled characters
Rubber-bandingServer validation tolerance and movement correction settings

Motion - Advanced First Person Character Controller