Author Topic: TNet: Tasharen Networking Framework  (Read 129107 times)

Cripple

  • TNP Alpha
  • Full Member
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 117
    • View Profile
Re: TNet: Tasharen Networking Framework
« Reply #45 on: December 25, 2012, 06:26:06 AM »
I recommand this ... just buy it, it is an awesome framework. I got an access of the beta and I am going to buy it eyes closed.

The code is really clear and well documented. The example are good and there is all you need to know to port your game to multiplayer.

Great work :)
Graphicstream Dev.

mishaps

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 65
    • View Profile
Re: TNet: Tasharen Networking Framework
« Reply #46 on: December 25, 2012, 06:34:45 AM »
Already got it just trying to port my game! I think I found enough to do it in the tips page u can send a packet to request a channel list and ditto for closing off a channel. Now if I can just get the scary server stuff up and running I'm good to go ahead with it heh heh.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: TNet: Tasharen Networking Framework
« Reply #47 on: December 25, 2012, 09:35:51 AM »
Windows vs Linux -- I believe IO completion ports are only supported on Windows, which would suggest better performance there... but Linux is generally better for running servers of any kind. In the end, I think it'll be about preference -- what you prefer to use.

JoinRandomRoom -- you can request a list of open channels from the server, then just pick a random one and join it. :)

You can also compile the server's C# files natively by extracting the ZIP's contents into the root of your project, then opening the server project with MonoDevelop.

Alternatively, you can create a new C# project from scratch by including these files:

Assets/TNet/Common/*
Assets/TNet/Server/*
TNetTest/Servermain.cs (extracted from the zip file)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: TNet: Tasharen Networking Framework
« Reply #48 on: December 29, 2012, 06:04:56 AM »
1.1.0
- NEW: Added AutoSync script that can automatically synchronize properties of your choice.
- NEW: Added AutoJoin script that can quickly join a server when the scene starts.
- NEW: Added a pair of new scenes to test the Auto scripts.
- NEW: It's now possible to figure out which player requested an object to be created when the ResponseCreate packet arrives.
- NEW: You can quickly check TNManager.isThisMyObject in a script's Awake function to determine if you're the one who created it.
- NEW: You can now instantiate objects with velocity.
- NEW: Added native support for ushort and uint data types (and their arrays).
- FIX: Fixed a bug with sending data directly to the specified player.
- FIX: Resolving a player address will no longer result in an exception with an invalid address.
- FIX: Changed the order of some notifications. A new host will always be chosen before "player left" notification, for example.

bilbo0s

  • Guest
Re: TNet: Tasharen Networking Framework
« Reply #49 on: December 29, 2012, 02:10:03 PM »
After looking through the documentation, I have to say that this seems like a VERY simple yet powerful package. It looks like you have successfully created another needed middleware component for Unity.

I do have a question about the server however. I was trying to ascertain whether or not the server itself could start channels that would exist BEFORE the clients connect to them? One thing Photon and uLink allow is for several "Rooms" to be fired up by the server and then people can come and go as they please. It seems in Tasharen, the CLIENT is the one who starts a channel, and other clients connect to it. If the hosting client leaves the channel, the channel is destroyed? or is another client elected to be the host? or does the entire channel just go away?

Even if this doesn't suit all purposes, it really is a GREAT option for a lot of people. You are to be congratulated for making it.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: TNet: Tasharen Networking Framework
« Reply #50 on: December 29, 2012, 03:11:46 PM »
If a client leaves the channel, another is automatically designated to be a host (authoritative player). The channel doesn't go anywhere. You can also make it so that even if the last player leaves, the channel still remains with all the remote function calls remaining for the next player that joins.

xfinitystudios

  • Guest
Re: TNet: Tasharen Networking Framework
« Reply #51 on: January 01, 2013, 10:46:55 PM »
Hello, I'm curious.. how is the game state saved when all players disconnect?

Is a file written to disk? Is something sent to a database? Is it all stored in memory?

And can we control the way this data is saved/retrieved?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: TNet: Tasharen Networking Framework
« Reply #52 on: January 01, 2013, 10:53:57 PM »
After the last player leaves, the state will be in memory. When the server shuts down, the state gets saved to the disk. When the server starts, the state is not loaded until after the channel is re-created.

You can specify whether you want this kind of behaviour when you create the channel, and you can also close the channel at any time (which will prevent the state from being saved as well).

xfinitystudios

  • Guest
Re: TNet: Tasharen Networking Framework
« Reply #53 on: January 01, 2013, 11:07:34 PM »
Thanks ArenMook!

Maybe you can tell me if TNFramework is right for my needs. I'm re-creating a 3D farmville type game.. so each farm will be a channel, and other users can visit other player's farms.

There could be 100's-1000's of farms being played at a time... and 10,000's of users who have farms. Will TNFramework be able to handle all of that? and is there a way to expand across multiple servers if there are too many channels?


ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: TNet: Tasharen Networking Framework
« Reply #54 on: January 01, 2013, 11:12:31 PM »
It's really up to how beefy your server is going to be. TNet is fairly efficient in how it handles everything. You can have one central server where players log in and request a list of known servers, then disconnect and join an actual game server if one server can't handle everything.

xfinitystudios

  • Guest
Re: TNet: Tasharen Networking Framework
« Reply #55 on: January 02, 2013, 12:19:42 PM »
Aren this has been a big help and I'm do believe I'll be purchasing this product next week.

One last thing however.... can I run this as a headless server? I want to use Amazone EC2 and launch a few of these servers.

Is that even possible? Thanks again for all your hard work!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: TNet: Tasharen Networking Framework
« Reply #56 on: January 02, 2013, 12:24:01 PM »
Yes, the server is always headless. That's why it's only a 35 kb executable.

xfinitystudios

  • Guest
Re: TNet: Tasharen Networking Framework
« Reply #57 on: January 03, 2013, 01:25:34 AM »
Wow, this is a really great package! Thanks for all the help.

If I were to give any feature requests (as for optimization).. I would suggest an area of interest feature. Basically if there are hundreds of characters or objects moving in the scene, only the characters/objects within a certain range of the player will be received by the player.

So if a cube is moving on the other side of the scene, the packets from that cube will only be sent to players near it.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: TNet: Tasharen Networking Framework
« Reply #58 on: January 03, 2013, 01:37:52 AM »
That's one of those game-specific features. Fortunately the code should be easy to follow and modify. ;)

xfinitystudios

  • Guest
Re: TNet: Tasharen Networking Framework
« Reply #59 on: January 03, 2013, 02:21:18 PM »
- sorry for flooding you with questions.

But I was just reviewing the documentation and it says that I need to add the TNManager to the start of my game (the first scene) and add any objects that I plan to instantiate.

But what if the user can play the game totally single player and only do networking if they go under a certain sub menu? Can I add TNManager later in the game (in the sub menu)?

And can I remove a TNManager and add it again with different set of objects (for other scenes) ?