Tasharen Entertainment Forum

Support => TNet 3 Support => Topic started by: Voxel on June 22, 2013, 07:26:03 PM

Title: Amazon EC2 Setup
Post by: Voxel on June 22, 2013, 07:26:03 PM
Hi,

I've been trying to get TNServer running on my Amazon EC2 Win Server 2008 R2 Instance, but I get the Gateway: None Found message.

I think I have sorted out the firewall and port settings OK. I used this guide as a reference to the things I might need to do, while applying the relevant TNServer port info:
http://developer.muchdifferent.com/unitypark/uLink/HostingAmazonEC2

I have also followed the advice here:
http://www.tasharen.com/forum/index.php?topic=2874.0

I am using the following command line in the shortcut for TNServer:
TNServer -name "Test" -tcp 5127 -udp 5128 -udpLobby 5129

At the moment I have the Windows firewall disabled completely as I thing amazon have their own firewall setup for EC2 (hence the port setup in the management console for EC2).

However, test clients are able to connect and play although the latency is terrible.

Any ideas? Thanks :)
Title: Re: Amazon EC2 Setup
Post by: ArenMook on June 23, 2013, 10:15:28 AM
Amazon servers don't have gateways, so that message is harmless.

Latency being terrible is expected -- Amazon EC2 micro instance (assuming that's what you use?) are not beefy at all -- which is why they are free. It's fine for everything other than FPS games though.
Title: Re: Amazon EC2 Setup
Post by: Voxel on June 23, 2013, 10:30:29 AM
Hi Aren,

Thanks for the confirmation. Are there any providers of servers (I don't mind paying) that you suggest for FPS? Or is it best for one of the players to host? There will be a max of 16 playing at anytime.
Title: Re: Amazon EC2 Setup
Post by: ArenMook on June 23, 2013, 03:31:32 PM
If other players host, then you don't pay for bandwidth. You can also let players host their own region-based dedicated servers for tournaments. Win win!

I can't recommend any hosting providers as I've never done any searching into the matter myself.
Title: Re: Amazon EC2 Setup
Post by: pyscho2day on July 08, 2013, 12:15:26 AM
@ArenMook
When others play host, does the client establish a direct connection or are they still being routed through the server on the EC2? (Just using EC2 as an example)

From what I have seen it looks to be that the traffic is routed through the EC2 server but I just want to confirm.
Title: Re: Amazon EC2 Setup
Post by: ArenMook on July 08, 2013, 12:37:33 PM
All clients connect to a server. If this server is on your EC2, then all traffic goes through there. If the server was started on a client's machine using TNServerInstance.Start, then the connections are P2P.
Title: Re: Amazon EC2 Setup
Post by: pyscho2day on July 08, 2013, 04:18:21 PM
That is good to know.  1 more question then I will stop hijacking this thread.

Is it possible (and i think it is by what i have read) to have a server in the cloud that can act as a master server that would host a list of client servers (TNServerInstance.Start) so that others could connect directly to them?  If so do you have a sample or is there one in the unity package that i have missed?
Title: Re: Amazon EC2 Setup
Post by: ArenMook on July 08, 2013, 10:57:44 PM
Yup. Start the TNServer.exe with only the lobby part running (-tcpLobby 5129 flag for example), and have your game servers register with it.
Title: Re: Amazon EC2 Setup
Post by: pyscho2day on July 10, 2013, 10:35:26 AM
Thanks Aren!  I was able to figure out what I Needed.
Title: Re: Amazon EC2 Setup
Post by: hippocoder on August 09, 2013, 05:57:15 PM
I read that EC2 will bill you after 12 months. Azure might be another option. Btw, how do you "register" a client with the EC2 "lobby master server" in order to register servers or join an existing one? Is there an example ?
Title: Re: Amazon EC2 Setup
Post by: ArenMook on August 09, 2013, 06:10:18 PM
You don't register clients. You register servers. When you launch the TNServer.exe you get a list of options -- including the "-tcpLobby" command, with examples of how to use them.

The source code for TNServer.exe is included in the zip file with TNet.
Title: Re: Amazon EC2 Setup
Post by: pyscho2day on August 10, 2013, 12:01:11 AM
This is from their page:

Quote
* These free tiers are only available to new AWS customers, and are available for 12 months following your AWS sign-up date. When your free usage expires or if your application use exceeds the free usage tiers, you simply pay standard, pay-as-you-go service rates (see each service page for full pricing details). Restrictions apply; see offer terms for more details.

** These free tiers do not expire after 12 months and are available to both existing and new AWS customers indefinitely.

This is located on this page http://aws.amazon.com/free/ (http://aws.amazon.com/free/)

So as long as you stay withing the limits and if you only have one server and its set up with the ones marked free, you should never be charged.  Theoretically that is.  And for just a single master server it is more than enough.
Title: Re: Amazon EC2 Setup
Post by: col000r on July 23, 2014, 06:01:42 AM
In case anyone needs this: I wrote a tutorial about how to set everything up here (http://blackish.at/blog/2014/07/host-a-tnet-server-on-amazon-ec2.html).
Title: Re: Amazon EC2 Setup
Post by: ArenMook on July 23, 2014, 09:38:28 PM
Nice writeup, Markus!
Title: Re: Amazon EC2 Setup
Post by: neeraj on June 19, 2016, 08:15:29 AM
In case anyone needs this: I wrote a tutorial about how to set everything up here (http://blackish.at/blog/2014/07/host-a-tnet-server-on-amazon-ec2.html).

Thanks a ton!  ;D
Title: Re: Amazon EC2 Setup
Post by: Bill.Smock on June 19, 2016, 03:51:14 PM
Hah nice thread revival.  Second the thanks - that site is in my bookmarks.  +1 for him mentioning elastic IPs.
Title: Re: Amazon EC2 Setup
Post by: neeraj on June 19, 2016, 11:42:16 PM
I was having problems testing my game, all thanks to him, i quickly got it up and running!  :D