Recently I had some time to work on my several ongoing projects. Unfortunatelly I have failed my exams, but I did it by my own will, so I don’t have any regrets because of it. I guess I’m still not ready to devote all my time towards studying something that’s not my primary interest right now. I like physics, but I hate theoretical basics and learning theory just for learning it. I must have practical applications of things I am learning or I’m getting bored quickly. But because of this fact I had more time to work on my projects. There are two business projects that I’m currently continuing. One of them is my CMS which is getting pretty advanced, because the deadline set by the client is coming fast. It’s been in development for almost a year now. I’m finally getting towards finishing framework. For the last two weeks I’ve been working on marker component of the plugin system. The only two things left in it is layout and article analysis for finding markers and then running function associated with each marker. That will be the end of Plugin Manager system. Then I’ll have to rewrite some static layout functions to dynamic plugins using the plugin system and perhaps write a Composing Manager, but it’s not a priority. With Plugin Manager finished I will be able to fix currently broken permission system. This will complete the functional framework upon which I’ll build a workable administration system plugin. This part would require writing functions associated with saving in the Storage Manager (virtual filesystem). I’m very happy because most of the hard work is already behind me and CMS is nearing it’s completion with basic facilities that will be able to handle critical operations. From then on I’d improve functionality by simply writing new plugins.
In the meantime I was approached by a client to create a simple website for him. He was not willing to pay much, so I’ve decided not to go my usual route to approach my friend who is the graphic artist and webdesigner, and ask him to create a layout for me. I decided to do it myself. In the past I did few sites, but I’m not really an artist so my productions are somewhat unprofessional, but they’re not very bad either. It was also good time to learn Inkscape and fully vectorised layout as opposed to earlier raster-edited ones. I have to admit that for the first play with Inkscape the website is not bad. Creating graphics was one thing, but creating XHTML and CSS code for this layout is NOT such an obvious thing. Many thanks to my friend who helped me a bit. I’m still learning CSS, so I’m not very familiar with this technology. Of course the CSS Zen Garden is quite helpful when it goes to understanding advanced styles. Besides that I have to write a PHP script that will allow to place orders. It’s quite simple and doesn’t involve any kind of shopping solution or paying via internet. This project is a little distracting, but I’m in great need for cash, so every coin counts.
You could think that I had a bit of work lately, but honestly said it wasn’t too much. 🙂 Because I’m not attending to University anymore, I have found the time to spend it doing some other things, playing and coding MOO2 Graphics Viewer. And this is the primary reason for this post. I have abandoned working on the GUI for now and went towards writing some functionality functions. Hang on your chairs ladies and gents. The Graphic class currently allows TO SAVE images! That’s right! You read it correctly. I’m currently able to save images achieving almost 100% compatibility with original graphics from Master Of Orion 2. 😀 The only thing that is left is saving internal palette within the image, which is very simple thing to do and this will be the end of fully functional graphic class. However writing this functionality wasn’t simple reverse process from loading functions. To achieve compatibility with original graphic files I had to do some additional reverse engineering on the format, because of the way frames within the image are saved. It’s linked with format reading specific that is used within Master Of Orion 2. I had to write additional python scripts to do some calculations on the offsets to see what’s going on, because this format reading specific wasn’t at all obvious to me at first. I had almost working saving function yesterday, but due to my stupid error I was stuck for a day searching for the problem. It turned out to be really simple thing that I ommited by accident. But now it works for 100%. Stay on your toes because graphically modding Master Of Orion 2 is really close right now. I don’t have any screenshots for you today, because it’s only saving functionality that doesn’t have any editing capabilities. To have a fully functional editor is not my goal.
I’ve been browsing graphic files and checking them for any anomalies and this is what I have found so far. Some of the files doesn’t use any external palettes stored within fonts.lbx and ifonts.lbx archives. However these files contain mouse cursors, besides the palette, and at least one of the files contains fonts. As for the graphic files. I have indicated earlier the council.lbx archive has internal palette of the first file that is used by most of the graphics from this archive. But that’s not all. I was able to see that most of the files doesn’t really use external palettes. For example. Planets.lbx that has planet graphics on colony screen they all have internal palettes, but not 256 colors! It’s quite obvious those palettes are merged with others. Also some external palettes have purposely left some of the colors out, i.e. they have many occurences of the same color. I’m assuming these are the “places” where merged palette goes in. It’s quite intelligent in fact, because for example ships.lbx has few graphics that are 1x1pixel size and doesn’t represent anything. But they’re interesting from the palette perspective. Those files are simply palette holders that are used to recolor the ships!
And this is one of the main purposes I’m not releasing the code now. I was working on implementing simple XML format to catalogue those dependencies that would be portable to other applications that I hope will begin to popup after releasing MOO2 Graphics Viewer code to the public. And I’ll encourage everybody to use it. The next thing I want to code in the viewer would be the Converter class. It will allow converting BMP or GIF files to native MOO2 graphics format. However the converter class would be quite hard to use alone, without knowing which palette is used for what image and that’s why I’m again delaying publishing the code to the public, before I have fully working and usable package that in fact could be used by non-programmers. Also there’s obvious need for palette export/import into a format readable by graphic programs. I’m not aiming at creating fully functional editor mind you. Main purpose of the program is still viewing Master Of Orion 2 graphics, but I want to include packing/depacking LBX archives (already done), saving/loading graphics (done) and finally importing/exporting images to/from BMP or GIF files (to be done). Before that I’m not really ready to publish it. I’ll try to get it done as fast as possible, but I’m not making any promises.
I love your work and have been working along the same lines as you in C# on windows. I have the graphics unpacked perfectly but cannot view any of the palette’s from inisde the images or the LBX files? can you post or share some of the information on reading the fonts.lbx and ifonts.lbx files? i dont know python to well so i havent been able to decipher how you did it.