After a quite long period of development without any message I finally have finished the most important features of Architect that were planned for beta 7 release. Here I will give you a short description of each one of them.
Maybe not the most important…
…but I have converted Builder and Designer to Borland Developer Studio 2006 (Turbo Delphi) environment (they were previously developed in Delphi 7). The good side of the conversion is that BDS2006 has much better debugger, editor, and (almost) everything than version 7, but on the other hand, it can’t install third-party components (freeware personal version), and I use some of these. Fortunately, the only limitation is that the components can’t be installed into the IDE, thus managed vsually, however they can be used by manually calling in the code. I had to put them into the code giving them previous positions and properties. In addition I have modified the SpinEdit component (wrote my own frame-based version actually), so that it is easier to use and have more features: built-in large change buttons and automatic colour change when the entered value is incorrect. And another good thing is that the code is now ‘integral’, i.e. it doesn’t require any external components to be installed into the IDE thus making the code more accessible by others and easier to manage for me.
Now for the features
As I wrote about in the previous post, I was working on a feature that helps creating Fragments or Disappearing Ceiling Grids, as they are also called. I don’t want to repeat what I wrote there, so I will give only a brief reminder: the whole thing is about making the program(s) to automatically manage necessary Fragments based on how they are used in particular Scenarios. Users can reference the Fragments by their names, so they don’t have to bother about numbers, indexes, and planning all these things right at the beginning of their projects. Let’s get down to business.
The above screenshot shows the Fragments usage in Builder – in the object editor for Zones of type 3 there is a field called ‘Auto-Fragment’, which contains one of the Fragments from the current Scenario (or nothing). If it contains an existing Fragment name, information about this will be inserted into the Scenario for further use. Below, in the Script Editor, there are also some Fragment names used as parameters to the SET_GRM command (this command ‘turns on’ the Fragment display). The command still needs a numerical parameter, because the real Fragment index is not known at the time of Script compilation, so something needs to be inserted at that place in the code. In this case the information about referenced Fragment is also included in the Scenario.
By the way, if you’re curios about the program’s window borders (not the ‘classic theme’) – I recently decided to try the new Windows 7 Aero interface, and I wanted to try how it interacts with the program. The result was very good (it didn’t crash ), so it seems that Architect is compatible with Windows 7 (64-bit edition). The other screenshots have the regular window borders because they have been taken on another machine, where I have Windows XP.
After editing is finished we can use the Scenario in Designer.
Designer also have been slightly modified. The main change is separate list of files that will be used as Fragments. In LBA Fragments are kept in the same file as Grids (lba_gri.hqr), they just start at specific index (121), so if one wanted to make a single Grid that uses a Fragment (not using the Auto-Fragment feature) he had to put 119 blank entries between the Grids and the first Fragment to make it work. This wasn’t very convenient, so I decided to make the separate list and the program will manage that automatically. Another change is some column rearrangement – the file columns are small and description column has been added to the right. The files columns now have less space for displaying the paths, but if two or more adjacent columns contain the same path they will be connected to make more space and only one path will appear. This may be a little confusing (especially for Fragment list where map index will be displayed in the Bricks column), but I think it will become more more convenient than the old way, after some trials. If one needs to see the full path, manual editing is now available. The description column serves two purposes: it keeps information what room each row contains for easier orientation, and it is used for automatic HQD files creation (yes, I made that one too ).
In order to automatically create necessary Fragments for the Grid, just add the Scenario in the Grid list and that’s it. If the Grid inside the Scenario has by-name references and the Scene path points to the same Scenario file (that’s important), all necessary Fragments for the Grid will be extracted and added at the correct indexes (after manually created Fragments), and these indexes will be put into the Scene file at correct places. Actually the Fragments list doesn’t have to be used at all. It can be hidden.
The next screenshot presents project options’ first page, that contains the Auto-Fragment setting with detailed explanation.
There is also an option to manually set the first Fragment index in the lba_gri.hqr file, though it’s probably hard-coded in the game engine. I have made it because maybe it will be possible to change that index by hex-editing the lba.exe file in the future. And of course it will be useful if our custom engine is finished one day. I have made tests and discovered a great thing. Until now we have thought that the maximum number of Lba Maps (Grids + Fragments) was 256 (because the Grid indexes are kept in one byte in the compiled scripts). I have found out that the actual number is number of Grids that fit in below Fragments plus 256 Fragments (because Fragments are actually called by offsets starting with 0, so we get another 256 possible values). I have tested it in the game, so it’s not only my guess. If we can change the first Fragment index one day, the number will rise to 256 (or 255) Grids + 256 Fragments.
The last screenshot shows the result in the game. It’s not anything spectacular, actually I could have made that without using any of the features, I described here , so it can’t be a proof. The screenshot simply shows Twinsen passing through one of the Zones that are set up to show a Fragment on such event, and the flower piece is the Fragment, so apparently it works .
When I started writing this post I thought about sharing my test files and projects with you, so you could test that for yourselves, but then I realized that the Architect was not released yet, so you wouldn’t even be able to open the files. Thus, you will have to wait till the beta 7 is finally released, which will be soon, I hope.
The planned issues that I plan to address before the release are listed on the roadmap page in the bugtracker: http://sacredcarrot.xesf.net/mantis/roadmap_page.php (you have to select Little Big Architect from the combo box on the right, I can’t link to specific project pages).
By the way, I wonder if the Architect components couldn’t have better names. Factory seems good enough, but Designer may be somewhat misleading, as it is meant for design HQR files, not scenes or areas. Maybe the Builder and Designer names should be flipped over, or completely renamed. What do you think?