Author Topic: Is TNet for me...  (Read 2303 times)

Hoppertje

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 5
    • View Profile
Is TNet for me...
« on: February 17, 2015, 05:54:19 PM »
I am looking for a network engine that can support a MMO platform...

I am not really interested in network views or network instantiates... i will be using RPC/RFC's and keep track of players/objects myself...
SideQuestion: One of Unity's Networking bugs was that any dirty client could network.instantiate, the masterserver could be spammed with user made rooms, no locking etc... has this been resolved with TNet?

My preference would be to not use TNet's MasterServer but use a direct approach - Unity client as server, is this possible?

Doing the above, would that undermine what TNet stands for; is TNet for me?


Thanks!



MCoburn

  • Jr. Member
  • **
  • Thank You
  • -Given: 1
  • -Receive: 7
  • Posts: 69
    • View Profile
Re: Is TNet for me...
« Reply #1 on: February 17, 2015, 08:00:04 PM »
I would say, judging from the developer, Windward is one of the flagship games that he promotes TNet with. I'd say that he's is possibly one of the friendliest developers out there, helpful even if I ask dumb questions that he could just do a one-liner "RTFM" (trust me, been there done that).

TNet possibly would suit the bill for MMOs, because you can use it to be Peer to Peer. For example, I'm using TNet in my shooter project for clients to be saying "Hey, I'm here, here and here" which the server is just going "Okay, passing the packet to the others" rather than have the server do a simulation and have the client be a dumb terminal (as in, it feeds the server's player entity the values and "shows" the end result). For attacking and other things like explosions, on the server I'm planning to keep a X number of timestamps where everyone was, so when the player shoots, it goes "Hey server, I'm timestamp blah, I think I hit someone, can you check". Server then rolls back the clock and says "Yep, hit confirmed" or "Nope, missed". Ultimately, the server is a client, but it's running the combat logic.

There's other third party solutions out there, like Photon and SmartFox, but they are expensive subscription based or user based and have limits on how many messages (packets?) can be passed through at any given second. TNet is just a base model - the internals of a car - and it's up to you to mold your system on top of it.

To lock down TNet, just change the protocol ID in the code to something else. That way people can't just pull up Unity and a copy of TNet, guess your master server IP and go from there. TNet will stop connections with an error if protocol IDs mismatch (the TNServer will throw a "X has failed the verification step" message in console). You may also consider adding your own code (maybe magic packet that you must send to say you're X game client?) to detect people trying to spoil the party and break things.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Is TNet for me...
« Reply #2 on: February 17, 2015, 10:46:04 PM »
There is no such thing as a "master server" with TNet. There is a "lobby" server though -- which is just one of the ways you can execute the built-in TNServer.exe with. It will basically act as a place where actual game servers can advertise their own presence. Players can retrieve the list of servers from it then choose which one to actually connect to.

TNet's server is a tiny 65 kb executable that uses almost no resources. With the latest Pro version changes, my Windward server had 1472 players in the past few days (24 simultaneous user peak) and its memory usage fluctuated from 45 to 85 MB, with CPU usage never exceeding 0.1%.

That said, any MMO is a massive undertaking, and is also the staple of any amateur developer's first game idea. Unless you're a veteran game developer with 15+ years of experience under your belt, a few million dollars in the bank, and a team of people working for you, you really should think about it some more.