Are you, in fact, a pregnant lady who lives in the apartment next door to Superdeath's parents? - Commodore

Create an account  

 
Some info on MOO1 LBX container format

Hi everyone,
it's been ages since I've been on these channels, but I am now looking to some old links that explain in detail the LBX format.

This is for (my own) educational purposes, I'd like to wirte something that dabbles with the format itself for MOO1.

Fact is, i've spent all my Google-fu in the last two days but seems there's a ton of info about the LBX format....but is long lost in dead links.

Can anybody point me to a reliable and relatively recent source of info on this format, maybe particularly for MOO1?

Many many thanks, ANY help is appreciated.

- Pkrcel
Reply

Hi!
Things have been quiet around here for a while now. If you haven't already have a look at the "Unofficial Patch" thread under Important Threads. There is a ton of information in there and is probably a good place to start. Also please keep us advised on what you discover. I for one would love to know more about the inner workings of the game files.
Cheers!
Reply

(December 10th, 2014, 14:09)Ianus Wrote: Hi!
Things have been quiet around here for a while now. If you haven't already have a look at the "Unofficial Patch" thread under Important Threads. There is a ton of information in there and is probably a good place to start. Also please keep us advised on what you discover. I for one would love to know more about the inner workings of the game files.
Cheers!

Ah thanks you, I was reading through the Unofficial patch thread but it's quite huge and haven't found (yet?) pointers to the right direction.

Anyway some more persistence in i searching had me find something, I'll try to make something up from there, and eventually report here.
Reply

I managed to crack the graphics LBX file format and created an utility that allows you to extract images out of the LBX files. One thing I discovered was that some LBX files handles animation differently. Some gets drawn on previous frame (apparently some parts of game don't clear screen each time it draw things, depending on the old frame being there for the new frame to work corretly), while others expect the screen to be cleared before being drawn.

You can download the utility here, and see how the LBX file format works. http://realmsbeyond.net/forums/showthrea...#pid183954. You can also look at my older posts from that thread and see how I cracked it, and other comments on LBX files.

Hope this helps! I did try and create ability for the utility to update LBX files with new graphics, but so far it's been unsuccessful, it crashes the game frown
Dominus Galaxia, a Master of Orion inspired game I'm working on.
Reply

Thanks Zeeran!

Of course I downloaded your utility and looked briefly into the code sometime ago.

Comes out that LBX files are well documented for images (due to your and others reverse engineering effort mostly), but the other containers (type 5 in specific) lack a bit of knowledge spread around.

Now I'll look into adding to my handler a decoder for bitmaps.


Thanks a lot for your answer and efforts.

Cheers
-pkrcel
Reply

(January 8th, 2015, 14:05)pkrcel Wrote: Thanks Zeeran!

Of course I downloaded your utility and looked briefly into the code sometime ago.

Comes out that LBX files are well documented for images (due to your and others reverse engineering effort mostly), but the other containers (type 5 in specific) lack a bit of knowledge spread around.

Now I'll look into adding to my handler a decoder for bitmaps.


Thanks a lot for your answer and efforts.

Cheers
-pkrcel

You mean like Research.LBX file? I think those are mostly text. I added a text preview to my utility, and a "LBX Version" indicator that tells you which kind of LBX file it is. Research.LBX's last two files are text separated by 00's which is replaced with "-". But the first file, I have no idea. Maybe data on different technologies? I.e. damage, etc. EVENTMSG.LBX contains text for different events, and is type 5 as well. FIRING.LBX may contain data for how to render beams (torpedoes and special equipment's graphics are stored in graphic files, so that only leaves beams). From what I understand: 0 is graphics, 1 is sound, 2 is FONT, 3 is HELP, 5 is data files. I don't see any with "4".

Good luck on cracking the rest of LBX files!
Dominus Galaxia, a Master of Orion inspired game I'm working on.
Reply

(January 8th, 2015, 13:55)Zeraan Wrote: I managed to crack the graphics LBX file format and created an utility that allows you to extract images out of the LBX files. One thing I discovered was that some LBX files handles animation differently. Some gets drawn on previous frame (apparently some parts of game don't clear screen each time it draw things, depending on the old frame being there for the new frame to work corretly), while others expect the screen to be cleared before being drawn.

You can download the utility here, and see how the LBX file format works. http://realmsbeyond.net/forums/showthrea...#pid183954. You can also look at my older posts from that thread and see how I cracked it, and other comments on LBX files.

Hope this helps! I did try and create ability for the utility to update LBX files with new graphics, but so far it's been unsuccessful, it crashes the game frown

Hi Zeraan!
I downloaded your LBX utility some time ago and used it to create a bunch of .gif images (like my avatar). It works great! One issue I had was in trying to extract the ship sprites from ship.lbx and ship2.lbx. Since there are multiple sprites for each size of ship the utility names all animation frames for each ship the same and overwrites them successively, so I am left with only one of each ship size for each color. I looked at the source code for your utility but I couldn't parse out a way to change the way it names the sprites (an issue with the way MoO names them I would guess). Do you know of any way to overcome this problem? I realize that you did this work several years ago but any help would be appreciated.
Thanks!
Reply

(January 8th, 2015, 22:36)Ianus Wrote: Hi Zeraan!
I downloaded your LBX utility some time ago and used it to create a bunch of .gif images (like my avatar). It works great! One issue I had was in trying to extract the ship sprites from ship.lbx and ship2.lbx. Since there are multiple sprites for each size of ship the utility names all animation frames for each ship the same and overwrites them successively, so I am left with only one of each ship size for each color. I looked at the source code for your utility but I couldn't parse out a way to change the way it names the sprites (an issue with the way MoO names them I would guess). Do you know of any way to overcome this problem? I realize that you did this work several years ago but any help would be appreciated.
Thanks!

That's cool you created your avatar with help of my utility! It was useful for something!

For the ships, I wasn't aware of this issue frown The LBX files containing those ships have the same names, so it overwrites frown To fix this, go to line 451, just below the
Code:
                        FileInfo fi = new FileInfo(lbxFilePathTextBox.Text);
                            baseWriter.WriteLine("LBXName:" + fi.Name);
                            baseWriter.WriteLine("NumOfFiles:" + files.Length);
                            foreach (FileClass file in files)
                            {

Add this:
Code:
                                string fileName = file.fileName;
                                int iter = 0;
                                do
                                {
                                    fileName = file.fileName + iter;
                                    iter++;
                                } while (File.Exists(Path.Combine(folderBrowser.SelectedPath, fileName + "_0.BMP")));

Replace the following line "baseWriter.WriteLine("FileName:" + file.fileName + " Comment:" + file.comment);" with "baseWriter.WriteLine("FileName:" + fileName + " Comment:" + file.comment);" and further down, "bitmaps[i].Save(Path.Combine(folderBrowser.SelectedPath, file.fileName + i + ".BMP"));" with "bitmaps[i].Save(Path.Combine(folderBrowser.SelectedPath, fileName + "_" + i + ".BMP"));"

I tested, and confirmed that it resolved the bug.
Dominus Galaxia, a Master of Orion inspired game I'm working on.
Reply

(January 8th, 2015, 23:56)Zeraan Wrote: I tested, and confirmed that it resolved the bug.

Awesome thank you! Now of only I could figure out why some of the images have wonky colors everything would be peachy.
Reply

Guys, small question:
Is the current state of handling the LBX files good enough to let us mod the MoO graphics a bit?
Reply



Forum Jump: