<<prev 2008-06-28 next>>
Very few Flash games are networked these days even though the vast majority of console and PC games are. What's going on here? Let me enlighten you.
To get any sort of decent network functionality working in Flash (I'm talking Sockets here, not that URLLoader crap) there are some pretty ridiculous hurdles to overcome:
  1. Most Flash programmers are not good programmers. It doesn't help that Flash CS3 is too easy to use. By that I mean that designers are now programming games, not programmers. The result of this is that many shittily programmed games come out thus diluting the very few good Flash games. It's my opinion that if you can't make a good game, don't distribute your game, keep it to yourself and have fun with your friends.
  2. Adobe's network security measures are RIDICULOUS. In order to make a connection to a server, you must first make a connection to the server and ask if it's ok to make a connection via this socket policy bullshit. WTF is that about?! To make things worse, the socket policy has to be served from port 843 (which by the way Adobe hasn't registered with the IANA). As if that's not enough, the server must also have a 'crossdomain.xml' file on the root of the server that also allows you to access its content. Yea, I'll just go ask my webhosting company for that....
  3. Speaking of hosting, developers of networked Flash apps are faced with two options: get your own private server or find an excessively overpriced Flash hosting service. Of course if you get your own private server you then have to set it all up yourself, properly secure it, and install a daemon to serve back Flash socket policies on port 843. Fun times.
  4. Flash games inevitably spread all over the internet and thus the networked ones end up using a lot of bandwidth from the hundreds of thousands of users or more playing them. I'm planning on Beat Me Up Too using around 100GB/month in bandwidth.
Very few developers make it past these hurdles. It should not be this difficult to deploy a multiplayer game! Hopefully in the somewhat near future, things will somehow become easier for this thus enabling the social Flash game revolution to kick into full swing.

8 Comments
iongion
s if that's not enough, the server must also have a 'crossdomain.xml' file on the root of the server that also allows you to access its content. Yea, I'll just go ask my webhosting company for that....

using socket server, you can forget about normal hosting sollutions.

did you try using flash media server hosting ? it can be viable solution for your issues, you can built interactive games much easier with fms than with sockets, it does synchronization by itself and all the kitchen stuff in network games programming
Lucas Araujo
Well, now you have the nonoba.com and their Multiplayer API:

<a href="http://www.nonoba.com/developers/multiplayerapi/overview" target="_blank">http://www.nonoba.com/developers/multiplayerapi/overview</a>
Frédéric Dénommé
OK I'll bite on this one. I made a multiplayer flash game in 2001 called Underground. It was about breakdancing and tagging subway stations on a map and it used LoadVariables in Flash 5 and it worked pretty good. But as you say - sockets are usually the way to go now. I remember making a few sockets tests in 2002-3 without too much trouble (two players moving on a map - didn't go very far in DEV but the basics worked great). Why is it hard to use crossdomain.xml? Why is it hard to use port 843 (i don't remember having trouble). I had used a PHP socket server tutorial and had managed to tweak it pretty easily. Of course - some hosting might limit you on that - but it's not a problem with the technology per se. So yea - I would say the main reason was lack of advanced web/backend programmers in Flash back then. But is this still a problem really? I have a hard time believing things could be worse FIVE years later - no?
Will
To clarify, it's hard for the beginner but more of just a pain in the ass for advanced programmers to set up. As far as the crossdomain.xml thing goes, the frustrating this is how Adobe seems to <a href="http://willperone.net/Code/as3error.php"> randomly change the specs/requirements for the crossdomain</a> and the only way to find out about it is that your stuff suddenly doesn't work.
James Hofmann
This isn't a Flash networking problem, really - Flash has its share of bugs and issues(most notably, there's an outstanding bug in which failure to connect for the security policy means you have to refresh the page, as it'll cache the failure and never try again) but the biggest problem is that network programming, and especially multiplayer network programming, is just plain hard. You can make very few assumptions about the state of everyone connected to the game: whether their connection is still alive, how much bandwidth is available, how much you can trust them, how well they will predict and sync when given limited information about state.

There are annoying limitations that come from the security requirements, for sure - it's quite a baroque system - but once the connection is established and you have settled on a transmission format things become a lot smoother.
BlogReader
<i>It's my opinion that if you can't make a good game, don't distribute your game, keep it to yourself and have fun with your friends.</i>

I stopped reading there. Games in flash are meant to be fun casual ones. If everyone had to wait for Perone's blessing on if their game was a "good" one (WTF does that mean) there wouldn't be many out there.
Will
This is an article represents my <i>opinion</i>, you have every right to disagree and of course 'good' is a very nebulous term.<br>
I do think that independent developers are responsible for a lot of the <a href="http://orange.half-life2.com/portal.html" taret="_blank">innovation in the game industry</a> but there are also the developers that essentially copy existing games or pump out half assed game after half assed game expecting to make a quick buck. Naturally we all start somewhere; when I began making games 15 years ago, they all pretty much sucked but hell, they were <b>my</b> games and I was proud of em. Given today's insta-depolyment technology however, I don't believe I would have released them to the masses.
Raul
http://www.showdowninteractive.com/
check it out!
we did'it for the one show festival of this year
Saludos!!