Note: Sorry for not updating this blog sooner: I’ve been slowly writing this post and took me longer than expected haha!
As you may or may not know, Armed with Wings Rearmed is a remastered edition of the original AwW1 game I made in 2008. The original was written in ActionScript 2.0. In an effort to reduce development time, I thought it would be best to continue to develop Rearmed in AS2.
The game is now ported to AS3! What a marvelous milestone to reach! After conquering nearly every ActionScript 2.0 limitation, one limitation proved to be an unsolvable brick wall… native Gamepad Support. Now that the game has been ported to AS3, Gamepads are supported ans I’ve found user engagement to be much higher! I’ll admit that porting the entire game JUST to support controllers seemed to be more work than it was worth – but I can confidently say that it has been worth it. People are having much for fun playing Rearmed AND the new codebase is FAR better, resulting in a better game and enabling me to work faster.
The Challenges have been numerous. I took advantage of many AS2 kinks, many of which are not supported in the much more proper programming language of AS3.
AS2 allows for not just adding code inside an object, but adding code on top as well. For example: I have an enemy character with code and behavior embedded in the object. I could have 3 of the same enemies on stage and they all share the same code. What if I wanted one of them to have more health than the others? I could add code on just a single instance, increasing the health of just that single enemy. Coding on an object is quick and handy for many different reasons and so I took advantage of that feature. When porting the game to AS3, that had to change. I compensated with component definitions with default values.
I tried to keep the core engine structure very similar to the AS2 project to reduce confusion. The idea is to keep development simple and straight forward with few procedures for generating new content. Pushing in content is just as easy thanks to my new engine structure. This structure is more unified and better handles events and updates. The hurdle was trying to find a suitable solution to they way my level updates work. Each level is placed on the timeline: level 1 is on frame 1, level 2 is on frame 2, level 3 is on frame 3 ect… Each frame also has a levelUpdate() function. Each of these functions contained code specific for the corresponding level. In as3, flash didn’t like how I had multiple levelUpdate() functions, it only wanted one. My solution was to have just one levelUpdate() function that would loop through an array of objects. Whenever a new level is loaded, that array is cleared and populated with new objects.
The Gamepad itself introduced some interesting challenges. Not super had to solve… but interesting indeed and caused me to rethink my input bindings. Example: Pausing the game on a keyboard would be hitting ESC key. On a controller, it would be the Start button. The pause screen has a few different options. Highlighting the settings button then pressing Start on the controller should open the settings panel. But, hitting the keyboard equivalent is ESC, which should take the user back to the game. That is only one example of when the keyboard and gamepad inputs sometimes have different behavior.
Results And Improvements now make this project FAR more manageable. Every asset, sprite and file has been carefully renamed with a smart naming convention. As I passed each game element from the old project to the new, I had the opportunity to examine each one. Much of the code was reused too, but even more was written from scratch. As I had done all the work previously, redoing it was super quick. The code is FAR more neat, optimized and manageable.
All this means little to the user. But as a developer, it’s always better to be working in a clean environment. I’ll be able to serve the user more effectively and deliver more content, quickly without friction from a messy decompiled project.
The State of Rearmed is now far ahead from where I left it in AS2. All the levels are ported AND improved! There are also more levels than in the old project. The game supports Gamepad which increases user retention and simply makes it more fun to play. Now i’m working on a brand new feature: Equipment system!