This a conversation carrying over from Discord under Help > “MRS issues with 1.1.3”. There is some context there, if needed.
My main objective is to get a 2 scene (Menu and Game), MRS environment working in coherence 1.0.5 as it was in 0.x. In 0.x, the game had the 2 scene MRS environment fully working as I would expect both locally and on Coherence Cloud. After investigating this more, I can confidently say that this is no longer working the same as it was pre 1.0.
I’ll explain the basic steps I’ve taken in hopes that it helps to understand maybe where I’m going wrong in implementation or maybe just misunderstanding the concept:
-
I have 2 scenes, Menu and Game. Conceptually, the player opens the Menu scene first, uses some UI to find/connect to a room, then when they connect to a room, the Game scene additively loads and becomes the active scene.
-
I use the MRS wizard to setup each scene as outlined by the wizard. In 0.x, there was an option to use either 1 or 2 scenes for an MRS setup; I believe there was a difference for how each scene was setup in the wizard before, but I’m going by memory here. As of 1.0.5, these options have disappeared, so I use the MRS wizard to add the same required components to both Menu and Game scene.
-
This does not achieve the required result by using the wizard alone. The wizard does allow establishing a client connection, and also the simulator connection is made and simulator scene is loaded. However, the Game scene does not additively load, and obviously does not become the active scene. (and why would it? In the base MRS wizard components, there is nothing to tell the system what scene should be loaded on connection.)
-
Fortunately, there’s a component that seems to make perfect sense here, which is CoherenceSceneLoader, which allows configuring what scene to load and on what connection type. There is an “Attach” property on this component as well. In 0.x, adding this component to the Menu scene and configuring the component to open the Game scene on Client connection worked exactly as I would expect and did just that. In 1.0.5, it does this also, but it requires enabling the “Attach” property. I’m going by memory here, but I’m almost certain this was not required in 0.x. This is not a big deal to change obviously, but it is a difference to note.
-
Here is where things diverge and really break down. In 0.x, the Client objects existed in scenes and so when they were instantiated using this setup, they were created in the Game scene. This also meant that all network objects moving forward were also instantiated in the Game scene. This is what we want because we want the players to see the objects in the Game scene.
In 1.0.5, the Client objects exist in the DoNotDestroyOnLoad scene, which seems fine, but when the Game scene gets loaded by CoherenceSceneLoader, it creates a 2nd Client in DoNotDestroyOnLoad. The fact there are 2 Clients also is maybe not necessarily even a problem (you’d know better).
The issue that actually prevents me from moving forward is that any network objects instantiated by the simulator seem to only be detected by the first client, the Menu client. This is evidenced by the fact there are 2 authoritative Clients in DoNotDestroyOnLoad, but only 1 non-authoritative Client (what the Sim sees) and I was able to verify this is the Menu client. I would expect if Sim detected both clients, there would be 2 non-authoritative Clients here instead of 1.
This essentially means that all network objects being created in the Menu scene, which is not what we want to happen.
I’ve tried many different things to try to make this work conceptually as it used to, but I have not found a solution that works as expected.
It’s possible that there is some simple configuration I’m missing by following the docs. I’ve reviewed the updated docs for both MRS and Scene Transition, but the feeling I am ultimately getting as a coherence user is that MRS and Scene Transitions have been developed maybe in 2 different isolated cases.
MRS seems to work as expected if only 1 scene is used. I also tested the scene transition functionality and it seems to work if MRS is not being used. If they are used together though, they do not seem to play well. This is just my “feel” from the outside though.
Please advise if you can see something I’m missing or have some suggested steps to ultimately get to the desired objective. This is something I’d like to get resolved as quickly as possible as it prevents future network development.