Storm Game Framework 2.0.0
User guide
Loading...
Searching...
No Matches
Multiplayer and networking

SGF is built for multiplayer games that use Unreal's server-client model. The server decides what happens. Clients ask for changes and show the result once it replicates. This page explains that model and where each module fits.

Terms used on this page

  • The server runs the authoritative game. In standalone play the only machine is the server.
  • A machine has authority over an actor when its version is the one that counts. For gameplay that is the server. See authority.
  • The owner, or owning client, is the player's machine that controls an actor, such as the player's own character. See owner.
  • A copy is the version of an actor on one machine: the server's, the owner's or another client's. See copy.

The server owns gameplay state

Inventory, equipment, weapons, abilities, interaction, spawning, AI and saving all change only on the server. Their operations check authority when they run, and refuse with a failure result on a machine without it.

StormSpawn, StormRoster and StormPopulation refuse every change on a client. They check the world's network mode rather than an actor's role, because an actor spawned locally on a client reports authority over itself. StormCoordination also refuses changes on a client.

Module The server decides A client asks with
StormInventory Item stacks, quantities and grid placement. RequestMovePlacement, when the server allows owner placement.
StormEquipment Which item instance occupies each slot. RequestEquipItem, RequestMoveEquippedItem and RequestUnequipItem.
StormInventoryEquipmentAdapter Moves between an inventory cell and an equipment slot. RequestEquipFromPlacement and RequestUnequipToPlacement.
StormInteraction Whether an interaction happens. The interactor is always the component's owner, resolved on the server. RequestInteract.
StormAbilities Granting abilities and applying effects. Ability activation through the Gameplay Ability System.
StormWeapons Shot acceptance, ammunition, reloads and hit delivery. Your game's own request, such as a Gameplay Ability. StormWeapons has no RPC.
StormDeployables Arming, release, spending supply and spawning live grenades. The grenade component's arm and release requests.
StormTraversalNativeAdapter Whether a crossing starts, and its result. A request to cross an opportunity or the nearest ready one.
StormAI and StormAIActions States and action selection. Nothing. AI runs on the server only.
StormSave Capturing and restoring the world. Nothing. Clients receive restored state through ordinary replication.

How a client request works

Equipment, inventory placement, the inventory-equipment coordinator and interaction share one pattern.

  1. The client calls a Request… function with what it observed, such as the item instance, its cell and the slot's current occupant.
  2. On a client, a successful return means only that the request was sent. It is not the outcome.
  3. The server repeats every check against its own state. A request based on state that has since changed is refused, not repaired.
  4. The server's result arrives in a completion event: OnEquipmentRequestCompleted, OnPlacementRequestCompleted, the coordinator's OnRequestCompleted or OnInteractionResult. On the server the event fires at once. On the owning client it arrives by a client RPC.
  5. Update your display from the replicated state, and use the result's failure tag to explain a refusal.

Owner requests are closed by default, so adding a component never exposes changes by accident. These policies belong to the server: set them on the component, and the server's values decide.

  • Owner Managed Slots on the equipment component lists the slots an owner may address. It starts empty.
  • Allow Owner Requested Replacement and Allow Owner Requested Unequip let an owner replace or remove the occupant it observed. Both start off.
  • Allow Owner Requested Placement on the inventory lets an owner rearrange its cells. It starts off.

See Inspect server results and equipment requests for a worked example.

What replicates

  • Inventory and equipment. The player inventory replicates its items and their placement. Equipment replicates its occupied slots and its slot layout, so a client's copy offers the same slots as the server's.
  • Characters. The Humanoid replicates its readiness and its control mode. Its first-person profile goes to the owner only. Its ability system uses mixed effect replication.
  • Appearance and body. The committed appearance replicates to every copy, and each rendering machine loads and applies it. The state of each body region, such as whether it has come off, replicates too.
  • Animation. The native animation component replicates its selections, action records and look. The native movement replicates gait, rotation mode, mantles, traversal motion and movement restrictions.
  • Weapons. The weapon component replicates one owner-only correction snapshot. Other players never learn your magazine count.
  • Grenades. The live grenade replicates its state and a detonation cue for effects on each client.
  • TimeStop. The server publishes each effect. Other machines follow the server's clock and end the effect by their own.
  • Not replicated. AI decisions, roster membership, weapon item leases and save documents stay on the server. Present to clients whatever they need through state your game replicates.

Client prediction

Most requests wait for the server. These systems act on the owner first, then accept the server's correction.

  • Character movement. UStormNativeCharacterMovement extends Unreal's character movement with predicted gaits and rotation modes and opt-in ledge mantling. The owner predicts and the server corrects. Movement restrictions replicate to every copy, and the owner predicts with them once they arrive, so a change can cost one small correction. Use the same movement defaults on every machine. See Native animation and the native Humanoid.
  • Animation actions. An owner can predict an action or motion only when the server has authorised it in Owner Action Templates or Owner Motion Templates. See Overlays, actions and motion.
  • Abilities. Abilities follow the Gameplay Ability System's net execution policies. A locally predicted ability runs on the owner first. For a server-executed ability, StormAbilities tracks each press and tells the owner when the server has answered.
  • Weapons. A client tags each attempt with its own correlation ID. TryGetPredictionOutcome maps that ID to the shot the server accepted or refused, and the owner-only correction snapshot brings the client's view back in line. A listen server's own player is corrected by the same path.
  • TimeStop movement. The TimeStop character movement component adds the server's account of each move to the movement response, so the owner's predicted and replayed moves use the time scale the server applied.

Listen servers and dedicated servers

SGF distinguishes standalone, listen-server, dedicated-server and client roles.

A dedicated server keeps the gameplay state and skips presentation:

  • Appearance still validates and replicates the committed appearance, but loads no character art and applies nothing.
  • Held items record what each character holds but create no presentation actors.
  • Body presentation builds nothing, and IK nodes pass the pose through.
  • Audio, the loading screen and player settings do nothing.

A listen server is the server and a local player at once:

  • A level switch through StormLevels keeps a listen server hosting, so connected clients travel with it.
  • The loading screen's destination announcement reaches the host's own player locally, because the host has no connection to send to. Host and clients then run the same presentation code.
  • The host's weapon view is corrected by the same code as a remote client's.

To test, run Play in Editor with a listen server and a client, or with a client against a separate server. Each process has its own console variable values, so inspect a value on the machine doing the work. See Console variables and debug commands.

Late joiners

A player who joins after something started receives its current replicated state, not a replay of what happened.

  • Native animation, hit reactions and ragdolls publish records that every copy follows. A late joiner joins a server-started action or reaction at its age on the server's clock, and ragdoll events fire for a late joiner too.
  • Appearance and equipment arrive as their current replicated state.
  • The body region state records whether a part came off by itself or with its parent, so a late joiner can rebuild a damaged character without replaying effects for hits it never saw.
  • Each audio directed-state snapshot is enough to rebuild the state after a late join. One-off directed events sent earlier are not replayed.

Local-only systems

These run on each player's machine and do not replicate:

  • StormUI creates a layout for each local player and routes that player's screens.
  • Loading screen presentation runs only in a process that can render.
  • StormSettings reads and writes the local player's settings.
  • Audio playback runs on each listening machine.
  • The editor tools, including Storm Dashboard, never run in a game.

Configuration SGF supplies

The plugin's Config/Engine.ini turns on push-model replication (net.IsPushModelEnabled), so replicated properties are sent only when the server marks them changed. It also turns on packed character movement RPCs (p.NetUsePackedMovementRPCs), which the listen server's view smoothing relies on.

Check your multiplayer setup

  1. Make the actors that carry SGF components replicate, with the correct network owner. StormWeapons, for example, does not configure its owning actor.
  2. Open the owner request policies you need on the server's copy of each component.
  3. Drive the display from replicated state and completion events, not from a client's local return value.
  4. Test with two Play in Editor players, then in a packaged build, including late join and map travel if your game uses them.

For limits that affect networking, see Requirements and limits. For common problems, see Troubleshooting and FAQ.