View unanswered posts | View active topics It is currently Thu Oct 18, 2018 2:04 am



Reply to topic  [ 4 posts ] 
 True Online Multiplayer - Cortex Command in the Cloud 
Author Message

Joined: Sat Feb 03, 2007 7:11 pm
Posts: 1493
Reply with quote
Post True Online Multiplayer - Cortex Command in the Cloud

These computers are both receiving a stream of a Cortex Command instance running on a Cloud server somewhere in Amazon's massive infrastructure. The laptop is receiving it through wifi. Otoy recently made an AMI called Orbx.js available which allows high quality video to be streamed to users right in their browsers. It was originally meant to be used for high speed rendering and modelling.

The key is that you can access the same Amazon cloud instance from multiple computers with Orbx.js


Here's how to do it: (this will cost you ~$0.80/hour that you run it, and ~$11 in Storage/Month)
  • 1) Sign up for an Amazon AWS (Amazon Web Services) account. Here you have to enter payment info, however the act of creating an account doesn't cost money by itself.

  • 2) Go here and click "Continue" and "Launch with EC2 Console" on the server that's in the region nearest you. (Take note of the box under this describing Security Group Settings. Copy/Paste it somewhere, you'll need it later).

  • 3) In the next screen, go to GPU instances on the left, and select g2.2xlarge (or whatever is there). You need a GPU instance in order to encode and stream live video from the server. (A side benefit is that it's an extremely powerful GPU).

  • 4) Skip to "Configure Security Group". This is where that box I told you to copy earlier will come in handy. Input all of the rules from that list. (The rules that don't have an explicit name are Custom TCP rules) This is important, otherwise you will get a timeout error when trying to connect to the game.

    List of ports (copied here for your convenience):
    21
    80 (HTTP)
    443 (HTTPS)
    1000 - 1100
    3389 (RDP)
    5090
    5900 - 5910
    8090 - 8300


  • 5) Review the settings and make sure you're alright with everything. Note that it is setting aside 100gb of EBS storage for this instance. That amounts to $11/month that the instance exists.

  • 6) It should bring you to your EC2 console now. Make sure it says the correct region in the upper right corner, then click instances in the sidebar on the left. You should be able to see your instance in the list.

  • 7) If you're ready, launch the instance. From this point forward, you're incurring a ~$0.80/hour charge (until you right click the instance to stop it).

  • 8 ) Click the connect button on top and it will guide you through Remoting into your new instance. During this process, you will need to create a special keypair file, and then reupload it to amazon to decrypt the password to log in to your instance. Please note, you will not be able to play games through remote desktop, this will come later.

  • 9) You're now logged in to your instance. Go to the start button and start typing "task manager". Click on the first result to open the task manager (this is how I do it :???: ). Under the command line portion, you should be able to find a GUID. It will look something like this:
    Image
    Copy down that GUID (it is case-sensitive) into a text file or something, you'll need it in a couple steps.

  • 10) Here's where you can go wild. Install Steam if you like. I went the quick way and downloaded build 18.

  • 11) Now it's time to try using Orbx to access the instance from your computer. Use this URL, but replace <ip> with the public IP of the instance (it says in the list view of the instance from the EC2 console) and <guid> with the GUID you copied down earlier.
    Code:
    http://aws.otoy.com/?connect=//<ip>:8090/?NOCRYPTO=1;STATUS=1;AUTOLOCK=0;WAN=12;START=cmd.exe;GUID=<guid>


  • 12) If you did everything right, you should see a black box with a Command Console in the middle. If you want to start up Cortex Command (Build 18) enter the two lines:
    Code:
    cd C:\Program Files (x86)\Data Realms\Cortex Command\
    Code:
    "Cortex Command.exe"


    If it times out, your security group settings weren't done properly (you can edit them from the EC2 console). If it shows an authentication error, well, you have the wrong GUID. Redo Step 9.

  • 13) Hopefully a copy of Cortex Command will pop up. You can then bring other players in by giving them the URL:
    Code:
    http://aws.otoy.com/?connect=//<ip>:8090/?NOCRYPTO=1;STATUS=1;AUTOLOCK=0;WAN=12;GUID=<guid>


  • 14) Stop the Instance from the EC2 console when you're done. Terminate it to release the Storage.




There are several other commands that can be used in the URL as mentioned in the Official Guide:
Code:
Audio is supported in all of the above browsers, but must be turned on by adding AUDIO=1; to the connection string.
The default bandwidth cap is set to 12 Mbps, which is enough to cover a 1080p stream at good quality for normal desktop applications. You can change this setting when you connect to the host by setting WAN=n, where n is the bandwidth cap in Mbps. The minimum bandwidth for a 60 fps ORBX stream is 3 Mbps. If you are on a 2 Mbps line for example, you should use “WAN=2;MAXFPS=30;” to cap the stream at 2 Mbps and 30 fps.
When using native ORBX, with UDP, the bitrate does not need to be set, as the ORBX stream automatically detects the instantaneous available bandwidth, and adjusts the stream on the fly. This functionality will be added to ORBX.js once browsers properly expose UDP web sockets to JavaScript.
ORBX.js offers partial support on several non-WebGL browsers - including  iOS browsers and IE10/11 - through a 30 fps simplified i-frame only stream (typically 2x the bandwidth of a normal ORBX stream).


If you have any other problems, you might be able to find the answers on this forum:
http://render.otoy.com/forum/viewforum.php?f=64


Fri Jan 03, 2014 11:27 am
Profile WWW
DRL Developer
DRL Developer
User avatar

Joined: Thu Jun 11, 2009 2:34 pm
Posts: 959
Reply with quote
Post Re: True Online Multiplayer - Cortex Command in the Cloud
And then you'll probably need something like this for USB controllers. Looks promising... and expensive unless one can host this on it's own hardware. Anyway looking forward to read your write-up.

UPD:

Looks like that USB thing does the opposite, but nevermind that anyway. Now I can't get rid of the thought, that streaming solves pretty much all multiplayer problems for Cortex Command. You really don't even need to stream it in full HD, due to 2X mode, and for 1366x768@30 fps it should be around 23 Mbits/sec without any compression per player. Client only needs to redirect input to the server and show the incoming stream, it's probably not even too hard to make CC to render it's picture to some separate screen buffers, because it already does something like this in hot seat multiplayer. And if you want to compress you can easily offload it to some other CPU cores or maybe even start multiple servers on a single manycore machine. And those guys decompress 720p on the fly with js using the browser. Can't even imagine the overhead.

Sure, everything seems easy for a toy-programmer like me, but a man can dream, right? Now my only dream is the source code.

UPD2:

Now that I think of it more and more, I probably don't need the source code for that.


Fri Jan 03, 2014 8:41 pm
Profile

Joined: Sat Feb 03, 2007 7:11 pm
Posts: 1493
Reply with quote
Post Re: True Online Multiplayer - Cortex Command in the Cloud
I tried it out with p3lb0x, but the connection was understandably terrible since he is located in Northern Europe, connecting to a computer in Northern California.


There are more settings (as alluded to in the last paragraph of the writeup). You can find them on the forums. WAN is the bandwidth cap; it's default at 12mbps. Perhaps it would also be prudent to experiment with encryption as well.

Also, to be safe, distribute the links to your game to individual people that you trust, not entire chat rooms. Strangers might execute some nefarious business on your instance.


With regards to controllers, I haven't tested them, but I imagine the service probably works with them considering it's made to be streaming games. But I've only used the keyboard so far.


Fri Jan 03, 2014 10:54 pm
Profile WWW
Forum Moderator
User avatar

Joined: Fri Feb 02, 2007 3:53 pm
Posts: 1896
Location: in my little gay bunker
Reply with quote
Post Re: True Online Multiplayer - Cortex Command in the Cloud
As Zalo said, this isn't some miracle cure to the online multiplayer problem. It would probably only work satisfactorily if both players are in close proximity to the hosting server. Still, good on you guys if you get it working.


Fri Jan 03, 2014 11:02 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.019s | 14 Queries | GZIP : Off ]