Hey, my first post here. I want to ask for help in understanding something. So lets say you are working on a simple 2D desktop application. A space shooter. The application is written in C++ or C#. No framework or game engine is being used. I want to implement a system where the user can select multiplayer from a menu and after loading they will be put into a match with about 9 other players. These players would obviously be other players who were searching for a game at the time. Once all the players are connected to the match, they will play a simple multiplayer game match on a tilemap. After 3-4 rounds the person who won the most rounds wins. Very simple.
Now I understand the basics of getting this done. Create a local server in C++ and use packets to send information from one player to the others. This information would include the players position, his rotation and when he shoots (a spacehip game for this example). Apply this for each player on each frame (this is a real time game). Ive read a lot so I understand the basics of UDP/TCP and the structure of packets. However I do not understand everything fully.
1. Having alot of experience with Google App Engine and Python I wanted to know how I could use their channel api to accomplish this. Ive seen games such as Realm of the Mad God accomplish this and its been cited that it uses app engine. Many people have said their Channel API is not a good fit for real time multiplayer games due to latency. Now not only is this game real time but it allows for 85 players for a single battle and is browser based. Now if I am trying to accomplish 8-10 players, desktop based and no mmorpg functionality (open world, transitioning between worlds, online world state persistence, inventory, etc.) I don't see why I couldn't accomplish this using their api. Another problem I have is that their api says messages are sent between the backend and a javascript client. How would I accomplish this since I am programming for the desktop?
2. I have heard of node.js and socket.io as being nice solutions to my problem but once again they are browser based. How would I implement something like that for desktop?
3. Smartfox seems like a good solution but I don't really understand how it full works. Honestly though this looks like the best solution for what I want to achieve if I understood it more. Not understood how to use it but what it does/what role it plays. Do you use it to write a server/client, upload to a hosting service and then run it on there?
4. In the event I use a service like Amazon EC2 and write a simple c++ server and upload it I don't quite understand how the local implementation translates to working on the web. I know for the local server/client model I can just use a local ip and the same port. But lets say I have 1000 players and each match can contain 10 players. Would I just create a new port for each match? I haven't looked much into EC2 but I am assuming you would get an IP address for a server and then each port could act as a match. So the first match would be on ip_to_server:0000 then the next on ip_to_server:0001 and so on and so on.
5. What would be the security concerns for using something like a simple c++ server/client uploaded to a cloud hosting service? I know from my HTTP experience that the main security is in encrypting/hashing the data sent through HTTP requests. Now obviously I cannot do that with packets as that would cause latency and lag due to the increased size of the messages. And also the information being sent isn't private so I don't really see where security comes into play here. Would the security be the cloud service I use?
6. If a service like EC2 is used where do the costs come from? Is it based on the amount of messages sent between the sockets?
I guess the best case scenario I am looking at is using the channels api and just sending messages from the desktop application to a backend that acts as a a server and worst case I would write a simple c++ server, upload it to a service like EC2 and use a port for each match? Once again this is very simple.
Thank you in advance.