Author Topic: Peer to Peer vs. Remote Server  (Read 5086 times)

joboldo

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 7
    • View Profile
Peer to Peer vs. Remote Server
« on: April 04, 2013, 10:15:57 AM »
Hi,

TNet is really awesome :) It would be great if you could answer these 3 questions:

1) What is more efficient for a 4 player game with a lot of users? Using a client as the server and communicate via peer to peer or using a remote machine (e.g. Amazon EC2) as the server for communication? What would you recommend?

2) If the server.exe will shut down on Amazon, all games will be canceled? How to prevent that?

3) How does joinRandomChannel works exactly? Is it completely random? (think of country, ping etc.)

Thanks a alot :)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Peer to Peer vs. Remote Server
« Reply #1 on: April 05, 2013, 09:26:02 AM »
1. If you don't want to pay for bandwidth, put a lobby server on the amazon cloud (or somewhere else that happens to be reachable), and let players run their own (perhaps even -- dedicated) servers that will register with your amazon cloud lobby. This will also let you easily hot-swap servers if you need to move the actual game server elsewhere.

2. If you shut down the actual game server, then yes, all games will be canceled of course. However if you follow my tip from #1, then you can have many servers that won't be on Amazon.

3. Completely random open channel.

joboldo

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 7
    • View Profile
Re: Peer to Peer vs. Remote Server
« Reply #2 on: April 05, 2013, 09:52:45 AM »
allright thanks, 2 more questions:

1) if I want to pay for bandwidth the amazon server would be more efficent/faster than peer-to-peer?

2) What happens if I use peer-to-peer and the Host/Server will leave the game, Another player will be chosen as a new host/server?

 


ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Peer to Peer vs. Remote Server
« Reply #3 on: April 05, 2013, 12:31:51 PM »
1. If you are prepared to pay for bandwidth, then you likely will want to set up a VPN or a dedicated server somewhere other than Amazon since their bandwidth costs can be pretty expensive from what I hear (but I am far from an expert on this, so do your own research). However to answer your question -- yes, it would be better.

2. Host and Server are two different terms. Server is the actual server that people connect to. It's the executable file you run. It can have many channels inside, and many games going on. Host is just a player in a channel who's the authoritative player. When a host leaves, another player is chosen to be the host automatically.

Omidj

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1
    • View Profile
Re: Peer to Peer vs. Remote Server
« Reply #4 on: October 12, 2014, 03:04:44 AM »
hi.i used unityNetwork for my game.and it works in per2per system via ip!
in p2p all RPC send to all and Create trafic over theirNetworks!
i want per client sends RPCs to Centeral Server and it Sends RPCs to Other Clients!(S/C or Centeral Server)!
now Can TNET Do it for me?!
How Can i do it?with my own Server!
« Last Edit: October 12, 2014, 03:21:23 AM by Omidj »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Peer to Peer vs. Remote Server
« Reply #5 on: October 13, 2014, 03:13:26 AM »
That's how TNet works, yes.

Launch TNServer.exe on your central server and have clients connect to it.