Sunday, September 26, 2004

Sunday 26th

Started doing some tidying up today, mainly because I know I've been somewhat sloppy and slapdash in some respects. The first job was to bring the toolbar up to date; first I added proper Tooltips for each item, then I tied in each button to it's particular function (and inserted "blank" code where this is yet to be done). I also jotted a few notes regarding other tools I could add to the Toolbar - this is all dependant on space, however, and as I'm rapidly running out of room for extra buttons, any obscure features will have to make do with just a menu entry.

Speaking of menus, I also started jotting down a few notes on the Menu structure, what menus I'll need, which functions will be included, and precisely what will go where. There are a few unofficial conventions when it comes to menu layout, and most of the map editors I've looked at seem to conform to these (which makes it easier to find what you need). I'll probably leave the actual implementation towards the end, however, as I can envisage me spending a lot of time moving things around unnecessarily as features are finished and tweaked.

Next I set about finishing and tidying up the routine to choose the current Layer by using the Tabber rather than pressing a key (though both will be possible), as well as the checkbox functionality. Thanks to a combination of tired eyes and temporary code from the last session, an intermittent crash bug crept in, as did a strange quirk associated with the checkboxes. I must be thinking more methodically, as these bugs only took a couple of minutes to track down and fix. Ok, so maybe a little luck helped, too. I'm not complaining :)

* * *

I've decided that the Editor will support one Map (or Project) at a time, each Map consisting of six different Layers corresponding to FX, Foreground, Foreground Collision, Background, Background Collision, and a Static backdrop. Thus, each level from the game will have its own associated Map/Project file.

Tilesets are created and then "linked" to a Map/Layer by specifying the tileset path in the Map properties; this allows multiple Map/Projects to share tilesets, if necessary, and also has the advantage that tilesets can be tweaked externally without having to re-export the data (this wouldn't be possible if the tileset data was embedded.

Within the Editor, Map/Project files can be loaded and saved, individual Layers saved/loaded/exported, and Brushes saved/loaded at will. This gives the user maximum flexibility to shunt Maps, Layers, and Brushes around as required. Of course, I have yet to write these routines, but you get the idea :)

There are a couple of reasons for this single Map/Project approach, the primary one being time; I could waste months putting together an editor which (I hope) would be completely flexible for any type of project - but therein lies the problem, that of providing support, maintenance, and updates, something which I simply don't have time for.

With this in mind, the Editor will be crafted to suit Citadel's requirements, but remain flexible enough for me to adapt it to other projects in the future. Another reason for keeping the Editor under wraps is, to put it bluntly, the sheer number of awkward quirks and bugs that are present, through no fault of my own (Blitz only permits a certain amount of interaction with Windows - and I don't have time to write DLLs to combat this often limited functionality).

Just before winding down, I took the liberty of expanding the Editor's window size; I want the editor to be able to support tiles which are 32, 64, or 128 pixels square (after all, I've yet to decide on the optimum tile size for Citadel), so the Editor window was tweaked so that tiles of these sizes fit comfortably within the window. And of course, since all my variables are self-calculating, everything works perfectly after changing just a single value.