Delayed Simulator Connection in Cloud

I’m looking to have a simulator automatically connect to any room that’s created on the Cloud.

When using an AutoSimulatorConnection component, I can achieve this result; however, the player Client joins the room immediately, and then there is a 3-6 second delay before the simulator joins.

When disabling the autoconnect component, the simulator just never connects. That is the only way I’ve found to actually get a simulator to connect via the Cloud.

The 4 Coherence components I have in the scene are: Coherence Bridge, LiveQuery, Scene, and AutoSimulatorConnection.

I’m using a custom connection UI, but even with the default sample UI, this delay still occurs.

The docs mention sending the simulator slug in the room join request to create a simulator, but even the sample UI does not show how this is done and when using RoomCreationOptions in the join request, there is no obvious property to set the slug that I can see.

My question ultimately is, how can I get it so that when a room is created, the simulator is already there waiting by the time any player client joins/loads the room?

Hey, so the slug actually goes in the runtime settings so the cloud knows which version of the simulator to attach to a given room: Simulator slugs | coherence Documentation

It takes time to launch the simulator and the simulator needs time to resolve and connect to the RS so your client needs to be prepared for this. Generally, you could connect the client before the simulator and then wait to perform any client actions until the client detects that the simulator is also there (my recommendation). This would give you the most responsive performance. Additionally, you can use the advanced authority features: Advanced Simulator Authority | coherence Documentation which can be used to prevent the client from connecting until the simulator is ready, but, again, you’ll have to code your connection UI to accept a declined connection while the simulator starts and connects.

1 Like

Thanks for the response, sir.

I have been entering slugs with every build I’ve uploaded, though I usually do it through Coherence Hub > Simulators tab, which also changes it in RuntimeSettings object.
I just thought maybe the docs were implying that if I send the slug of the simulator I want to be created in the room creation request that this might cause the sim to also be created automatically at that moment and not rely on the AutoSimulatorConnection component.

It sounds like what you’re saying though is that there is no way to get rid of this delay, and this is just part of the way the system works. Is that correct?

If so, that’s totally ok and I will just make a “Waiting for Room” type UI thing until the sim joins. I just wanted to make sure that I was doing everything I could to configure it correctly.

Yep, you’re doing it correctly. There is a delay because we don’t prewarm a bank of simulators that would cost you credits, so adding the waiting for room UI is a good solution. Also check that your simulator isn’t doing a bunch of work before loading the scene that has the auto simulator connection behaviour because that will add to the delay.

1 Like

Thank you, your explanation makes perfect sense.