Hi. I’m new to Coherence and learning from the document trying this and that.
One thing I’m curious about is,
I see that multiple bridges can be placed in a scene, which means connecting to multiple replication services. In which cases would we need that?
Hi Bohyun! And welcome to the forums and more in general, to coherence. Also thanks for taking the time to bring your question here, we really appreciate it!
Now. As far as I know (and I can see from that video), we don’t have a use case for multiple CoherenceBridge in the same scene. In the video you can see a ton of coherence objects in each scene, but only one of them is a Bridge. For the rest, there are multiple Bridges but each one in its own scene.
That’s in fact the principle behind the Multi-room Simulator: each scene represents a match or a game, and for that, one Unity instance that acts as the Simulator Server uses a Bridge for each scene/match to manage all the connections separately. Each Bridge “watches over” a scene, and handles its network entities and their changes.
In a regular game client, there would be little use for this setup. Normally you only have one Bridge per scene, but only one Bridge is marked as the “Main Bridge” and it usually gets placed in the DontDestroyOnLoad scene. When you move from scene to scene, if a new scene has a new Bridge, this new Bridge deactivates itself and passes control to the one in DontDestroyOnLoad.