0
\$\begingroup\$

I came across this unity Unity conference video on buillding multiplayer games https://www.youtube.com/watch?v=CuQF7hXlVyk

Form, this image we can see there are 3 P2P methods

enter image description here

and 1 Direct client server model

enter image description here

So what is the difference between P2P Client server and Dedicated game servers

  • These are the my understandings,
    • In P2P Client Server relay is just used to connect with players in order to over come NAT issues, In this model one of the client hosts the game
    • In direct dedicated game server game instance of game runs on server and clients connect to that game.

Enlighten me! Thanks!

\$\endgroup\$

1 Answer 1

4
\$\begingroup\$

In the peer-to-peer client-server model, the server software runs on the machine of a player who is also taking part in the game. The server software and the game client are usually integrated in the same executable.

In the dedicated server model, the server software is a separate application which usually has no visual output. It runs on a separate machine which is usually (but not necessarily) sitting in a datacenter.

The peer-to-peer model is cheaper and more convenient, because nobody needs to pay for separate machines to run servers. But it also has a couple disadvantages:

  • The host must be a player with a public facing IP. They can not be behind a NAT router (unless they configure it to do port forwarding, but that's something you need to explain to players how to do).
  • When the host quits the game, then the game is either over or you need to migrate the game to a new host. Host migration can be technically challenging and is often hard to do without pausing the game for a couple seconds (although some developers figured out pretty smart ways to do it with minimal disruption).
  • Poor game experience when the host has a weak machine or a bad internet connection.
  • The host has an unfair advantage, because they are playing with a network latency ("ping") of zero.
  • It is difficult to prevent the host from cheating.
  • The players can use network diagnosis tools to find out the IP address of the host and the host those of all players, which is problematic from a privacy perspective.

Using a relay fixes the first and last problem by having a server in a datacenter as an intermediate between players and hosts. But now you again need servers in a datacenter. Just cheaper servers, because they do nothing but sending data back and forth while the computationally expensive game mechanics are calculated on the machine of a player.

\$\endgroup\$
2
  • \$\begingroup\$ Oh which means relay servers and dedicated servers are same, and we can say all dedicated servers are relay servers but not all relay servers are dedicated servers. Dedicated serves does more than that of a relay servers. Thanks for the brief answer! \$\endgroup\$
    – youhsia
    Commented Jul 16, 2020 at 11:23
  • \$\begingroup\$ @youhsia No, that's not entirely correct. A dedicated server calculates game mechanics. A relay server doesn't. It just relays raw data and lets a player calculate the game mechanics. And a dedicated server usually doesn't just relay game data directly. It receives input messages from clients and sends updates to all clients about the game mechanics it calculated. Although from the perspective of a non-hosting player, a relay server and a dedicated server look the same, because it's invisible to them that the relay server outsources the heavy lifting to another player. \$\endgroup\$
    – Philipp
    Commented Jul 16, 2020 at 11:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .