Swarmastica: A Flash Game

I decided to try my hand at making a Flash game using Actionscript 3. I have mixed feelings towards Adobe technologies, but AS3 is a significant improvement over AS2. The syntax is now much closer to that of Java, with cleaner object-orientation and strict type checking. They also released their Java-based AS3 compiler under an open source license, allowing developers to write and compile code in practically any environment they want.

The first step in developing any Flash game is coming up with an entertaining idea. Since this is my first game, I wanted the idea to be simple enough to quickly implement, but I still wanted it to be complex enough to be interesting. Tower Defense is a great example of a popular game that’s relatively simple to implement, but also has enough complexity to be fun.

I’m a fan of real time strategy games that shun micro-management and busy work. Granted, this isn’t always an easy task. If you remove too much work from the user through automation, they become bored. And if you require them to handle every minor detail, they become overwhelmed. The under-appreciated Globulation is an obscure but innovative approach to this problem. Most RTS games require the user to manually create, direct, and assign every sprite for some arbitrary task. Globulation instead automates most of these functions and lets the user focus on the big picture, like where your armies should be directed and what percentage of your resources should be devoted to various tasks. For example, if you wanted to attack your opponent, instead of selecting a group of soldiers, a target, and clicking “attack!”, you’d create an attack point near your target and give it a weight proportional to how many soldiers you want to invest. That proportion of your soldiers will then automatically start attacking. That is, if they’re not overworked, hungry, or suicidal. I made the novice mistake of directing all my soldiers to do too many things at once. Imagine my surprise when more than a few wandered out to the dessert to die. There’s a great managerial lesson in there somewhere.

These two games outline my main inspirations. I decided to make something slightly more complex than Tower Defense, but significantly simpler than Globulation. Both have autonomous critters as a common theme. In Tower Defense, this autonomy is limited to simply firing when the enemy is near, but gets much more complex with Globulation.

So here’s the basic idea. In my game, there are 5 types of critters that the user can buy and use to fight the opponent. Each critter has different strengths and weaknesses. Like Tower Defense, most critter types attack by firing projectiles. However, unlike Tower Defense, the critters can all move and pursue their own simple objectives independently of the user.

The user decides where to place critters on the screen, and can tell critters to gravitate towards a particular spot, but otherwise each critter acts completely on it’s own. They attack when an enemy’s detected. They retreat when injured. They wander around when bored. Killing enemy critters earn you money, which you can use to buy more critters. I purposefully kept the critter design very abstract, partially for aesthetics and also to speed up rendering time.

The five critter types are:

  • Dragoon
    • Pros: Strong long-range attack.
    • Cons: Slow speed and weak shields.
  • Mine-Layer
    • Pros: Creates a wide field of powerful mines. Strong shields.
    • Cons: Cannot directly attack.
  • Puppet-Master
    • Pros: Can control an enemy critter from long range
      (except Wraith and other Puppet-Masters).
    • Cons: Cannot directly attack.
  • Soldier
    • Pros: Strong weapons and shields. Decent speed. Good at close range attacks.
    • Cons: Prey to long range attacks.
  • Wraith
    • Pros: Invisible when not attacking.
    • Cons: Weak shields.

It’s still rough around the edges. I’m still tweaking the game play and working on an in-game guided-walkthrough to lower the learning curve, but most of the features are there.

I used the AS3 port of Box2D for the physics simulation and PureMVC as the application framework.

Please feel free to try it out the Beta.

Leave a Reply