Stream Recap – Week ending 29th April 2019

Development has been progressing at a steady pace, the editor can now create a new project, save it, close it, open another. Tilesets (for the maps at least) can be imported with basic details (index, name, description) being editable. Further features are planned for the tileset manager but it’s good enough for now to progress.

The application structure has been changed from MDI to SDI with the various windows floating. I’ve done this simply to allow users to make use of multiple monitors (windows can be dragged to another monitor). At the moment, the application works but the layout is a bit hit and miss and whilst the editor saves the visibility status of the windows, it doesn’t save position, size or state, so a little bit of quality of life work is required on that.

Some new classes are probably going to make it into my public Delphi Library. These are likely to include classes providing a basic eventing fabric, a resizer, an INI file that is based entirely in memory, a fast string list and some other useful bits and pieces.

An eventing fabric you say… why not use Delphi’s eventing mechanisms?

Well, quite simply because in Delphi one event = one handler, there is no built in multicast support. Yes you can get into manually chaining them by recording the fact you weren’t the original handler, storing that and then calling it when your done, but that is fraught with problems, not least the fact someone in the chain can change the handler and your screwed. Or you can use one of the multicast event solutions already available, but these have the issue that you need to be able to access the object that will raise the event when subscribing to it. This may not always be possible and besides they all seem to do some fancy stuff with RTTI or require the definition of support types, which may make them difficult to use for new entrants to the Delphi arena.

I like to keep things simple, so my eventing fabric allows you to subscribe to or raise an event from anywhere using a text identifier for the event. You have to do the housekeeping yourself and be sure you remove the subscriptions when you cleanup an object, and you can only pass a pointer into the events, but it works and is a technique I’ve used in commercial applications that had high availability requirements (where it worked impeccably).

In terms of ORE, version 0.1.1 of the editor was committed with basic tileset import functions completed, along with an OpenGL tileset preview, so work is now moving onto the tiled world map editing system and all that entails 🙂

Quick screenie of the tileset manager at version 0.1.1