Announcement

Collapse
No announcement yet.

Civilization III BIC file format (2nd thread)

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

  • #61
    Re: How to compress/uncompress BIX files?

    Originally posted by dreyk
    ... I hope that you know some way to decompress BIX files to make changes and then compress it again .....
    I expect the BIX file compression process is the same as for BIC files. I found this reference describing the actual compression format, and there's Java source code available to implement the decompression in the MapStat Java source. I have successfully ported ChiefPaco's Java code into Objective C, and I'm sure it could be done for other languages.

    It's not essential to compress copies of BIX files using the same format, as you can compress them using WinZip or whatever for efficient transfer over the Internet, and they can be installed uncompressed in the user's actual scenario folder. I suppose there's a bit of a benefit in disk usage, but at a dollar or two per gigabyte these days, disk capacity is not really a big issue.

    -- Alan

    Comment


    • #62
      Thank you, Alan

      At first, thank you kindly for your reply!

      If I understand you quite well (English is not my native language then Civ3 can work with uncompressed BIX files, isn't it?
      If it's true - it's really great!
      Then we can uncompress scenario file (BIX), make some changes with it and then just save file with old name. After we can load this scenario directly from game and play it.
      Please, correct me if I wrong.

      And one more question:
      Maybe you know some way (utility etc.) to compress BIX back after we made changes?
      For example: original_compressed.bix -> changed_uncompressed.bix -> changed_compressed.bix
      Dreyk

      Comment


      • #63
        Re: Thank you, Alan

        Originally posted by dreyk
        At first, thank you kindly for your reply!

        If I understand you quite well (English is not my native language then Civ3 can work with uncompressed BIX files, isn't it?
        If it's true - it's really great!
        Then we can uncompress scenario file (BIX), make some changes with it and then just save file with old name. After we can load this scenario directly from game and play it.
        Please, correct me if I wrong.
        I'm pretty sure that uncompressed files would work for .BIC files. I don't have PTW, so I can't be so sure about .BIX files, but it is unlikely that Firaxis changed it.

        And one more question:
        Maybe you know some way (utility etc.) to compress BIX back after we made changes?
        For example: original_compressed.bix -> changed_uncompressed.bix -> changed_compressed.bix
        It is possible, of course, but I have not seen any code to do it, only the description of the compression algorithm that I gave you. You could write your own compression program using that desription, but why bother if it works uncompressed?

        -- Alan

        Comment


        • #64
          Just load and resave the file with the editor. (If possible without damaging your changes)
          Creator of the Civ3MultiTool

          Comment


          • #65
            Thank you wery mach!

            I have made test and... it's work!
            Get a compressed.bix -> uncompress.bix -> make changes -> save it -> open with editor -> save by editor = compressed.bix with my changes.

            I think, it's enough for my purposes, but maybe I'll write my own compressor... later.
            Dreyk

            Comment


            • #66
              I'm having a question bout .BIX as well. Maybe a silly one, don't know
              My CivIII gives an error when i want to open a BIX-scenario-file. I don't know what the problem is, but I can only open BIC-files...
              Anyone familiar with this?

              Comment


              • #67
                Originally posted by Gurrie
                I'm having a question bout .BIX as well. Maybe a silly one, don't know
                My CivIII gives an error when i want to open a BIX-scenario-file. I don't know what the problem is, but I can only open BIC-files...
                Anyone familiar with this?
                .BIX files only work with PTW.
                "Stuie has the right idea" - Japher
                "I trust Stuie and all involved." - SlowwHand
                "Stuie is right...." - Guynemer

                Comment


                • #68
                  Originally posted by Stuie


                  .BIX files only work with PTW.
                  Ooh, it WAS a silly question then... Maybe i should install PTW

                  THNX A LOT

                  Comment


                  • #69
                    I've taken a first view of the BIQ format, and there are quite some changes. the version is 12.06 and there are many additions to the ed of existing sections. There are also a new FLAV (Flavor) section
                    Creator of the Civ3MultiTool

                    Comment


                    • #70
                      has anyone got any further with the BIX/BIQ-format?
                      - Artificial Intelligence usually beats real stupidity
                      - Atheism is a nonprophet organization.

                      Comment


                      • #71
                        I have... But don't have any documentation of it.
                        Only some comments in my sourcecode to C3MT.

                        And right now I'm playing some games to get ennouge input to be able to update the SGE (and have some fun playing too ).
                        Creator of the Civ3MultiTool

                        Comment


                        • #72
                          Hi, first let me say thanks to all who have contributed to this excellent thread. I have been coding up a small app to do some map tweaking stuff (copy/paste, resizing etc.) and without the information I gleaned from here I would probably never have even started it. This thread has been a real godsend for me!

                          I'm having a problem with my bix reading code and the new FLAV section. It appears to break the regular format of; section header(4 bytes); No of sub-sections(4 bytes); length of this sub-section(4 bytes); rest of sub-section, next sub-section etc.

                          What I see in the FLAV section is "FLAV" then [1,0,0,0][7,0,0,0] then the seven flavour sections, each starting with [1,0,0,0]. Am I going nuts or have they really changed the format for this one section? I can't find a value that corresponds to the section length (292x7) anywhere in the FLAV section either I hope I am wrong here... I just can't see how at the moment.

                          Oh well, if it really is the case that they have changed the format then at least it appears that the FLAV section will be a fixed length.

                          I don't actually need the FLAV section at all as my code is just for map tweaking - I just need to be able to read past the section to get at the map data, it's annoying that the 'generic section reading' code I have won't do it though!
                          Last edited by DrAlimentado; December 30, 2003, 23:28.
                          Civ3DuelZone - Home of the Civ3 PBEM Ladder

                          Map Tweaker Utility beta (copy/paste/resize biq files)

                          Comment


                          • #73
                            I'll see if I can post waht I on Sunday if you can wait until then.
                            Creator of the Civ3MultiTool

                            Comment


                            • #74
                              That would be great Gramphos

                              Thx in advance!
                              Civ3DuelZone - Home of the Civ3 PBEM Ladder

                              Map Tweaker Utility beta (copy/paste/resize biq files)

                              Comment


                              • #75
                                Hi,

                                I'm writing a program that will convert a Civ3 map into a Civ2 map. Right now I only care about converting BIC files.

                                I believe that I have deciphered the "river info" part in the TILE section in BIC files. I'm basing my results on Civ3Edit v1.32.1 for Mac, which creates BIC files of v3.8.

                                The beginning of this thread shows the river info part as:
                                Code:
                                2   short           river info
                                I think it should be:
                                Code:
                                1   byte            river crossing data (binary):
                                
                                                                        00000000
                                
                                                        crossing N      .......1
                                
                                                        crossing NE     ......1.
                                
                                                        crossing E      .....1..
                                
                                                        crossing SE     ....1...
                                
                                                        crossing S      ...1....
                                
                                                        crossing SW     ..1.....
                                
                                                        crossing W      .1......
                                
                                                        crossing NW     1.......
                                
                                1   byte            ??? (0)
                                (How do I indent or preserve spacing without using the [ code ] tags?)

                                The river crossing data is like that posted by Gramphos for BIX 11.18 on page 2 of this thread. It's in a different part of the tile info, though.

                                I have also discovered some subtleties in how the data is stored. Namely, a bit value of 1 is present for the N, E, S, and W parts if the river continues going straight as it leaves the tile or if the river turns along the edge of the tile. However, a the bit value is 0 if the river turns away from the tile as it leaves, or if it is a point where the river begins/ends. The point where a river runs into the sea is an end of the river so it gets a bit value of 0.

                                Edit: If a river touches a corner of a tile but does not run along the adjacent edges, a bit value of 1 is used.

                                These rules seems to work for computer-generated rivers, but if you make your own kooky rivers that run along the coastline, the encoding is a bit different. I don't want to bother figuring it out.

                                Maybe the river crossing data in BIX 11.18 also follows the same rules.

                                I made a picture as I was figuring this out, and it should help illustrate.
                                Attached Files
                                Last edited by darndt; January 3, 2004, 15:57.

                                Comment

                                Working...
                                X