Multiplayer game communication framework for mac/ios - macos

I am creating a multiplayer 2D game for Mac and iOS devices. I'll be using cocso2d for graphics/game engine, however I am largely blank on what to use for multiplayer communication. Please note that I cannot use central severs e.g. SmartFox, RedDwarf, etc since I want the players to "host" games for others and be able to play it on their LAN, VPN or my own servers.
Any pointers? I checked lidgren but it's for .NET only and hence not an option for me.
EDIT: the communication has to be real time hence it would probably be over UDP

I have posted the question here on gamedev.stackexchange.com, I'll be posting my findings there (if any)

Related

Cannot sync games data in China though VPN is available

The game is already available on Google Play and gets ready for players to sync game process while the Internet is connected. Because of China is limited to the relevant services, so it should be syncing when the VPN is on theoretically.
But this cannot work in reality. Many players are giving us feedback that they could not sync their data even they are using VPN services. Sometimes, they are losing the game process.
I'm wondering the reasons why they could not be synced while they are connecting to the Internet.
Maybe: The VPN is not stable or it should be turned on last for at least 24 hours? Are there any method or tool can check whether the Internet connection is stable to sync?
I'm looking forward to a response. Thanks.
It looks a lot like the VPNs those people use aren't a good fit. It's true that it's hard to pass by China's VPN restrictions. Here are some points good VPN that works OK in China should have:
- fast speed and advanced encryption system
- kill switch
- by pass Great Firewall
- I think the most important is to have servers located in the neighborhood countries.
But I know that some players claim that they have a pretty solid VPN provider, but their guns won't shoot on time or the player stand still when it has to run.
China does its best to block VPNs, I guess this is the biggest problem.
Anyway, make sure you check the points above.

Does WebRTC makes sense for a a real time app to support many concurrent users?

I want to build a real time online multiplayer game. After researching WebSockets and WebRTC, I've come to the conclusion that WebRTC is exactly what I need if I was building a p2p game. However, WebRTC seems like its not meant for handling group conferencing. This is because if there are "n" users, there will be "n-1" streams of data. This is obviously not scalable. There are smart ways to circumvent this, like using https://github.com/jitsi/jitsi-videobridge and other solutions. But essentially it seems that WebRTC is meant for one-to-one communication. Most of the tutorials out there serve that purpose, not group conferencing.
Questions -
I've read that Google Hangouts and Facebook Messenger use WebRTC for their group video chats but how exactly have they solved this problem?
Are server based Websocket implementations like uws viable for real time communications? (due to added latency)
Is there any plan to address group conferencing from the WebRTC or is WebRTC just not meant for this use case.
Thanks in advance.

Based on my scenario should i go WebSockets or XmlHttpRequest or both?

I am about to make a turn-based game in the Monkey language (Cross-platform translator). The game will use the HTML 5 platform. This game will play online where players can match against each others (It can be a 2vs2 match). I recently reviewed a tons of solutions and i stopped on 2 of them. The good old XmlHttpRequest and the new one WebSocket which seem to be in a recommandation state from W3C which is rather good. There also another technology which i was interested which is PubNub, a push service. This service actually push messages to all clients connected and is really fast.. but this come at a cost later and is restricted in the number of messages you sent. By that i mean it cost you 15$ per month for 1000 connections and 1million message then +1$ for another 1 million and go on. There actually 3 actors, the client written in monkey (HTML5) the server written in C# because i know well the language and PubNub for broadcasting messages. The client will only send requests to the server and the server is relaying the messages to PubNub which in return send back to clients. I had two plan in head considering thoses facts :
The game is written in HTML 5 but i may port it to other languages (Android as an example). I can't do that if i use WebSockets because i would have to get additionnals librairies to handle this and i don't want to invest more time in it. So i will focus on HTML 5 for now but porting it is alway an option.
Its a turn-based game so yeah XmlHttpRequest seem to be suitable for this task but at which point ? If i have over 1000 connections sending requests will it be able to support it ? Each turn is an unique request but chat messages is also a request and private messages too, getting player data too (before you join any game) etc. An advantage over WebSockets is that Http Get are easy to make and is supported easily on many platforms so i could obviously go the Android route if i choose this.
I don't want to invest more time in others technologies than thoses stated here.
PubNub cost money in the end but it is very efficient for pushing messages so not using it might be risky and would force me to do the messages relaying code myself.
So here my 4 plans.
Going with WebSockets and use Alchemy as a WebSocketServer for C# which i tested and work wonderfully and still have the PubNub actor in the backend for relaying my messages.
Go with XmlHttpRequests and use a simple WebAPI for the request Gateway.
Go with both. Make the client independent on which technology to choose. Use XmlHttpRequest as a fallback and make the server support both connection. PubNub will still be the relaying actor here which should make the whole stuff communicating.
Go with WebSockets but without PubNub.
So which route do you recommand me to go and why ?
Thanks!
PubNub for Indie Games and Multiplayer Online Worlds
Networking is hard when you are building a simulated world for people to explore. These simulations are often considered. PubNub is the best solution for indie game developers for all the good reasons. Enable Networking in your Indie Game is simple with PubNub's two easy functions PUBNUB.publish({...}) and PUBNUB.subscribe({...}). Adding Networking in your apps allows you to implement multiplayer games and more! Implement real-time notifications between HTML5 browsers, phones, tablets and more. Everything can send and receive data from everywhere on Earth.
WebSockets or XMLHttpRequest or both?
PubNub makes this choice for you, automatically detecting the best connection type suited for your player's systems and capabilities. That means your Indie Game will function as expected on all platforms including Android, iPhone, Chrome / Firefox / IE and more. That makes it easy, so you don't need to worry about transports or delivery methods to the diverse number of platforms that exist. Your team only needs to focus on making a compelling and engaging online multiplayer game.
Online Indie Game - Server Logic
You need a way to securely collect player progress and track actions and consequences on your world. You may also need to track inventory and player state. There are two great services for this.
RoarEngine
First let me recommend http://www.roarengine.com/ RoarEngine an online hosted Game Engine which gives you a Scripting Engine to Unleash your creativity with limitless possibilities by writing your own custom logic. Events, challenges, timed mechanics, you name it. RoarEngine also offers Items & Gifts economy to Shape player interactions by creating items that affect player state, powered by a full featured shop, currency and gifting system that can be managed on the fly.
Parse
I highly recommend https://parse.com/ an online cloud hosted service which managers you user/player sessions. Parse is great when you need an online platform for more abstract and less tailored to gaming; which allows you to define models and objects in the way you choose. With Parse you don't need to focus on building infrastructure, you instead get to focus on building your game world state.
PubNub HTML5 MMO XKCD Game Multiplayer
We wanted to demonstrate the capabilities of HTML5 Indie Games used together with PubNub to enable expansive gameplay that joins players all across the world in real-time. This game uses HTML5 Canvas with multiple users flying around with a balloon figure. If you got stuck, you can click your balloon guy and turn into a ghost to seamlessly move through the landscape unhindered by mortal barriers like trees and hills. There was a problem however with the scaling of users on ordinary off-the-shelf gaming servers. The max concurrency could only be a few users at a time leaving many wonder where the MMO part of the MMO was. PubNub makes this automatic and at a lower cost compared to self-hosting options. Teams who are considering self-hosted options will consider the cost compared to maintaining and hosting a networking cluster for gameplay.
PLAY LIVE - http://www.pubnub.com/static/pubnub-xkcd/index.html
BLOG - http://blog.pubnub.com/xkcd-mmo-websocket-scaling-with-pubnub/
SOURCE CODE - https://github.com/pubnub/pubnub-xkcd
The links above show you a live HTML5 Canvas based game that is powered by PubNub multiplayer capabilities.
Take a look at http://realtime.co - Its a Realtime platform similar to PubNub and with more capabilities.

Real Time Server vs Client to Client?

Hey all,
I'm an iPhone developer looking for a simple, but effective way to host multiplayer games. I've been able to create multiplayer games over local WIFI and Bluetooth, but connecting accross the internet has always been something I've wanted to do but never really been sure how.
My question is 2 fold: Is the performance difference between a hosted server and a client to client connection that much better to make a hosted server worth it?
And secondly, if that is true...is there any kind of hosting provider that won't charge hundreds a month? I currently have a $5/mo website plan which definitely doesn't allow that.
Thanks so much!
-Luke
Your parameters are fairly vague, so I will give you my standard "Answer for a client who may know how to specify based on my broad picture" answer :
Up front, you cannot beat wifi speeds with internet speeds... you can sometimes beat bluetooth with internet speeds. :)
There are a multitude of online games which pass large amounts of state information to multiple clients, so yes, client<->server<->client communication is doable and very effective, performance-wise...
As for cost... That depends on the amount of subscribers and the amount of data to be passed to them/received from them.

Flash communication options for 2-player-games

I am currently working on a project that embeds a flash game, that uses Smartfoxserver for the flash communication. That communication is mostly just synchronizing the cursor and object movements between the two players.
Since I am not a flash guy, but a ruby programmer, I got curious: What kind of communication options does flash offer for this kind of time sensitive data exchange? I was thinking of writing a ruby-eventmachine based communication server to minimize the dependencies on external programs. Would that even be feasible?
Although I don't have a complete answer for you, because I'm not done myself, I have found myself in almost the exact same position as you.
My current approach is for my ruby server to essentially just be a socket server that handles all of the communication between clients, however I personally intend on keeping any of the logic outside of the server ( unless I run across a reason to change that idea).
If you haven't done any socket programming in ruby, I recommend the following as a jumping point. This is an IBM document on Ruby Socket programming and discusses an approach for asynchronous data:
Ruby Sockets - IBM
I think what it ultimately comes down to as well will be performance. I currently use a version of my ruby server in my daily work, but the data doesn't have to be updated in a time sensitive manner.
You can create a server in (almost?) any language that supports sockets and manage your clients with that.
From a flash perspective you could use ruby, but I don't know how fitted ruby would be for the task...I mean, you can make a PHP socket server but it would not handle much stress.
An alternative to SmartFoxServer could be open sourced Red5, written in Java.
If you want to know about flash built in capabilities in handling p2p:
Flash p2p: Everett Church
In Flash Player 10 adobe added Live media (RTMFP) support- Media was always sourced from the publishing peer. In Flash Player 10.1 beta they introduced groups and application-level multicast.
However, you would still need a server (Stratus) to handle introductions and manage active connections. ( Also, I regard it as geared towards flash video, Stratus does not support shared objects or scripting. So with Stratus, your applications will be clients communicating directly with each other.)
Edit:
After re-reading your question and the answer provided by Beanish, I think the first time I got your question wrong. So I just re-wrote my answer...

Resources