After a very long hiatus in my programming activities, due in no small part to a huge amount of upheaval in my personal life, today saw me delving back into the world of Blitz programming after being away from the keyboard for almost a year.
I'd promised myself that, after writing FishEd, I'd concentrate on writing the remake of Citadel which started this whole thing in the first place; however, I'd always relished the challenge of rewriting FishEd in Blitz Max, which would allow me to add all manner of new features to the program.
After FishEd's release, I received a few enquiries regarding the program and possible commercial opportunities, and after discussing enhancements and Wish Lists with other developers and artists, returning to the project seemed like an interesting challenge.
The biggest hurdle ahead is undoubtedly getting to grips with Blitz Max after being so comfortably nestled in the bosom of Blitz Plus; though the two programs have deep, inherent similarities, there are also a lot of areas in which the two programs are poles apart. Many of the techniques I'd used in FishEd are not possible in Blitz Max, and it's likely that huge areas of the editor will need to be rewritten.
I'd actually spent a couple of days at the beginning of the year converting some of the basic FishEd code across, allowing me to display the basic window, as well as loading in a test map. However, this testbed left a lot to be desired, and the Events system - used for trapping keyboard input, mouse input, and any kind of user/gadget interaction - was virtually non-existent.
Today's session began with me converting my files across to Blitz Max, cutting and pasting across from Blitz Plus and changing obvious syntax differences; the relative sluggishness of the Blitz Max IDE is forcing me to think about how I might organise the files a little better (my main source file is 15,000 lines long - way too cumbersome, in retrospect).
After doing a few test compiles, it became obvious that a change of tactics was needed; it'd be virtually impossible to compile the code, fix the errors, compile, fix, compile, and so forth. Therefore, I returned to my earlier testbed code (which is considerably smaller and easier to manage), and set about methodically creating a framework into which I can paste chunks of code from FishEd and bash through the workload in logical chunks.
In actual fact, this turned out to be a very nice way of working; I recall that early in FishEd's development, I hit a stumbling block with the way that the program processed Windows events and user input, and this I stripped the program down to a basic shell, rewrote the underlying interface, and then added everything else back in.
The first hurdle was to get keyboard input working properly; this has always seemed unnecessarily finicky in Blitz Max, but thankfully I managed to pilfer some example code from the Blitz Forum which did the job beautifully (sometimes it's not the code you need to plagiarise, but the technique).
With this crucial part of the framework in place, I then set about bringing the Tiles panel to life, and finished up by adding an Event Hook that ensures the canvases are always redrawn if, for instance, the window is dragged off-screen or a menu drops down over the canvas areas. In short, an extremely productive session which has given me buckets of enthusiasm for the project ahead.
