Flash and Actionscript 3 for games
I thought I’d write a little about my take on AS3 and Flash 9 for games.
Flash 9 and AS3 bring a lot of speed enhancements, which is obviously very much needed for games - especially the newer games and even 3D games, which are starting to appear more and more for Flash (which is amazing in itself, it’s quite a feat for Flash to be able to push that kind of processing!).
For me, the actual turning point the started me learning Actionscript 3 was the Sockets support. No longer was XML or a ‘file-based’ transfer mechanism needed - I could directly interact with a socket server and start transfering data at high speeds with low latency. The overhead of ‘file-based’ methods - such as XML, communicating with PHP, etc - are too much to make even remotely ‘real-time’ effects possible. Chat is possible, as is turn-based games, but anything beyond that not. The game I’m developing is actually turn-based for all intents and purposes, although it’ll be quick enough that it should feel almost real-time. Getting absolute real-time was considered - but the packet rate simply wasn’t high enough to achieve this. (That would be, controlling each ships with the cursor keys and be able to fight battles completely manually. As soon as the speed picks up, discrepencies in lag, packet loss, sync, etc, make this impossible, sadly).
Broadband has also moved the bar up a large notch - now, transferring a few megabytes of game data is possible - almost expected. Music, heavy graphics and other effects can make up a game that was otherwise restricted a hundreds of kilobytes or less. My game already takes up 500Kb and that’s without assets - so I’m going to have to reduce this - but it’s not a show-stopped. Not to mention anyone with less than broadband will probably have a less-than-perfect game-play experience.
To anyone deciding if AS3 is capable of the particular game you want to make, the chances are it is. When it comes to high-speed real-time communications over the Internet, you’re going to have your work cut out no matter what language you chose - and AS3 isn’t going to help matters, for one thing only TCP/IP is supported - no UDP support here, I’m afraid.