Getting Started with Flash Game Development

Okay, I’m going to make this quick and to the point. I’ll leave digging up all the details to the interested reader, but that shouldn’t be a problem with the likes of Google, etc. I’ll go into more detail about each element of Flash Game Development in later posts, but first for some basic concepts…

  • The Flash IDE — by this I mean the original/traditional Flash authoring tool released by Macromedia (now Adobe). It’s a fully integrated development environment for Flash by definition as it essentially represents the official feature set. The software is primarily targetted at artists and designers, with programmers (and larger application-like development) being a secondary concern.
  • The Flex IDE — this is the most recent offering from Adobe in the Flash line and is targetted at rich internet application (RIA) developers (programmers). It’s more similar to something like Java or C#. It’s still al of the same Flash technology (well, Flash 9 technology) just packaged for application development. This is a very interesting development, but it’s a little early for web-based games because of the lower version penetration than Flash 8. But this is changing rapidly as MySpace “officially” requires Flash 9 now for security reasons, and the Flash 8 player can update automatically (and very quickly) to Flash 9 as well. As a result, Flash 9 will probably achieve the necessary 85%+ penetration by this time next year (based on past Flash version pentration trends).
  • SWF — ShockWave Flash, the output of the Flash IDE, and what runs in your browser (or technically, it runs in the Flash Player plugin in your browser or on your desktop). SWFs is a compact, streaming file format that is somewhat documented by Adobe/Macromedia… their documentation is usually just bad enough to slow down efforts to replicate their Flash IDE’s full feature set. And it is not an open standard, though it practically is because it has been so often reverse-engineered with a high degree of accuracy (and Adobe has no problem with this). Many non-Adobe/Macromedia Flash-related projects operate with the term “SWF” instead of “Flash” as “Flash” is a trademark of Adobe/Macromedia and they don’t take kindly to folks incorporating it into their product names (they prefer folks use “SWF”).
  • ActionScript — the programming language for Flash. ActionScript was originally a very stunted language used for some rudimentary scripting, but was soon morphed into a real language (EMCAScript, i.e. JavaScript). It’s a full-blown object-oriented language that supports both strong/static typing and weak/dynamic typing. It is executed by a virtual machine in the Flash player, thus it is not as fast as native-compiled code (C++) and Flash currently does not have a JIT (just-in-time compiler) like Java or C#. But, Flash Player version 8 and version 9 both made significant strides in improving virtual machine performance. One caveat of the VM is that the Flash Player will allow the user to kill any long-running (i.e., a few seconds) loops. The most commonly discussed/used version of ActionScript is ActionScript2 (AS2); ActionScript3 (AS3) was released as part of the Flex/Flash 9 package.
  • MTASC — the Motion-Twin ActionScript Compiler is what really blew open the open-source Flash community. Initially a replacement for the Flash IDE’s slow (and buggy) compiler, it has turned into the gcc (Gnu C Compiler) of the Flash universe. It can compile raw ActionScript (text files, just like every other programming language) into SWF’s. These SWF’s can then be imported into the Flash IDE or used directly.
  • SwfMill — an XML to SWF to XML processor, this tool serves as the “linker” in our open-source toolchain. SwfMill can take a list of images, SWF’s, and sounds and convert them into an SWF file. Combined with MTASC one can go from a directory full of text files, PNGs and WAVs to a stand-alone SWF game that runs in practically any web browser.
  • FlashDevelop — the open-source IDE for Flash. Written in C#, open-sourced, and actively developed, this is one of the best IDE’s available for Flash (or rather, ActionScript). It uses MTASC and SwfMill under the hood and provides a great editor on top. Includes all of the features one would expect: auto-complete, projects, plug-ins, integrated help, library browsing, etc… Highly recommended.

Okay, now to ramble a bit… sorry for the poor organization of this post, but I’m wanting to just get some of this information out there in one place and I’m trying to do it quickly (while at work!)…

There are a few tutorials that nearly all Flash game developers have seen, and they discuss Flash game development from a “traditional” perspective using the Flash IDE. They don’t really cover how to develop using only the free tools. But, they are useful for understanding the basics of Flash as they relate to games. TonyPa’s tutorials on tile-based games (and check out his games they’re quite a bit of fun!). Kirupa also has some excellent Flash tutorials. Flashier Flash has some excellent tile-based games tutorials as well.

In general, I’d suggest aiming to do Flash development very similar to traditional, 2D sprite-based development. With Flash 8, there are raw bitmap structures that you can access. And bit-blits are fast in Flash (from one bitmap to another), so you can implement sprite-based stuff just as you would in a traditional language. You can then take advantage of Flash’s extras, such as fast custom filters and great font support.

Like I said, I’ll speak about all of this in greater detail in a series of future posts, this is just the start.

3 Comments so far

  1. Patrick on August 28th, 2006

    Thanks for this Troy.

    Is it reasonable to try and implement 2D physics with 3D sprites in Flash?

  2. Troy on August 29th, 2006

    (I responded last night, but apparently there was a problem with the post and it got lost… so I’m posting again, hopefully with all the same quality info!)

    I’m not sure what you mean by “3D sprites”? If you’re referring to something like particle systems, or perhaps pseudo-3D like Space Harrier (SEGA GENESIS), yeah definitely. If you’re thinking textured polygons, then you can fake it… kinda… very slowly.

    Flash is a 100% 2D engine. It uses no hardware acceleration (though it has very fast 2D operations written in native assembly). If you want to do 3D (polygons, textures, etc.), it has to be done like it would have been done in the pre-hardware-3D days, which means a very limited number of polygons and an even more limited amount of texturing on those polygons.

    There’s still a lot of tricks, though. Flash can do scaling very fast, so you can do a lot of pseudo-3D effects with very simple math (scaling based on distance), including full particle systems. Combined with Flash’s bitmap filters (blurs, drop shadows, glows) you can do some very nice effects.

    As far as 2D physics goes… I’d recommend checking out the guys who did ‘N’. Their homepage has a link to the a presentation they gave on doing high quality physics in Flash (it’s what they used in ‘N’). The good news is that it should be even faster in the Flash 8 and Flash 9 players as ActionScript has been significantly optimized (I believe they were targetting Flash 7).

    So, yeah, 2D physics isn’t too much of a problem, as long as you’re reasonable.

  3. [...] “Getting Started with Flash Game Development‘ – Original [...]

Leave a Reply