How to Change Scenes

Unreal’s level system is separate from Strix’s network functionality, so changing levels will not have any effect on Strix’s Actor synchronization.

However, when moving to a new level, all Actors on the previous level are automatically destroyed by the Unreal Engine. The timing of the actual level switching and the replica creation from other client may cause an issue of replica loss. (See Pausing)

You can use the following steps to prevent the issue.

Pausing

Before clients start switching the level, all clients call the Pause Network Object Manager function. You can use RPC to do so, e.g., the room owner to call Send Rpc To All to pause.

Then, confirm that all clients are paused before moving to the next step (i.e., opening a new level). You can use RPC again for the purpose, or you can use a custom room member property, to report a client has been paused.

Event graph for level switcher to pause all clients Pause This Client Check if All Clients Are Paused

Changing Levels

After all clients are paused, all clients move to a new level (most likely by calling Open Level function).

You can again send an RPC from the room owner, or you can run the confirm paused code on each client before opening a level.

../../_images/level.png

Unpause Objects

After a client completes opening a level, it calls the Unpause Network Object Manager function, and proceeds to other level setup as always. You don’t need to wait for other clients when unpausing for the purpose of correct Actor replication and synchronization. (You may need to do something more before unpausing if your level setup includes something that could be bothered by or destroy replicas. Also, you may need to wait for other clients to complete level setup before beginning the gameplay on the new level for the purpose of correct gameplay.)

../../_images/unpause.png

Room members’ levels

Strix’s Actor synchronization by Strix Movement Synchronizer or Strix Transform Sync components try to move replicas to the same world coordinates as the owner Actor. Their synchronization mechanics work only when all room members are in the same world. That’s why the above technique assumes all clients make a level switching together.