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...

Thursday, May 27, 2010

Destroy him, my robots...

Although things have been quiet on the Blogging front, things have been continuing behind the scenes. The past few sessions have seen the enemy system revamped to allow enemies to be dropped into the game at the Player's current position. At the moment they only move left and stop; this being a state-based AI system, there's only so much I can teach the little guys to do right now.

The biggest challenge with the enemies revolves around Blitz Max's list system: in an entire list of enemy objects, it's actually nigh-on impossible to gracefully target one specific enemy for editing or deletion. After some careful coding, I managed to come up with a workaround, but I worry about the speed impact in the final game.

After two or three short evening sessions, I had multiple enemies doing their thing, enemy selection/highlighting implemented, and the ability to change some of the enemies' rudimentary data. I also tweaked the game to run within a window, allowing me to add a GUI editor (I had previously experimented with a text-based menu system, but why re-invent the wheel when Max GUI is sitting right there?).

The past couple of days have been spent putting together the basic framework for the editor; while this may seem premature, structuring the editor will also help me to a) work out the data structure for the enemies, and b) work out precisely the kind of functionality I want the enemies to have.

Rather than code by hand, trial, and error, and not enamoured with the thought of cutting and pasting in PhotoShop, I loaded up a great little utility called Logic GUI, and created the basic shell of the editor, fleshing out ideas as I went along. Despite a few quirks, it was a simple process, and already I have a much better idea of how the editor will look and the enemies will behave.

Having exhausted all of my ideas, I turned to a couple of previous projects (Creatures and Mayhem on the C64, and Last Ninja: The Return on the PC) to see how they handled their enemies. In the case of Last Ninja, I worked on the project for several months and became very intimate with its superb in-game editor (a testament to John Twiddy, who's approach to such tools very much shaped the way I've handled other projects).

Armed with a host of new ideas, now it's time to start building the editor...

Sunday, March 28, 2010

A Little Bit of History Repeating...

A random resurrection of The Blog can mean only one thing: I've at last found time to pick up the reins on my two pet projects again, Citadel and FishEd Max.

I have a good excuse, however: the last few months have been spent moving to the East Coast of Canada and settling into a new job, so I might be forgiven for not giving any endeavour my fullest attention.

Right now, I'm still torn between Citadel and FishEd; the latter holds more appeal, I must confess, but there's a lot of work to do and I'm wondering if the effort is worth it (the original FishEd, despite being modestly-priced at just five English Pounds, only sold about 30 copies - great beer money but a lousy return for 2+ years' work).

Similarly, however, Citadel is a retro remake that will undoubtedly make all of the impact of a grain of sand dropping into the centre of a tsunami.

What to do?

I think the best course of action right now - in order to at least keep moving ahead and making progress - is to force myself to make time for my coding each and every day, and to work on whatever takes my fancy, be it Citadel or FishEd. After all, the grass is always greener, so switching to a different project when I get bored with the other might be just the motivation I need...