Client-hosting world vs room setup

Hi there! I’m new to Coherence here! I am trying to setup a client-hosting p2p system for my application and is bundling up the replication server into the build. In the example provided in the Implementing Client-Hosting page, the replication server was set up as a World server as opposed to a room. Does this make any difference in performance or functionality?

I’ve been able to connect locally but have yet to implement a Relay solution to connect two clients into the same world. I haven’t found any direct way of connecting from one client to another outside of using the third party Relay solutions (Steam, Epic, Azure) but I also want to make sure that the bundled replication server is setup correctly to be used. Does it matter if it’s setup as a World or Room server in this context? And how does it affect the implementation of the Relay solution?

Does this make any difference in performance or functionality?

Doesn’t matter much for client-hosting. Internally worlds and rooms are quite alike, technically speaking. Worlds vs rooms takes shape when you consider coherence Cloud (aka infrastructure). There, worlds are meant to be kept alive for long (think, dedicated server), vs rooms that are meant to be closed usually after game ends (think sessions, or not dedicated). So the only real difference you might experience is slightly different APIs to use. I’d recommend you to go for rooms, nonetheless, since it’s more widely used.

If you don’t want to use a third party relay, it’s actually less hassle: all clients connect to the replication server. So you’ll need an ip:port to connect to (where the rs is started), and have users figure out port-forwarding and all that.

To create and join rooms, create an instance of Coherence.Cloud.ReplicationServerRoomsService. To join a given room, CoherenceBridge.JoinRoom.

I think we don’t have right now enough straightforward examples on these scenarios, but reach out to us with questions here or on Discord, pretty sure everyone is happy to jump on and help.

Oh, and welcome aboard! GL&HF

1 Like

One note regarding this. We currently do not support rooms for third-party relays.

My point was regarding p2p purely via the RS. If you want to have a custom relay in the mix, you’d have to use worlds.

Thank you for clarifying the point with third-party relays! I don’t intend to use third-party relays, I am just trying to test a p2p connection purely via the RS. When setting up the RS with Worlds, it seemed pretty easy to get working. When the RS is set up using Rooms is where I seem to be running into issues.

Ah… I needed to specify both the room ID as well as the room’s unique ID to connect and join to it. That seemed to have done it. :slight_smile: