Peer-to-peer

How to use Client-hosting to connect clients directly

Game Clients normally connect to one another via the coherence Cloud services, but it is also possible to implement a peer-to-peer (P2P) scenario where they connect via 3rd party relays, such as Steam Networking, Epic Online Services and Azure PlayFab. These relays are essential for the Game Clients to find one-another and maintain connectivity.

This makes it possible for your coherence-enabled game to host the Replication Server directly on one of the Client machines, without using our cloud services. Hence, when we talk about peer-to-peer in coherence we refer to it as Client-hosting.

It involves three main parts:

  1. A mechanism for bundling the coherence Replication Server with the game.

  2. SDK methods that start and stop the Replication Server on the player's personal device.

  3. A relay for communication between the Replication Server and some 3rd party networking service, such as Steam Networking.

Players running their own local Replication Server will still be bound by the legal terms of the coherence end user agreement. For questions regarding this, please reach out to us at the devrel@coherence.io email address.

Pros and cons

If you decide to release your game with support for Client-hosting, it is important to first consider the tradeoffs of this approach:

  • Server costs will be paid by those who provide the networking service, i.e. Valve in the case of relying on Steam Networking.

  • Players will be running the Replication Server on their personal devices, so their specs and network conditions will have a big impact on performance and reliability for all players.

  • You will not have access to the full range of features included when you're using the coherence Cloud services.

  • It lets your players keep playing the game over the Internet, even if your company or coherence goes out of business.

Last updated