Skip to content

Networking

Every GASPALS system works on a listen server with clients. This page summarizes what replicates and how, so you can extend the systems without breaking it. Blueprint-only replication follows a few patterns, used throughout.

Patterns

Owner predicts, server confirms. The owning client applies a change immediately, then tells the server with a reliable Server RPC. The server sets a replicated variable, and other machines apply it in its RepNotify. Equipment, overlays and the camera perspective work this way.

Movement goes through the movement component. On the Mover pawn, anything that affects movement is part of the input command the owner sends: cover data, crouch, gait, ragdoll requests. Mover simulates it on the owner and the server and replays it on simulated proxies, so no extra replication is needed. On the CMC pawn, the owner shapes its acceleration, which the CMC replicates (p.EnableCharacterAccelerationReplication=1), and extra state travels in RPCs and replicated variables.

Montages play where they must. Root-motion montages (traversal, interactions, get-ups) are played on the server and the owner. Mover syncs a server-played montage to simulated proxies; the CMC replicates root-motion montages itself.

Cosmetics on every machine. Visual reactions (ragdoll physics profiles, sounds, first-person visibility) run on every machine from replicated state or mode changes, not from RPCs.

By system

System What replicates How
Locomotion (Mover) Movement, crouch, gait, rotation mode Mover input commands with Network Prediction (DefaultNetworkPrediction.ini). Simulated proxies get the inputs (bSyncInputsForSimProxy).
Locomotion (CMC) Movement, crouch The CMC. The input state (CharacterInputState) is sent to the server with an RPC and replicated to others.
Cover (Mover) Cover state Part of the Mover input (S_MoverCustomInputs_Cover).
Cover (CMC) Cover state, facing Owner-shaped acceleration, plus a 20 Hz server RPC (ServerUpdateCover) and replicated cover state applied on other machines.
Aim from cover Result only Runs on the owner; others see position, crouch and facing.
Equipment Selected item Replicated with RepNotify; every machine spawns the item locally. Client sends a reliable Server RPC.
Overlay Overlay pose and body Replicated with RepNotify; reliable Server RPC from clients.
Camera Perspective Server RPC; replicated to other machines (skip owner). Style and shoulder are local.
First person Nothing Owner-only meshes; other players see the third-person character.
Traversal The traversal action Owner predicts, reliable Server RPC with the result, server plays it; Mover and CMC sync the montage to others. The server does not replay it for a pawn it controls locally, so a listen-server host, a standalone player or a server AI starts each traversal once.
Ragdoll (CMC) Start and stop Reliable Server RPC, then a reliable multicast.
Ragdoll (Mover pawn) Enter, exit, roll, get-up choice Mover input (S_MoverCustomInputs_Ragdoll), with the injury state replicated. Remote ragdolls are pulled toward the replicated capsule.
Takedowns, shoves The interaction Client predicts its own montage and asks the server, which validates and multicasts.
Visual override The character class Replicated with RepNotify on the manager component.
Pawn switch The pawn class Server RPC from the controller; the game mode respawns players.

Testing multiplayer

  1. In the Play options, set Number of Players to 2 and Net Mode to Play As Listen Server.
  2. Test on both pawns (N), since they replicate differently.
  3. Watch the client and the server windows: equipment, overlays, cover, traversal and ragdoll should look the same on both.
  4. For the Mover pawn, np.PrintReconciles 1 prints prediction corrections. A handful at events like a takedown is expected; continuous corrections are not.
  5. Use Network Emulation (in the editor's Play settings) with some latency and packet loss to see how the prediction holds up.

Rules for your own additions

  • Mover: change movement only through the input command and transitions. QueueNextMode from gameplay code runs on one machine only.
  • Never call RPCs every frame for continuous state; send it in the movement input (Mover) or at a fixed rate (the CMC cover sends 20 times a second).
  • Components that use RPCs or replicated variables need Component Replicates on the pawn's component.
  • Make cosmetic reactions run from replicated state so late joiners see them too.

Known gaps

  • The CMC pawn shows small corrections (2 to 4 cm) at sticky cover edge stops and corners.

The camera, traversal, equipment, overlay and visual override components have Component Replicates on in both sample pawns. If you build your own pawn, turn it on for them too.