Author Topic: A few questions  (Read 2903 times)

hippocoder

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 30
    • View Profile
A few questions
« on: August 05, 2013, 04:20:06 PM »
Hi,

Tnet looks just the ticket but I have a couple of questions first please if it is no problem. I've read all 9 pages of the tnet forum a few times but may have missed a couple of things.

1. In halo, when the actual server host drops, the game pauses and starts up a new server, then continues from that point for everyone. I know TNet does this for the host, but I do not know if it also does it for the server (so new players can join the game in progress). Please clarify...

2. I cannot see in the documentation a situation like the following:
 - mike joins the channel on john's server and plays. mike knows his own instantiated object, and therefore controls it. John updates an instantiated copy his side with positions but performs no logic.

 - mike spawns a couple of ai drones which are under mikes control but mike's mobile phone battery died. Can we have john delete mike but take over the ai for the drones (not delete the drones)?

If it's possible, please explain in code, how it's done and I'll purchase Tnet later tonight. Thanks! The goal for me is to be able to have anyone create servers and host them, but have others dynamically continue the server seamlessly, even if the original server went down. This is distinct from just hosting a channel with the server somewhere else afaik... unless I misunderstood and Tnet does this but a "server" is just for matchmaking?

If the server is just for matchmaking, what happens in condition 1 above - can a new player still discover a game in progress if the buck was passed? These are really the only reasons I'd consider Tnet over photon or unity's networking as I don't need many players, but I need a game that continues to play in difficult situations with players still able to join a game in progress.




ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: A few questions
« Reply #1 on: August 05, 2013, 10:51:09 PM »
1. In TNet the new host is chosen automatically when the old one disconnects, but a new server doesn't get started. If the actual server drops (ie: program running on the hardware), then people will be disconnected.

2. Assuming the instantiated object has a TNObject on it, you can check tno.isMine flag that tells you if you own this object or not. When creating the object you can specify what happens to the object when the owner leaves. The 'persistent' flag set to 'false' means that the object will disappear when the owner leaves. If it's 'true', then the object will remain behind, and a new owner will be chosen.

hippocoder

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 30
    • View Profile
Re: A few questions
« Reply #2 on: August 06, 2013, 10:18:28 PM »
Thank you for your reply. So, traffic actually doesn't go through the server (it's peer to peer), so what traffic does go through the server for it to disconnect everyone?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: A few questions
« Reply #3 on: August 07, 2013, 04:42:56 AM »
There is always a server. This server may be hosted on a client (and launched from within a Unity game), but there is still a server running somewhere. Even if it's seemingly peer-to-peer.

hippocoder

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 30
    • View Profile
Re: A few questions
« Reply #4 on: August 07, 2013, 01:28:20 PM »
Thanks! I was merely wondering if it was necessary to host many servers (one per geographic region) or not ...?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: A few questions
« Reply #5 on: August 08, 2013, 08:47:48 AM »
If you do, you will get better latency (think Australian player playing with a North American server for example). But is it necessary? Nope :)

hippocoder

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 30
    • View Profile
Re: A few questions
« Reply #6 on: August 08, 2013, 05:06:30 PM »
Decided to pick up TNet this weekend. One more question for the road:

When you have a server, what is actually sent and received during gameplay? I had thought that TNet was peer to peer. When sending packets out, they go direct to the other players to minimise latency, right?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: A few questions
« Reply #7 on: August 08, 2013, 08:43:55 PM »
Everything goes through a server. The "server" can be launched from your Unity game, or from a stand-alone executable (that's tiny and doesn't require Unity). In layman's terms, the server echoes packets through it, and stores important states (persistent remote function calls).