Saturday, June 12, 2010

One Pixel at a Time...

The past few sessions have seen the editor come on in leaps and bounds. After finalising the remaining functionality in my MS Word template, I spent an entire afternoon getting the Logic Panel finished (this is a rather clever system which allows up to three flag states to be analysed in order to set another flag; for example, it allows you to very simply trigger an event when three other events have been triggered). Of course, I fully expect the Editor to outgrow this rather simple framework, but I probably won't know until it happens.

After getting the Logic Panel finalised (agonising work, shifting GUI elements one pixel at a time), I rounded off the session by adding a simple trigger box entity to the game. Although the box can't be edited or moved just yet, it was a useful exercise in setting up new objects within the game code.

The next session saw me tying in some of the editor functionality to the game; I wasn't in the mood to finish off the other tabs just yet, and so I set about adding a thumbnail to the Enemy Panel which shows the enemy you're currently editing. I also added a couple of extra attributes, including the ability to set the enemy's colour. I rounded off the session by making a few tweaks to the game, including fixing some bullet/collision issues, making the main craft animate properly, and adding a nice semi-transparent shadow. Just these few simple changes already give the game much more life.

The final session of the week saw the addition of a map editing system; I'd been having a few issues with my cursor display, mainly because the code was imported from FishEd which used a coarse scroller rather than a smooth one, and thus, a tile could be anywhere on screen and not just in discreet/convenient block locations. After a little head-scratching, the code was up and running, and I also added a small debug panel to the editor to allow the user to choose a tile. It's actually pretty cool to be able to pootle around the map, then quickly use the editor to remove a section of wall that might be in your way. :)

Sunday, June 6, 2010

Aliens... Thousands of 'em...

After the previous session, I spent a good 2 or 3 days going through other editors (such as Last Ninja: The Return) to get an idea of how my aliens could function. Once of my biggest concerns was, how do enemies communicate, send out signals to other entities and similarly, receive data according to other events?

I put a post on the Blitz forum, and my good friend Muttley responded, pointing me in the direction of his game framework. However, after looking further at the Last Ninja code, a very simple solution was staring me in the face: simply use a shedload of flags.

The Last Ninja's event system basically utilised a block of memory, full of flags; certain events set specified flags, and likewise, certain events checked certain flags. Although not as tidy as an OO-based approach, it does offer a speedy solution to the problem (after all, you're not parsing every event against every object - you're only ever checking the flags you need to). Enthused by this breakthrough, I set about planning out the editor in Microsoft Word, which will hopefully save oodles of time in the long run.

Today's session saw the addition of the main Enemies Tab in the editor; I'd managed to find a way to have a Max GUI run simultaneously alongside the game, so now I needed to start populating the empty tabs with buttons, labels, radio buttons, and combo boxes.

The main problem with work like this is its intrinsic fiddlyness; it took hours - and I do mean hours - of tweaking and typing to finally get a structure established, and with the help of PhotoShop, I carefully added each element to the editor, making executive changes when things didn't quite translate from my mockup.

After making great progress, I rounded off the session by adding the functionality to switch between the various tabs. With the bulk of the work done, just one more session of editor building and I should be ready to add the functionality which ties the editor into the actual data...