Persistent Sessions¶
This four-panel example demonstrates session/input ownership and selected Character IDs across lobby → game → lobby, with scene-local Ready. It is a UI/context example, not a movement, combat or production gameplay scene. See Player scope for framework capacity and Chapter 3 — Setup Wizard for setup.
Open and run¶
Use Configure Supplied Samples to register Persistent Sessions. Open Assets/LevelArgento/CouchCoopBuilder/Prototypes/Persistent/PersistentLobbyPrototype.unity, then enter Play Mode. The sample creates one persistent bootstrap only when none exists. Join using default lobby controls; navigate each player's panel independently.
The lobby includes its own Persistent Sample Catalog (Assets/LevelArgento/CouchCoopBuilder/Prototypes/Persistent/PersistentSampleCatalog.asset), which reuses the shipped Astral Capsule and Neon Cube character definitions and preview prefabs. The character selector requires a valid catalog; replace the sample catalog on the lobby's PersistentScenePrototype with your own to browse different characters. Confirm each joined player, then focus START GAME and submit; the lobby requires all joined players Ready with available input. The game shows RETURN TO LOBBY, without a Ready label. Confirm it to return.
What persists¶
Session ID, zero-based Player Index, input role/slot, InputUser and selected Character ID persist. Each session keeps its corresponding panel across scene transitions; gaps do not compact. Intentional Leave ends that session and frees its seat/slot. The next Join can use the lowest available seat; survivors retain theirs. Physical Device Lost keeps the existing reservation.
Ready is scene-local and resets when the lobby is reconstructed. Navigation changes preview focus only; confirmation commits selection and Ready. Returning reconstructs scene-local UI/previews while keeping authoritative sessions and users. The sample supplies a minimal camera when no enabled scene camera exists.
Concepts to study¶
Read CouchCoopBootstrap, PersistentScenePrototype and the independent player presenters. A panel's Character Preview Host renders presentation content separately from gameplay. Gameplay Integration explains context APIs, representation ownership and advanced recovery.
Try two keyboard roles, then supported controllers: join/confirm independently, transition twice, Leave/rejoin a middle seat and compare surviving session/panel mappings. Test actual device loss separately from intentional Leave. Optional Report Persistent Session Diagnostics on the scene component prints ownership details when needed; verbose logging is off by default.