Apolyton Archive  |  Preserved copy of the Apolyton Civilization Site and its forums as they stood in September 2005. Read-only; nothing here can be posted to or replied to.  |  Forum index |  About this archive |  The 1998–2001 UBB forums
Today on Apolyton WARDELL INTERVIEW PROMO A.C.S. HISTORY CHAPTER 4 GET CIV4 /w FREE PLUS! A.C.S. PHOTO GALLERY GET A.O.M. V1.1
Apolyton Civilization Forums
main| civ2| civ3| civ4| smac| ctp2| ron| moo3| galciv| galciv2| alt| about|
ApolytonPLUS | register | search | faq | new posts | pm (-/-) | upload | members
hall of fame new! | civgroups | civgroups news | interviews | the column | radio | chat | directory | news | store | PLUS
Apolyton Civilization Forums : Powered by vBulletin version 2.0.3 Apolyton Civilization Forums > Other Games > Master of Orion I/II > The MOO2 LBX format explained...
Show a Printable Version | Email This Page to Someone! | Receive updates to this thread | Report this to Apolyton news!

bottom of page
  
Author
Thread    < Last Thread     Next Thread > Post New Thread     Post A Reply
Per is offline Per
Freeciv Developer

May 2002
time: 06:35
  Old Post 28-04-2004 03:17
Edit/Delete Message Reply w/Quote
#1 Report this post to a moderator
The MOO2 LBX format explained... Avatar Enlargement: We've got the solution

I've figured out almost everything concerning the LBX package, palette and image formats. I will give a brief summary of my findings so far in the hope that someone else can fill the holes.

The LBX archive format itself is really simple. It has a header:
2 bytes = number of files in archive
4 bytes = verification code (should always be 65197)
2 bytes = unknown (version? file type? i am not convinced by either)
then follows the offsets of all the files in the archive at 4 bytes each, pluss the offset of the end of the file, which should be identical to the file size.

The palette format seems quite simple, 4 bytes for each value of 256 colours as follows:
1 byte is always the value 1
1 byte for red, 1 for green, and 1 for blue
However, the values are 6bits, and to use them you need to multiply them by 4 to get meaningful values. Strange. There seems to be a lot of junk data after this - if it means anything I cannot make head and tails out of it.

The image format is complicated and not very bright. There is a header:
2 bytes = width
2 bytes = height
2 bytes = unknown (always zero, I think)
2 bytes = number of offsets
2 bytes = number of frames, always(?) one less than above
2 bytes = unknown
4 bytes = offset to beginning of image data
then follows a list of 4 byte offsets to each frame, relative to the beginning of the archived file (not the LBX file!), and the last one points to the end of the archived file.

If there now is space between our current position and the image data, there is palette override information here. This has the following format:
1 byte = index into palette; or zero if you should just increase your palette counter by one, to point to the next palette entry (yes, there is no good reason for doing it this way)
1 byte red, 1 byte green, 1 byte red; as above, multiply values by four.

Next follows the image data. Read each 'line' as follows: The first 2 bytes indicates data format. If it is zero _or_ if it is the first byte, in which case it is always one, read it like this:
2 bytes = increase y counter (start at zero) by this amount; if this number is 1000, immediately abort; this is an EOF marker, and beyond this may be junk data. Jump to next frame offset when you find an EOF.
2 bytes = number of pixels in pixel array
2 bytes = x position in image where you should start laying pixels
then follows 1 byte for each pixel.
If the first 2 bytes are more than zero, then this number is the number of 1-byte pixels following. I believe they should be added at the current (x,y) position, but they are special in some way I do not yet understand. I get some artifacts in some of the images that use this.

Some images need additional palettes to be shown properly. The ships, for instance, have palette override information in a 2x1 image that is in every 49th ships.lbx image. This image contains illegal junk data, and should not be processed. This probably also applies to other 2x1 or 1x1 images. If you use palette 12 in fonts.lbx with one of these override palettes, you get the correct palette for the given player.

I have written .c code to read this data and display it. If anyone is desperate to see it in its current unfinished state, just let me know.

Time for some sleep....

Per is offline Per
Freeciv Developer

May 2002
time: 06:35
  Old Post 29-04-2004 02:41
Edit/Delete Message Reply w/Quote
#2 Report this post to a moderator
Support Apolyton or Terrorists Win

Concerning the two ways that data is stored in the LBX, my interpretation of the data format is obviously correct, but I suspect it is not the whole story. Everything done the second way can be done better using the first way, so why did they create two ways to store the image data?

Most of the ship images do not contain any data of the second type. Attached are some examples of ships that contain both. In the second column is the ship drawn using only data of the first type, and the third column using only data of the second type. The first column contains both.

Would anyone try a guess?

Attachment: moo.png
This has been downloaded 104 time(s).

vmxa1 is offline vmxa1
Deity
Oviedo, Fl
Nov 2001
time: 21:35
  Old Post 29-04-2004 05:23
Edit/Delete Message Reply w/Quote
#3 Report this post to a moderator
Support Apolyton buy from Amazon

Is this yours:

http://www.xprt.net/~s8/prog/orion2/lbx/

Per is offline Per
Freeciv Developer

May 2002
time: 06:35
  Old Post 29-04-2004 13:44
Edit/Delete Message Reply w/Quote
#4 Report this post to a moderator
Support Apolyton, buy Civilization III: Complete

No, but I read this page, and it helped me along.

siron is offline siron
Warlord

Apr 2004
time: 06:35
  Old Post 30-04-2004 14:08 Visit siron's homepage!
Edit/Delete Message Reply w/Quote
#5 Report this post to a moderator
Remove this text

R u bio?

He published the LBXplorer (still beta) some years ago.

Dunno if u understand german?!

Bio wrote here ( http://www.crazy-board.net/vB/showp...637&postcount=5 ) that he will finish his work soon...

The new version can read and edit lbx-files of MOO, MOO2 and MOM.

Per is offline Per
Freeciv Developer

May 2002
time: 06:35
  Old Post 30-04-2004 22:10
Edit/Delete Message Reply w/Quote
#6 Report this post to a moderator
Increase the size of your Attachments

No, I am not bio. Nor do I understand much German, I'm afraid. If someone could inform bio that we're duplicating each others work, I would be grateful.

Is there a new version of lbxexplorer somewhere? The version I have has lots of palette problems and in general is not very helpful.

I have figured out the problems I had with image data of the second type. It appears the second byte for that data type is what you need to add to your x axis when you lay the pixels. It is a weird format, incredibly inefficient. Oh, well.

I'm almost done figuring out the animations and the palettes now, and I can view almost all the graphics as they are in the game.

siron is offline siron
Warlord

Apr 2004
time: 06:35
  Old Post 30-04-2004 22:48 Visit siron's homepage!
Edit/Delete Message Reply w/Quote
#7 Report this post to a moderator
Support Apolyton, pre-order Civilization IV

bio just wrote 1 post in that forum...

and he hasnt published his email...

but u can ask the forum-administration to send him ur mail: info@crazy-board.net

Morraine is offline Morraine
Settler
Readind
Jan 2004
time: 05:35
  Old Post 15-05-2004 22:08
Edit/Delete Message Reply w/Quote
#8 Report this post to a moderator
Support Apolyton, buy Galactic Civilizations

I have done programming before (Amiga and VIC20!!!) and I have an aptitude for it. Could someone explain to me how I should go about getting into hacking these LBX (and other) files. What programs do I need/ what programming language(s) do I need to learn.

I want to do this, as I have been monkeying around with the tech trees using OCL and am trying to create a very different game setting. The problem is, I can't edit the text that explains what the techs do. Therefore, if I want to play multiplayer, nobody but me will know what everything does.
I could write a document to go with it, but this seems to be a poor solution.

Or alternatively, if that file is easy to crack (being mianly just text) could someone make something like OCL to deal with this issue. Then the OCL editor will truly come into its own.

M

Zealot is offline Zealot
King
Lisboa, Portugal
Jun 2000
time: 05:35
  Old Post 19-05-2004 20:32
Edit/Delete Message Reply w/Quote
#9 Report this post to a moderator
Support Apolyton, buy Civilization III: Complete

quote:
Originally posted by Per
Most of the ship images do not contain any data of the second type. Attached are some examples of ships that contain both. In the second column is the ship drawn using only data of the first type, and the third column using only data of the second type. The first column contains both.

Would anyone try a guess?


They were planning on releasing a mod to the public for us to customize new ships?

mooncalf is offline mooncalf
Settler

Jun 2004
time: 05:35
  Old Post 17-06-2004 15:33
Edit/Delete Message Reply w/Quote
#10 Report this post to a moderator
Support Apolyton

Morraine said:

quote:
The problem is, I can't edit the text that explains what the techs do.


This should be easy, if I understand you. The "help.lbx" has text that is readable with a hex editor.

As a test, I altered what it said for the Achilles Targeting thingee, then saved it. Sure enough, the altered text popped up when right-clicking in tech review, and also when right-clicking on the ship system in the ship design screen.

The particular hex editor I used is here:

http://www.chmaas.handshake.de/delp...xvi32/xvi32.htm

BTW, the "defense" mod makes mention of a "help.lbx" that was supposed to come with it, but which seems to have been lost in the download sites.

pheroux is offline pheroux
Settler

Aug 2004
time: 01:35
  Old Post 21-08-2004 22:34
Edit/Delete Message Reply w/Quote
#11 Report this post to a moderator
Support Apolyton, buy GURPS/ Alpha Centauri

Hi Freeciv,

I would really be interested in taking a look at your code Freeciv! I have been looking for a way to replace the images in the game with some of my own.

Could someone suggest a way to do this?

Cheers!
-Phil

Zealot is offline Zealot
King
Lisboa, Portugal
Jun 2000
time: 05:35
  Old Post 22-08-2004 00:24
Edit/Delete Message Reply w/Quote
#12 Report this post to a moderator
Support Apolyton buy from Amazon

A mod for MoO 2 would sooooo cool...

Brutalisk is offline Brutalisk
Warlord

Apr 2003
time: 05:35
  Old Post 23-08-2004 03:28
Edit/Delete Message Reply w/Quote
#13 Report this post to a moderator
Increase the size of your Attachments

Zealot: there is already a mod , actually a couple of them. The mainstream one is developed and constantly enhanced by Lordbrazen. There are also a few other mods out there. Another one gaining momentum is a mod by 7.

  < Last Thread     Next Thread > Post New Thread     Post A Reply
All times are GMT. The time now is 05:35.
Apolyton Time is 00:35.
    top of page
Rate This Thread:
Forum Jump:
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is ON
vB code is ON
Smilies are ON
[IMG] code is ON
 




Contact Us - Apolyton Civilization Site - Support Us!

Building a better Apolyton through better information. Click here and take our poll!
Non-US visitors, click here!

Powered by: vBulletin Version 2.0.3
Copyright ©2000, 2001, Jelsoft Enterprises Limited.

Page generated in 0.0376 seconds (89.90% PHP - 10.10% MySQL) with 30 queries
Page Loading Time:

Support Apolyton: Amazon USA | Amazon UK | Amazon DE | Amazon FR |
Support Apolyton and get FREE PLUS, Buy from Chips&Bits: Galactic Civilizations | Galactic Civilizations: Deluxe Edition | Call to Power 2 | Civilization: The Boardgame | GURPS/ Alpha Centauri | Alpha Centauri | Civilization IV | Civilization III: Complete |


Front Page | Civilization IV | Civilization III | Civilization II | Call to Power II | Alpha Centauri | Master of Orion III
Rise of Nations | Galactic Civilizations | Galactic Civilizations II | Misc
Alt.Civs | Civ I | C:CtP I | About | News | Directory | Apolyton Store | Forums | Chat | Columns | Interviews | Newsletter
Scenario League | CSC | Clash of Civs | Spanish Site | CtP Maps | Cradle of Civ | WesW's Ctp1/2 Site | Civ3 Haven

apolyton.net | apolyton.com | civilization2.net | civilization3.net | civilization4.net | civilizationiv.info | calltopower.net | galciv.net | galciv2.net | moo3.net