Announcement

Collapse
No announcement yet.

Hacking/Modding Moo1/Moo2

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    Last edited by wervdon; June 10, 2003, 19:44.

  • #2
    I love your ambition, good luck.

    Comment


    • #3
      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, 20:16.

      Comment


      • #4
        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.

        Comment


        • #5
          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, 18:44.

          Comment


          • #6
            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

            Comment


            • #7
              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.

              Comment


              • #8
                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.

                Comment


                • #9
                  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."

                  Comment


                  • #10
                    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 )

                    Comment


                    • #11
                      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.

                      Comment


                      • #12
                        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."

                        Comment


                        • #13
                          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.

                          Comment


                          • #14
                            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

                            Comment


                            • #15
                              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.

                              Comment

                              Working...
                              X