More features
Host migration
Keeping a match alive when the host leaves, and the honest limits of it.
A listen server match normally dies with its host. Host migration turns that into a pause: the session survives, someone else is elected, the match state comes back, and everyone travels to the new host.
What it does and does not do
It does: detect the host leaving, elect a replacement using Steam's own lobby ownership transfer, restore the state you gave it, travel the new host, and travel everyone else to them. It reports every phase so you can show the player what is happening instead of appearing to freeze.
It does not migrate actors, physics, AI or anything else living in your world. No plugin can. That state is yours and only you can serialize it.
The interruption is visible. Both hosts travel, which means a loading screen. Migration turns "the match ended" into "the match hiccuped". It is not seamless, and no listen server migration on any engine is.
Turning it on
Call Enable Host Migration on the SteamForge Host Migration subsystem. It is off by default.
| Input | Meaning |
|---|---|
| Enabled | On or off |
| Snapshot Interval Seconds | How often the host is asked for state |
| Timeout Seconds | How long to wait for a new host before giving up |
Publishing state
Bind On Snapshot Requested. It fires on the host at your chosen interval. Serialize whatever a new host would need, and pass it to Set Migration Snapshot.
A game that never answers this migrates successfully with no state, which is usually worse than a stale snapshot.
The snapshot has a Version field. It is handed back on restore so you can reject a snapshot written by a different build rather than deserialising garbage.
Check the exact limit with Get Max Snapshot Size.
The events
| Event | What to do |
|---|---|
| On Host Lost | Pause and show the player something. This is the moment their game stopped responding, and silence reads as a crash. |
| On Became Host | You were elected. Restore from the snapshot handed to you. |
| On Migration Phase Changed | Drive a "reconnecting" UI. |
| On Migration Finished | It ended, one way or the other. |
Get Migration Status gives you the phase, who was elected, whether it is you, seconds remaining and how many players are left. Cancel Migration abandons it, for a player who would rather quit than wait.