Skip to main content
Blueprint

Blueprint Overview

Everything you need for host migration works without C++.

State​

Tick SaveGame on Blueprint variables (variable details → Advanced → SaveGame). They travel like UPROPERTY(SaveGame) in C++, on actors and components alike, including object references to other migrated actors.

Add the Host Migration Id component to every actor that should survive.

Subsystem​

Get it with Get HostMigrationSubsystem (it's a GameInstance subsystem).

NodeWhat it does
Leave SessionLeave the match. On the host, hands it over first.
Quit GameQuit the game. On the host, hands it over first. Use instead of the engine's Quit Game.
Begin Graceful MigrationHost: send a final snapshot and tell everyone to migrate now.
Get StateCurrent state.
Is MigratingTrue during an active migration or while a graceful handover is pending. In the latter case, Get State can still return Running.
Is Local HostTrue on the machine that hosts.
Get EpochIncreases with each migration.
Get Status TextLocalized status line for UI.
Get Num Players AwaitedPlayers the new host is still waiting for.
Get Host AddressAddress of the current host.
Find Host In Lobby (out Host Address, Epoch)For players not connected yet: where the current host is. Call this node on the execution path and branch on its return value before using the outputs.
Set Local Player Can HostClient: set whether this player is eligible to become the next host. Call after the local PlayerController receives the migration client component. See Choosing the successor.
Get Num Inactive PlayersHost: players whose state is kept for a rejoin.
Get Snapshot StatsHost: snapshot sizes and traffic.
Notify Game ReadyWith Wait For Game Ready: the game has set up the match, the new host can restore. See Games that set up the match later.
Is Restore PendingNew host: the map is loaded but the saved state is not restored yet.
Kick Player (Player Controller, Reason)Host: remove a player. The client does not rejoin or migrate. See Kicked players.
Was Removed By HostClient: this machine was kicked from the match.
Is Migration Network Failure (Failure Type)True when a network failure starts or belongs to a migration. See Session plugins.
To Restored World Time (Saved World Time)New host: converts a world time saved on the old host to this world's clock. See World time.
Get Migrated World Time OffsetNew host: the difference between the old and the new world clock.
Get Last Failure ReasonWhy the last migration failed, as a short English text for logs. See When a migration fails.
Set Reconnect URL Options (Options)Client: URL options to send when reconnecting to a new host, e.g. ?Team=2. Replaces Reconnect URL Options from the settings. See Connecting to the new host.
Move Party To Host (Host Address)Host: move every client to the host at this address, then follow them. Use it to bring your players into another match. A client that cannot connect ends up in Failed. The players stay in the old lobby: have them join the new host's lobby once they arrive, so migrations work there (see EOS and Steam).

Move Party To Host on the Host Migration subsystem, called only when Is Local Host is true

The subsystem also exposes Save Snapshot To Slot, Does Saved Snapshot Exist, Host From Saved Snapshot, and Delete Saved Snapshot. See Saved snapshots for return values and an example menu flow.

Subsystem events​

EventWhen
On State Changed (Old State, New State)Every state change, on every machine.
On Player Restored (Player Controller)Host: a returning player got their state back.
On Host Changed (Host Id, Host Address, Is Local Host, Epoch)The session has a new host. Use it to update lobby data or rich presence.
On Host Connection Lost (Reason)Host: this machine seems to have lost its own connection. Steam or EOS reports it logged off, or at least two clients and all of them timed out within 5 seconds. The clients migrate without it; show a message or return to the menu.
On Snapshot Too Large (Snapshot Bytes, Max Snapshot Bytes)Host: a full snapshot went over Max Snapshot Bytes and is not sent. See Snapshot traffic.
On Removed By Host (Reason)Client: the host kicked this player.
On Migration Failed (Reason)A migration could not be completed. With Travel On Failure off, handle it here. See When a migration fails.

Bind them in your GameInstance (Event Init). A migration loads the map again, which destroys actors and widgets together with the events bound in them.

GameInstance Event Init binding On State Changed, On Host Changed and On Player Restored, each printing what happened

Library nodes​

NodeWhat it does
Get Migration IdThe id that identifies an actor across migrations.
Find Actor By Migration IdThe actor that carries an id now.
Is Host Migration In ProgressSame as Is Migrating, from any world context.
Is Migration HostTrue on the machine that hosts.
Is Host Migration Network Failure (Failure Type)Same as Is Migration Network Failure, from any world context.
Unique Net Id To StringThe string form used for player ids.
Set Debug Overlay VisibleShows or hides the debug overlay.
Save TimerCapture the active state, remaining time and rate of a timer. Supply whether it loops.
Get Saved Timer RemainingGet the captured remaining time in seconds.
Is Saved Timer ActiveCheck whether the timer was active when captured.

See Restoring timers for a Blueprint example.

Steam​

Get Steam Lobby returns the lobby in use, or an empty string if there is none or the Steam adapter is not active. Set Steam Lobby overrides the detected lobby. Both work from any Blueprint. See Steam.

EOS​

Get EOS Lobby returns the lobby in use, or an empty string if there is none or the EOS adapter is not active. Set EOS Lobby overrides the detected lobby. Both work from any Blueprint. See EOS.

States​

EHostMigrationState, returned by Get State and passed to On State Changed.

StateMeaning
RunningNormal play.
ElectingThe host was lost; picking a successor.
BecomingHostThis machine is the successor and is loading the map.
WaitingForHostWaiting for the successor to announce itself.
ReconnectingConnecting to the new host.
GracePeriodNew host: waiting for previous players.
RejoiningHostConnection dropped but the host is still in the session; reconnecting to it.
FailedThe migration did not succeed.