Reply
 
Thread Tools
Old June 10, 2003, 19:26   #1
wervdon
InterSite Democracy Game: Apolyton TeamC3C IDG: Apolyton Team
Prince
 
Local Time: 21:24
Local Date: November 1, 2010
Join Date: Nov 2001
Posts: 812
Hacking/Modding Moo1/Moo2
I've been wanting to be able to mod these games for a while, but hit a road block with the .lbx file format that all the data is enclosed in.

Well today I ran across a website where someone who did some hex editing was nice enough to layout his findings on the file format:
http://www.xprt.net/~s8/prog/orion2/lbx/

Being a programmer myself, I decided to write a quick tool capable of extracting files from .lbx archives and rebuilding an archive from those files as a first step to being able to mod both games (I believe they use a common file format, but ive only tried this on techname.lbx so far).

The tool works like outlined below (its command line driven, ie dos prompt). I'll use the convention of typing in CAPS what you type and lower case for program output:
Dos prompt:
LBXTOOL
Build .lbx from a directory or extract an lbx to a directory? (B/E) EXTRACT (e would be enough)
Enter Filename of the lbx archive: TECHNAME.LBX
Number of files to extract: 6
Offset: File #0 = 2048
Offset: File #1 = 10653
Offset: File #2 = 19918
Offset: File #3 = 30365
Offset: File #4 = 40364
Offset: File #5 = 49846
Offset: File #6 = 58451
Exiting Tool.

The results would be that the 6 files which were archived in technames.lbx would be outputted to File1.txt through File6.txt (they may not be text files, but .txt makes it easy to edit and see...unfortunately file names are not part of the archive)

In reverse:
LBXTOOL
Build .lbx from a directory or extract an lbx to a directory? (B/E) B
Enter LBX archive name to build: TEST.LBX
# of files to include: 6 (I entered the 6)
Size of file #1 = 8605
Size of file #2 = 9265
Size of file #3 = 10447
Size of file #4 = 9999
Size of file #5 = 9482
Size of file #6 = 8605
Archiving: file1.txt (8605 bytes)
Archiving: file2.txt (9265 bytes)
Archiving: file3.txt (10447 bytes)
Archiving: file4.txt (9999 bytes)
Archiving: file5.txt (9482 bytes)
Archiving: file6.txt (8605 bytes)
Exiting Tool.

The files have to be named file1.txt through file6.txt, they are all put in test.lbx (or whatever you asked to call it).

I've only tried this on technames.lbx. So far I've successfully extracted the 6 files in the archive (they seem to be all the tech names in the game, 1 file per language). Then rebuilt the archive as test.lbx which I copied over my original techname.lbx in the moo2 folder and successfully run the game. I have not tried to make any actual modifications yet

I'm including the source code with the lbx extractor/builder in case I made a mistake someone else can fix. I'm hoping there's enough other moo1/moo2 fans around here who have also wanted to mod the game to help find out which data files in which lbx archives control different things like research speed, etc. (I say that cause i'm hoping for a slowdown tech mod for moo2 ;P)



Note, One assumption I made which may not always be valid is the first file in the archive should always begin at position 2048 in the .lbx archive. I did this mostly because it was the case with techname.lbx and seemed reasonable enough.

Edit: Ooops, Initial version was opening the files in ascii instead of binary mode, Didn't notice my mistake till I tried to extract a large lbx file. No one had downloaded it yet though so no worries.
Attached Files:
File Type: zip lbxtool.zip (53.9 KB, 154 views)

Last edited by wervdon; June 10, 2003 at 19:44.
wervdon is offline   Reply With Quote
Old June 10, 2003, 19:58   #2
vmxa1
PtWDG Gathering StormC4DG Gathering Storm
Deity
 
vmxa1's Avatar
 
Local Time: 23:24
Local Date: November 1, 2010
Join Date: Nov 2001
Location: Oviedo, Fl
Posts: 14,103
I love your ambition, good luck.
vmxa1 is offline   Reply With Quote
Old June 10, 2003, 20:05   #3
wervdon
InterSite Democracy Game: Apolyton TeamC3C IDG: Apolyton Team
Prince
 
Local Time: 21:24
Local Date: November 1, 2010
Join Date: Nov 2001
Posts: 812
Well its not working for a few of the larger archives Game.lbx in particular. I'm not sure if its the tool or the lbx format is different. For some reason the offsets the program outputs seem wrong, they aren't in ascending order (ie it sounds file #5 is before file #4 and such).

I don't know if its something we don't know about the lbx format, or perhaps the files don't have to be strictly in order (which wouldnt make a lot of sense really).

At least it can extract & rebuild some of the lbx files, though none of the obvious ones (tech*.lbx) seem to have anything that would effect research costs.

[EDIT]:

Oh well, I don't have time to pursue this anymore for now. Maybe someone can pickup where I left off and take this further. At the moment about all I think I can mod is the names of techs

Last edited by wervdon; June 10, 2003 at 20:16.
wervdon is offline   Reply With Quote
Old June 11, 2003, 15:46   #4
Kaptain Ken
Warlord
 
Kaptain Ken's Avatar
 
Local Time: 03:24
Local Date: November 2, 2010
Join Date: Feb 2003
Location: Las Vegas, NV
Posts: 156
Hopefully you will find the time to try some more, I am very interested, but not a programmer. Let us know if you have any luck.
Kaptain Ken is offline   Reply With Quote
Old June 11, 2003, 18:39   #5
TheReaper
Settler
 
Local Time: 03:24
Local Date: November 2, 2010
Join Date: Jun 2003
Posts: 3
When I read your post I started to tinker around with the files myself.
I wrote a small program that essentially does exactly what yours does but I still decided to start from scratch with the info from the page you gave as reference.
I have no trouble extracting the files from even the larger archives (or so I think, the offsets seem to be right at least).
However the extracted files seem to be somewhat useless, there is no form of structure that I could make out (granted, I didn't take a too close look yet since its rather late).
When opened in Notepad all you get to see is unreadable ASCII Garbage.
Extracting the technames.lbx works flawlessly though, so I assume that what I see after extracting the game.lbx is actually what is in it.
My first guess would be that the files stored inside the lbx in some cases still need to be compressed or compiled to work with MoO, which would make them nearly uneditable in their current form.
I might be wrong though, after all this was a pretty quick and dirty job, so maybe its all just my fault
I'll finish the program anyway (it isn't yet capable of merging txt files back into lbx since I wanted to see if I could get it to work with the larger files first).
If anyone is interested in its source I'll release that as well after I cleaned it up a little.

Last edited by TheReaper; June 11, 2003 at 18:44.
TheReaper is offline   Reply With Quote
Old June 11, 2003, 19:38   #6
wervdon
InterSite Democracy Game: Apolyton TeamC3C IDG: Apolyton Team
Prince
 
Local Time: 21:24
Local Date: November 1, 2010
Join Date: Nov 2001
Posts: 812
Maybe I missed up then, I'll look into it later. I'll probally be too busy for the rest of the week. Unfotuantely you're right that extacting the stuff doesn't help much
wervdon is offline   Reply With Quote
Old June 12, 2003, 19:51   #7
CharlesBHoff
Prince
 
Local Time: 03:24
Local Date: November 2, 2010
Join Date: May 2002
Location: el paso texas
Posts: 512
Some of the files might be encode to stop people from hacking then to make MOD'S.
__________________
By the year 2100 AD over half of the world population will be follower of Islam.
CharlesBHoff is offline   Reply With Quote
Old June 12, 2003, 20:37   #8
wervdon
InterSite Democracy Game: Apolyton TeamC3C IDG: Apolyton Team
Prince
 
Local Time: 21:24
Local Date: November 1, 2010
Join Date: Nov 2001
Posts: 812
I doubt they really thought about it either way at the time, Mods weren't all that common in the early 90s Instead, its more likely its encoded in a way such as to minimize ram usage.
wervdon is offline   Reply With Quote
Old July 5, 2003, 12:03   #9
Urban Ranger
NationStatesApolyton Storywriters' GuildNever Ending Stories
Deity
 
Urban Ranger's Avatar
 
Local Time: 11:24
Local Date: November 2, 2010
Join Date: May 1999
Location: The City State of Noosphere, CPA special envoy
Posts: 14,606
How's the probing coming along?
__________________
(\__/) 07/07/1937 - Never forget
(='.'=) "Claims demand evidence; extraordinary claims demand extraordinary evidence." -- Carl Sagan
(")_(") "Starting the fire from within."
Urban Ranger is offline   Reply With Quote
Old July 5, 2003, 18:51   #10
wervdon
InterSite Democracy Game: Apolyton TeamC3C IDG: Apolyton Team
Prince
 
Local Time: 21:24
Local Date: November 1, 2010
Join Date: Nov 2001
Posts: 812
Honestly, I havent' had time to even think about it until this weekend. I've been working weekends for the past month due the close of the quarter. Ive had the 4th off of course, but hacking moo hasn't been as high on priorities as taking my daughter to the zoo and playing with the 1.10 beta patch for Diablo II.

Kind of where I left off was this though:

We can extract the lbx files into the original individual files.

However, this doesn't get us much closer to modding moo/moo2 as the files are still just as cryptic as they were before being extracted.

Ie) We aren't going to see something like "Laser damage: 5 to 10" or some other easy to decode file format. Instead the 5 to 10 would likely be in some pre-determined position in one of the unamed files inside one of the lbx archives. The position is probally based on the order in tech names though I was guessing.

Im not exactly sure how to go about going further without trial an error really.

I wish I had better news though, I really would like to be able to modify things like the tech trees

I actually think it might be less work overall and have better results in the case of moo1 to just take the route RayK was taking and just recode a moo1 clone open source and go from there. (not that Im about to undertake such a project, again there just aren't enough hours in my day )
wervdon is offline   Reply With Quote
Old July 5, 2003, 22:51   #11
CharlesBHoff
Prince
 
Local Time: 03:24
Local Date: November 2, 2010
Join Date: May 2002
Location: el paso texas
Posts: 512
Many year ago I figure out how to use than hexediting to change the planet data in MOO1 and I haver than writen copy on how to do it. First you need to count bytes from the start of the star name to get the right position in the savegame files. I will post it up one day. I even use the data to make than planet where one wasnot.
__________________
By the year 2100 AD over half of the world population will be follower of Islam.
CharlesBHoff is offline   Reply With Quote
Old July 6, 2003, 05:19   #12
Urban Ranger
NationStatesApolyton Storywriters' GuildNever Ending Stories
Deity
 
Urban Ranger's Avatar
 
Local Time: 11:24
Local Date: November 2, 2010
Join Date: May 1999
Location: The City State of Noosphere, CPA special envoy
Posts: 14,606
Quote:
Originally posted by wervdon
However, this doesn't get us much closer to modding moo/moo2 as the files are still just as cryptic as they were before being extracted.

[snip]

Im not exactly sure how to go about going further without trial an error really.
Yup, that's pretty much what you need to do. I remember the bad old days when we tried to crack RPG saved game files to cheat
__________________
(\__/) 07/07/1937 - Never forget
(='.'=) "Claims demand evidence; extraordinary claims demand extraordinary evidence." -- Carl Sagan
(")_(") "Starting the fire from within."
Urban Ranger is offline   Reply With Quote
Old July 6, 2003, 05:29   #13
cronel
Settler
 
Local Time: 03:24
Local Date: November 2, 2010
Join Date: Jul 2003
Posts: 4
Hi, I've been messing around with the MOO1 files lately, and have figured out a bit, beyond what is already known. But I'm mostly interested in the graphics files right now, so I don't know if it's useful to you guys, as it can't be used to really change the gameplay. And I haven't yet really figured out how to view or change the graphics, because I think they are compressed using some form of RLE. However if you are interested let me know and I'll post the details.
cronel is offline   Reply With Quote
Old July 6, 2003, 09:30   #14
wervdon
InterSite Democracy Game: Apolyton TeamC3C IDG: Apolyton Team
Prince
 
Local Time: 21:24
Local Date: November 1, 2010
Join Date: Nov 2001
Posts: 812
I doubt I go further anytime soon, but you might as well post whatever you know Cronel. It maybe useful to someone down the road, and you never know if everyone posts what little they figure out in one place and then other people take that and build on it, then eventually we might know enough to actually make mods
wervdon is offline   Reply With Quote
Old July 6, 2003, 22:44   #15
CharlesBHoff
Prince
 
Local Time: 03:24
Local Date: November 2, 2010
Join Date: May 2002
Location: el paso texas
Posts: 512
I than not a graphic person but there is a good change that they didnot use standard graphic format at all.
__________________
By the year 2100 AD over half of the world population will be follower of Islam.
CharlesBHoff is offline   Reply With Quote
Old July 7, 2003, 00:17   #16
cronel
Settler
 
Local Time: 03:24
Local Date: November 2, 2010
Join Date: Jul 2003
Posts: 4
Ok, I wrote up a little page with what I could find out. It's here.
cronel is offline   Reply With Quote
Old July 7, 2003, 12:58   #17
Urban Ranger
NationStatesApolyton Storywriters' GuildNever Ending Stories
Deity
 
Urban Ranger's Avatar
 
Local Time: 11:24
Local Date: November 2, 2010
Join Date: May 1999
Location: The City State of Noosphere, CPA special envoy
Posts: 14,606
Good work.
__________________
(\__/) 07/07/1937 - Never forget
(='.'=) "Claims demand evidence; extraordinary claims demand extraordinary evidence." -- Carl Sagan
(")_(") "Starting the fire from within."
Urban Ranger is offline   Reply With Quote
Old July 7, 2003, 20:54   #18
wervdon
InterSite Democracy Game: Apolyton TeamC3C IDG: Apolyton Team
Prince
 
Local Time: 21:24
Local Date: November 1, 2010
Join Date: Nov 2001
Posts: 812
Nice writeup. What color depth does MOO1 run in? I can't recall off the top of my head, i'm sure its either 16 bit or palletized though. I'm just thinking its semi-likely that with moo1 at least there is some pallet information in there.
wervdon is offline   Reply With Quote
Old July 8, 2003, 00:19   #19
vmxa1
PtWDG Gathering StormC4DG Gathering Storm
Deity
 
vmxa1's Avatar
 
Local Time: 23:24
Local Date: November 1, 2010
Join Date: Nov 2001
Location: Oviedo, Fl
Posts: 14,103
Yes that was very well done.
vmxa1 is offline   Reply With Quote
Old July 8, 2003, 02:32   #20
CharlesBHoff
Prince
 
Local Time: 03:24
Local Date: November 2, 2010
Join Date: May 2002
Location: el paso texas
Posts: 512
I play MOO1 on than old 486 with VGA graphic card.
__________________
By the year 2100 AD over half of the world population will be follower of Islam.
CharlesBHoff is offline   Reply With Quote
Old July 8, 2003, 09:42   #21
cronel
Settler
 
Local Time: 03:24
Local Date: November 2, 2010
Join Date: Jul 2003
Posts: 4
Im pretty sure it's palettized, 256 colors. The palettes I believe are found in 'font.lbx', look at this:

Code:
File: moo/fonts.lbx
  (subfilename) offset offset size  comment
00 -   No File 000003A0 928, 11864 (Fonts Style Data)
01 -   No File 000031F8 12792, 652 (Border Style Data)
02 -  EMPERATO 00003484 13444, 5472 (Main game palete)
03 -    VORTEX 000049E4 18916, 5472 (main vortex screen)
04 -   OPTIONS 00005F44 24388, 5472 (options, load, save)
05 -   NEWGAME 000074A4 29860, 5472 (primary new screen)
06 -    CUSTOM 00008A04 35332, 5472 (custom race selection)
07 -  STARVIEW 00009F64 40804, 5472 (star/planet view)
08 -   LANDING 0000B4C4 46276, 5472 (transport landings)
09 -  DIPLOMAT 0000CA24 51748, 5472
10 -   WINNING 0000DF84 57220, 5472
11 -   COPYPRO 0000F4E4 62692, 5472
12 -   COUNCIL 00010A44 68164, 5472
The main game palette is at 13444 in that file, and all the others to the end of the file also are palettes. These are in DAC RGB format, meaning each color is 3 numbers (RGB), in the range 1-63, which is the format that was (is) used when you set the palette directly through the graphics card ("DAC"). I made a little program to verify, that takes the palette from offset 13444 in that file and shows it, and it's pretty obvious it's the right palette , check it out (in the attachment).

So in my opinion all the graphics are palettized, in MOO1 at least.
Attached Thumbnails:
Click image for larger version

Name:	snapshot1.png
Views:	281
Size:	6.3 KB
ID:	49347  
cronel is offline   Reply With Quote
Old July 8, 2003, 17:09   #22
wervdon
InterSite Democracy Game: Apolyton TeamC3C IDG: Apolyton Team
Prince
 
Local Time: 21:24
Local Date: November 1, 2010
Join Date: Nov 2001
Posts: 812
cool, looks like you got it to me.....
wervdon is offline   Reply With Quote
Old July 9, 2003, 04:09   #23
Urban Ranger
NationStatesApolyton Storywriters' GuildNever Ending Stories
Deity
 
Urban Ranger's Avatar
 
Local Time: 11:24
Local Date: November 2, 2010
Join Date: May 1999
Location: The City State of Noosphere, CPA special envoy
Posts: 14,606
How long did it take you to figure all that out, cronel?
__________________
(\__/) 07/07/1937 - Never forget
(='.'=) "Claims demand evidence; extraordinary claims demand extraordinary evidence." -- Carl Sagan
(")_(") "Starting the fire from within."
Urban Ranger is offline   Reply With Quote
Old July 11, 2003, 08:30   #24
cronel
Settler
 
Local Time: 03:24
Local Date: November 2, 2010
Join Date: Jul 2003
Posts: 4
A couple of days.
cronel is offline   Reply With Quote
Old July 11, 2003, 09:03   #25
Harry Seldon
GalCiv Apolyton EmpireNationStates
King
 
Harry Seldon's Avatar
 
Local Time: 03:24
Local Date: November 2, 2010
Join Date: Oct 2002
Location: Birmingham, AL
Posts: 1,595
Hail to the king!
Harry Seldon is offline   Reply With Quote
Old July 24, 2003, 11:42   #26
GhengisFarb™
lifer
Civilization III Democracy GamePtWDG Glory of WarCivilization II Democracy GameCivilization III PBEMC3C IDG: Apolyton TeamCiv4 SP Democracy Game
Deity
 
GhengisFarb™'s Avatar
 
Local Time: 21:24
Local Date: November 1, 2010
Join Date: May 2002
Posts: 11,289
So can we mod the race pics etc? If so I would be willing to crank out some new race graphics.
GhengisFarb™ is offline   Reply With Quote
Old July 24, 2003, 12:02   #27
vmxa1
PtWDG Gathering StormC4DG Gathering Storm
Deity
 
vmxa1's Avatar
 
Local Time: 23:24
Local Date: November 1, 2010
Join Date: Nov 2001
Location: Oviedo, Fl
Posts: 14,103
That would be cool.
vmxa1 is offline   Reply With Quote
Old July 24, 2003, 16:32   #28
wervdon
InterSite Democracy Game: Apolyton TeamC3C IDG: Apolyton Team
Prince
 
Local Time: 21:24
Local Date: November 1, 2010
Join Date: Nov 2001
Posts: 812
You probally would be restricted to the same pallet as above......
wervdon is offline   Reply With Quote
Old July 25, 2003, 10:00   #29
Old n Slow
Civilization II Succession Games
Prince
 
Old n Slow's Avatar
 
Local Time: 22:24
Local Date: November 1, 2010
Join Date: Jun 2002
Location: Vienna, VA
Posts: 781
I checked out some of GhengisFarb's work via his links, etc. -- very fine.

I'm thinking of opening my box of Civ III a year early based upon his stuff.

Now I'll have to scout around for MOO I.
__________________
Those with lower expectations face fewer disappointments
Old n Slow is offline   Reply With Quote
Old July 28, 2003, 13:32   #30
GhengisFarb™
lifer
Civilization III Democracy GamePtWDG Glory of WarCivilization II Democracy GameCivilization III PBEMC3C IDG: Apolyton TeamCiv4 SP Democracy Game
Deity
 
GhengisFarb™'s Avatar
 
Local Time: 21:24
Local Date: November 1, 2010
Join Date: May 2002
Posts: 11,289
Quote:
Originally posted by Old n Slow
I checked out some of GhengisFarb's work via his links, etc. -- very fine.

I'm thinking of opening my box of Civ III a year early based upon his stuff.

Now I'll have to scout around for MOO I.


How much dust in on your Civ III box?
GhengisFarb™ is offline   Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 23:24.


Design by Vjacheslav Trushkin, color scheme by ColorizeIt!.
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Apolyton Civilization Site | Copyright © The Apolyton Team