Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Flash has come a long way in the last decade, and it's a well-kept secret getting a Flash game to connect to a multi-client server for chat and/or basic avatar movement in real time.

Why has the industry as a whole not made this a common-knowledge type of thing yet? We keep pushing to the web but I am finding it incredibly difficult gathering learning material on this subject.

Sure, I can find multi-client server socket tutorials in various languages (using select statements and/or threads to handle multiple socket connections), but in regards to Flash applications inside of a browser? NOPE!

Can everyone please share what they know? :] It's a subject I'd really love to get into but I'm afraid I just honestly don't know enough about how to do it.

share|improve this question
    
I was looking into this very thing many years ago before Adobe was in the picture, and I telephoned Macromedia directly after not finding anything online. They told me that only XML communications were supported, and that direct socket I/O simply wasn't possible and wasn't in the plans. For an MMO, reading/writing specific bytes of data is important from a performance optimization standpoint, and XML carries ridiculous amounts of overhead for this sort of thing (it's wasteful to package/parse 50+ bytes to send/receive a few bytes of data repeatedly -- that CPU power should go to gameplay). –  Randolf Richardson Jun 10 '11 at 1:45
add comment

2 Answers 2

The reason you cannot find any info about running a socket server from Flash within the browser is because it is not possible. You can only connect to a socket server from a Flash movie running in the browser.

To run a socket server with Flash you need to create an AIR 2.x application that runs on the desktop. This article on Adobe AIR Developer Center should get you started.

share|improve this answer
    
I meant exactly what you said - connecting to a socket server from flash, not running Flash AS a socket sever (I never even said that to begin with..) –  shadowprotocol Feb 9 '11 at 20:29
    
You mentioned "multi-client server socket tutorials ... handl[ing] multiple socket connections". I read that as wanting to run a socket server inside of Flash Player. Anyway, the article I linked also explains how to connect to a socket server in Flash. –  NoobsArePeople2 Feb 10 '11 at 5:08
add comment

I'd imagine the reason you're not hearing much about Flash connecting to a multi-client server is possibly because you're researching only the Flash-side of things and not the server-side element.

It's less of a front-end / client-side issue, and more of a server-side management of state, connections (i.e. players), data (-base) updates, and what-not.

I've seen a nice abstraction used with SmartFoxPro. They offer the plug-and-play chat client, room client, in-game API that you can hook into as a flash / actionscript developer.

Honestly, you should take a look at multiplayer game development from the server-side perspective (java - redwarf, ruby, python (piston as a framework), even php using a framework like codeigniter for a lightweight application).

Take a look at researching from that angle and hopefully that helps!

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.