How to build a game with Adobe's RTMFP? - adobe

I want to develop a simple car race game, where certain number of players connect to a lobby and play the game at the same time. A game like haxball.
I read that RTMFP is a good choice for that. I know ActionScript 3, so where should I start to build such a game?
I found Cirrus, but in this article, it says :
In order to use RTMFP, Flash Player endpoints must connect to an
RTMFP-capable server, such as the Codename Cirrus (previously Codename
Stratus) service or Flash Media Server 4. Cirrus is a hosted
rendezvous service that aids establishing communications between Flash
Player endpoints. Unlike FMS, Cirrus does not support media relay,
shared objects, scripting, etc. So by using Cirrus, you can develop
applications only where Flash Player endpoints are directly
communicating with one another.
So is cirrus suitable for my need?
And so, where should I start to code? Maybe an example game?
Thanks in advance !

Citrus is fine for what you need. I created a game similar to haxball but connected the players directly to reduce lag in a real P2P mesh. At haxball, each client connects to a server and the latency is higher and if the host decides to leave = Game Over
Check out Bilu Ball you can see the game in action and the low latency gameplay.
Also check for some P2P libraries which will handle all the communication between client, I used this one: http://code.google.com/p/as3mul/
Also read about how to reduce lag and techniques how to decrease the size of the messages between clients.

Cirrus is deprecated by Adobe.
You can use either Flash Media Server for Amazon AWS.
Or hosting services like Influxis.

Yes. You can very well go with Adobe Cirrus for your application.
However, it's a free p2p service and there are certain limitations for using their service. If your application makes use of more than 10000 concurrent connections to cirrus, then you need to get a consent from Adobe.
Currently, the cirrus service is being abused by some people it may be down at present. But Cirrus is not officially deprecated

Related

Ad-hoc based chat application on Qt (without a router)

I am writing a chat application in QML/C++. I have already implemented an option to chat locally (with people in the same network) and I am currently working in implementing a bluetooth chat option.
However, one early user of my application suggested me to implement an ad-hoc based chat option that would communicate each device directly (without the need of a router, in other words, peer-to-peer). This feature would be very useful if the user(s) are located in a place without an internet access point, say a music festival or in an event.
My application uses the Qt framework and it has the necessary tools for me to implement this feature, however, I am a hobbyist programmer and I don't have a lot experience dealing with network connections.
Do you know any way to implement this ad-hoc, peer-to-peer feature? (or know any helpful websites/links).
Thanks in advance,
Alex.
You can use TCP or UDP protocol for your chat application.
TCP = connected protocol
UDP = "broadcast" protocol, more speed
Example here :
http://qt-project.org/doc/qt-5.0/qtnetwork/network-chat.html
Or here : http://qt-project.org/doc/qt-5.0/qtnetwork/examples-network.html
Yekmen

How does Google Chat servers push notifications to hundreds of millions of clients?

Consider a web application such as Google Chat, where the servers serve hundreds of millions of clients simultaneously. In such application, the servers have to push notifications to clients at near real time (in the chat example - incoming messages, presence notification etc.).
How do they implement it? Significant part of the clients are browser based. I suppose polling would overload even Google's servers. So, are they using something like Comet? If so - do they need to allocate a server for every 65536 clients (maximum TCP connections per machine)? I understand that there is a way to circumstance this limitation but I don't know how it's implemented.
Chat is not handled by single application / hardware / instance.
They definitely using many instances with load balancing that allows to scale chat system horizontally. It might be dedicated for regions or just single clustered system (I believe it is dedicated within regions but still clustered within region).
As well you can have as many connections as hardware and network will handle but not 64k.
Because 64k (actually less then that) is regarding Binding sockets (server sockets, but not client ones).
In case with google and based on supported browsers, they definitely use mixed technologies to communicate selecting the most powerful based on browser support. That can be long-polling, sockets and even oldest one: simple ajax.
As well for example facebook chat is based on erlang. And using erlang there is many examples having more then million connections.
I don't know how Google handle this, ans they probably won't tell us. But, today you can deal with http streaming, websockets or long polling to build such application. To give you an example Atmosphere framework
is a tool to build "real-time", efficient and scalable web application.

Adobe Stratus Drawbacks

Am wondering if there are any drawbacks of using Adobe Stratus. Since it is only P2P, when will there be a case where P2P can't be used? On the site it says something like when UDP packets are blocked. How often is that? Say a thousand people use the service, approximately what percentage would not be able to use it?
Also, is it possible to port a Stratus app to AFCS/LCCS without any modification?
Thank you for your time.
About half on average are not able to talk directly. Depending on service provider, organization if any, country, continent, weather, extraterrestrial presence etc :-)
with a pretty global audience, i had about 20% failing the initial test with cc.rtmfp.net . then a number of those who passed couldn't make direct connections to some users, although they could with others.
i wouldn't use stratus by itself for anything where reliability matters. use fms until red5 adds support for rtmfp
I have been looking at this for a client who is developing a peer to peer video conferencing app.
In his experience about 10%+ of people out of a small group surveyed had UDP blocked, and therefore were unable to use Adobe Stratus to make connections and LTMFP

Good asynchronous TCP based protocol for non-realtime games?

I'm developing open source cross-platform platform for non-realtime multiplayer chat/game system. Like card games, boardgames, turn-based, etc. Servers are spawned server-side (not from users computer). Client has these game modules or downloads game module and then runs them.
I've come to conclusion that best protocol is "IRC-like". So that there is channels for chats and games.
For example there's channels
Lobby
Lobby.English
Lobby.Finnish
Lobby.Mygame - chat for one particular game
Lobby.Mygame.English
Game.Server.Announcements - When new server is created server shouts it here. All clients are listening to this. You can get list of all game servers running.
Game.3636534.chat - Spesific game chat
Game.3636534.game - Users send commands like Buy X here and server responds to them
Some stuff i've looked into
XMLRPC is no good because you have to poll for new data every few seconds
ICE - Pretty good but should be a bit more RPC friendly
ActiveMQ/RabbitMQ and it's publisher/consumer system is something i'm looking for. Problem is that good user ACL is missing. So basically everyone can "go" everywhere and send any garbage to the main AMQ server.
The supported programming languages for this should be at least C#, Java and Python. Encrypting support should be also there. And of course free.
You should look into XMPP which is an open standard for asynchronous message passing. It has support for encryption, firewall traversal and much else. Servers and libraries are available for many, many platforms including the ones you mention.
Links to implementations and information: http://xmpp.org/

How do I connect a pair of clients together via a server for an online game?

I'm developing a multi-player game and I know nothing about how to connect from one client to another via a server. Where do I start? Are there any whizzy open source projects which provide the communication framework into which I can drop my message data or do I have to write a load of complicated multi-threaded sockety code? Does the picture change at all if teh clients are running on phones?
I am language agnostic, although ideally I would have a Flash or Qt front end and a Java server, but that may be being a bit greedy.
I have spent a few hours googling, but the whole topic is new to me and I'm a bit lost. I'd appreciate help of any kind - including how to tag this question.
If latency isn't a huge issue, you could just implement a few web services to do message passing. This would not be a slow as you might think, and is easy to implement across languages. The downside is the client has to poll the server to get updates. so you could be looking at a few hundred ms to get from one client to another.
You can also use the built in flex messaging interface. There are provisions there to allow client to client interactions.
Typically game engines send UDP packets because of latency. The fact is that TCP is just not fast enough and reliability is less of a concern than speed is.
Web services would compound the latency issues inherent in TCP due to additional overhead. Further, they would eat up memory depending on number of expected players. Finally, they have a large amount of payload overhead that you just don't need (xml anyone?).
There are several ways to go about this. One way is centralized messaging (client/server). This means that you would have a java server listening for udp packets from the clients. It would then rebroadcast them to any of the relevant users.
A second way is decentralized (peer to peer). A client registers with the server to state what game / world it's in. From that it gets a list of other clients in that world. The server maintains that list and notifies the other clients of people who join / drop out.
From that point forward clients broadcast udp packets directly to the other users.
If you look for communication framework with high performance try look at ACE C++ framework (it has Java bindings).
Official web-site is: http://www.cs.wustl.edu/~schmidt/ACE-overview.html
You could also look into Flash Media Interactive Server, or if you want a Java implementation, Wowsa or Red5. Those use AMF and provide native functionality for ShareObjects including synching of the ShareObjects among connected clients.
Those aren't peer to peer though (yet, it's coming soon I hear). They use centralized messaging managed by the server.
Good luck

Resources