Jump to content

Peer to Peer

Go to solution Solved by Electronics Wizardy,

instead of a central server, someone hosts the server and others connect. This is the cheap way as you don't have to pay for hosting, and normally is worse as you normally need portforwarding on the one hosting it and their internet connection is much worse than a server in a datacenter.

instead of a central server, someone hosts the server and others connect. This is the cheap way as you don't have to pay for hosting, and normally is worse as you normally need portforwarding on the one hosting it and their internet connection is much worse than a server in a datacenter.

Link to comment
https://linustechtips.com/topic/784553-peer-to-peer/#findComment-9887966
Share on other sites

Link to post
Share on other sites

9 minutes ago, Electronics Wizardy said:

instead of a central server, someone hosts the server and others connect. This is the cheap way as you don't have to pay for hosting, and normally is worse as you normally need portforwarding on the one hosting it and their internet connection is much worse than a server in a datacenter.

Bold is incorrect. 

 

Nobody hosts anything. Each player communicates with every other player. Someone moves? That action is sent to every other player in the game, etc. etc. 

 

Client-server-vs-peer-to-peer-480x201.pn

 

Central servers are still used for the likes of matchmaking. 

Link to comment
https://linustechtips.com/topic/784553-peer-to-peer/#findComment-9888010
Share on other sites

Link to post
Share on other sites

A variation of this is where the players all gather up in a "lobby" and there each player tests their connection and latency to the others players, and then everyone agrees that the one with the smallest average latency to all the other players should be the "server".

When game starts, all players send data to that player and that player updates the other gamers as if it's a dedicated server

 

ex 3 players  A , B and C

 

C --- 8ms --- A --- 10ms --- B --- 5 ms ---  C 

 

So

A : 10ms 8 ms

B : 10 ms 5 ms

C : 5ms  8 ms

 

So obviously C should be the game server, then B, then A  strictly latency wise, then if they're connectable or not (port forwarded) comes in play and some game engines also compute a benchmark score or something like that to indicate the performance of the machine so that a player with weaker machine but lower latency may have lower priority compared to a player with better hardware.

Link to comment
https://linustechtips.com/topic/784553-peer-to-peer/#findComment-9888219
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×