First Game of the Year – Progression
I’ve made progress on my strategy adventure game, lovingly code named Mr. Bubbles. It’s a strategic platform game where all the levels are procedurally generated; you’ll never play the same level twice. I’ve pretty much finished the strategic part of the game and am now starting to concentrate on the platform levels as well as the enemy AI and fine tuning of the level generator.
All the game logic is written in structured ActionScript. I say structured because I use classes and external files and other modern programming paradigms as opposed to embedding all the code in the flash project itself, which is the worst kind of spaghetti code imaginable. Most of the time ActionScript doesn’t tell you about problems the way, for example, C# would tell you about at compile time, but rather just silently fails and you end up scratching your head, wondering why some of your graphics aren’t showing up in the correct order.
The procedural content generation module is written in C#, and the source code can be found on the My Files page. The flash part is embedded in a simple Windows Form window (created in Visual Studio 2008) using the Internet Explorer ActiveX control. I originally had a problem with the time it took to generate enough levels. In the end I found a good solution. The C# module starts by generating 10 levels before starting the game, after which it delegates the level creation to a worker thread which goes on to create 200 levels behind the scenes for the flash module to use later. I’ll have to see if this creates performance issues during the content creation, if so, I may have to lower the priority of the worker thread a lot and see if that helps.

Awesome stuff dude!
It is really cool that you are doing this in Actionscript.
I have also turned to the side of the Actionscript.
Procedural generation is where it is at!
Are you also using pseudo-random keys for your levels so you can reuse configurations you like?
Great Goodness to your Game Gallanting
Not As of yet, no, but it’s a good idea and it would be rather straight forward to implement. As the code is now, each level is made out of a series of segments. Each segment is a specific type of level terrain, such as hills, tunnels, moving platforms etc. Each segment is represented by a class which knows how to generate its type of terrain. Therefore, each segment could also be able to generate a key for it’s current configuration. The whole level key would then be all the segment keys melded into one.
Cool man, I have downloaded the Mr. Bubbles and the PCC code. I will be looking at it soon! I have got VS2k8 from MSDN but I need to get some DL-DVDs to write the ISO to. I am very busy this week setting things right before I take a week of vacation. Then it will be hard core crunch time on my own game code! (Along with a few reliable hours of fun as well of course!)
Thank you for sending me the links to your code! Your ideas are awesome!
I will get back to you soon.
-Daniel
I wish you tons of fun coding your own games! I’ve spent a lot of time on “Mr Bubbles” and it is slowly but surely getting closer to completion. It’s sometimes difficult to find time but I’ve tried to committ myself to implement at last one requirement a day, if I can. My next few games are definetly going to be smaller in scope though, just to get a quicker turn-over and an increased sense of accomplishment. I’ll follow up on “Mr Bubbles” as I’m currently working on the ActionScript side of the game and don’t yet feel confident enough to publish it. Soon hopefully :)