Skip to content

Step 06: Player Saving

BavGames edited this page Jul 23, 2026 · 4 revisions

Players are saved separately from the world, keyed by a stable player id, so their data follows them across maps and sessions - in single player and multiplayer.

Setup

Add a Saveable Component to your player pawn and mark its variables (health, inventory) as SaveGame - exactly like any other actor. That is all.

image image

What is saved per player

  • PlayerState and PlayerController SaveGame variables
  • The full pawn record: SaveGame variables, saved components
  • Position, per map - inventory travels with the player, but where they stand belongs to each map (see below). Camera rotation is not saved; the view starts at the engine default.

PlayerController and PlayerState variables are automatic. Just mark them SaveGame - the player system captures and restores them keyed by the player id. A Saveable Component on the controller or player state does nothing (the world save ignores controllers entirely); the component belongs on the pawn and on ordinary world actors only.

Per-map positions

Each map keeps its own saved player position. Save in the Cave, travel to Town, save again - you can restore the player to where they stood in that map. How you apply that position depends on the Pawn Policy below (a manual teleport, or the body living in the world). A map with no saved position leaves the player at the PlayerStart.

Pawn policies

Set under Project Settings > Multiplayer > Player Pawn Policy. The two policies are two clear models - the pawn is either spawned fresh each time, or it lives in the world.

Restore Into Current Pawn (default)

The GameMode spawns and possesses its normal pawn; the save never spawns, possesses, or moves anything, and it does not touch the camera. The automatic load restores only the pawn's SaveGame data (variables, components) onto the pawn the player already controls. Right for session games, shooters, RPGs.

Position is yours to apply - so it never fights the engine's spawn flow. Two ways:

  • Restore Player Pawn (PlayerController) - one call that restores the data and teleports the pawn to its saved spot. Call it once the pawn exists, e.g. from the pawn's Begin Play.
  • Get Saved Player Transform (PlayerController) - returns the saved position; you teleport with your own Set Actor Location (e.g. in GameMode On Post Login).

Both nodes work straight from Begin Play even while an async Load Game is still reading the world - they read the saved position directly, so you never need a Delay or an On Load Completed binding to "wait for the load". In multiplayer, run them on the server (loads are server-only); the server's movement replication carries the pawn to its spot on every client.

The camera is left at the engine default (it is not saved or restored).

image

Persistent World Pawn (Survival)

The pawn lives in the world as a body: log off and the body stays (like ARK). It is a normal saved actor, so Load Game restores it with everything - class, transform, data. The save never pours into a fresh pawn here; instead you re-attach the player to their body.

  • Auto Possess Saved Pawn on: the body is possessed automatically, the fresh GameMode pawn is removed.
  • Off (default): you decide when, using Find Player Pawn (returns the body) and Possess Saved Player Pawn from Blueprint.
image

Which node for which policy: Persistent World Pawn -> Find Player Pawn (+ Possess Saved Player Pawn).

Players who leave are never lost

A player's state is snapshotted the moment they leave - quitting and connection loss look the same. Three layers make sure nothing is dropped:

  1. On logout the player's record (inventory, stats, position) is written straight into the active slot's player file (Save Players On Logout setting, on by default).
  2. Every save also keeps the records of players who are not connected - a world save made after someone left carries their last state forward instead of erasing it.
  3. If they rejoin the same session, they continue from their logout snapshot - no load required.

With Verbose Logging on, each snapshot is visible:

LogUSS: Player 'steam:7656...' left: their record was written to slot 'World1'.

There is one thing to know: the "active slot" is the last slot saved or loaded. A logout that happens before the very first save/load of the session is kept in memory and lands in the first save. Need a snapshot at another moment (e.g. after a big trade)? Call Save Player Record on the Save Subsystem.

Saving on quit

A save from GameMode End Play works: when the shutdown starts, the system snapshots the world (and the connected players) before any actor is torn down, and an End Play save writes that snapshot. Player data is additionally covered by the logout snapshots on its own. Prefer the synchronous nodes at quit (Save Game or Autosave Now (Synchronous = true)) so the write cannot be cut off by the process exiting.

Next: Step 07: Multiple Maps & Streaming

Clone this wiki locally