Announcement

Collapse
No announcement yet.

Everything on Hex Editing

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    quote:

    Originally posted by Archangel on 05-26-2000 01:04 AM
    Does anyone know if you can hex edit a save file to change the number of units allowed in the game at once?


    I don't think this is possible, but using the technique I described above we might, with a simple program and a new rules.txt and units.gif, be able to have an INFINITE number of units by "rolling over" the tech tree periodically.

    Comment


    • #17
      Even without the Hex-edit you can accomplish this to a certain extent by relying on the AI's eagerness to disband obsolete units and using Leonardo's for the Human player.

      Here is an example I am using in RedFront 1.941:

      There are 3 slots for Soviet fighters. At any time the Soviets have 2 active fighters, A & B and are researching C. A is already obsolete and will be upgraded to B by Leonardo's next time a tech is discovered. When C is discovered, all As become Bs. On the next rules/units load slot A is used for new fighter D and B is made obsolete by the tech required for C... and so on. 3 slots, infinite units.

      Comment


      • #18
        Working on Second Front I made some interesting discoveries for scenario builders:

        -Ship units can paradrop unto landsquares and become immobile...Old news...well not really: If they are transport ships they carry their cargo with them! Now you have air transport!

        -If you build airbases "on" water the ships can start their paradrop from there...This can really made some very interesting scenarios, whether space travel (Star gates?) or Assault Gliders (Second Front)...I can't even list all the ideas I have had about this.

        -Domain 3 units are like helicopters but they act like ships if their trireme bit is set (They sink!) They can't capture cities unlike helicopters, they travel on water and land, they are vulnerable to regular ground fire.

        -The trireme check looks at all surrounding squares to see if there is land but not at the square itself... That means that a land unit with the trireme bit set landing on an size 1 island will SINK! Weird...

        -If you hex edit a city location to be on water, the city continues to exist under water...But becomes invisible except for the name...I haven't fully investigated all it's effects (Like can it be attacked? Can it build land units which appear in the middle of the ocean? Can enemy ships "sail" over it when it has no units in it?)

        And there are many more...

        Comment


        • #19
          Nemo, you're not entirely right on your last point:

          quote:

          If you hex edit a city location to be on water, the city continues to exist under water...But becomes invisible except for the name...I haven't fully investigated all it's effects (Like can it be attacked? Can it build land units which appear in the middle of the ocean? Can enemy ships "sail" over it when it has no units in it?)


          What you saw is the same that happens to a city if you change its coordinates to anything else than it was, also on land squares. What you need to do is change the flag of the terrain on the square you're moving the city to to properly show the city. This is explained by Jorrit Vermeiren (Mercator) in his guide on how to hex-edit the terrains, which I did not include in my hex-editing text because it is so long.

          What you need to do is change one byte on the hex of the terrain where the city is moving to and one on the hex of the square where is stood before to make it complete. Units, obviously, will not move with the city.

          This works well, and a city will be located in the middle of the ocean. It can even grow food, build units (both land and sea and air). However, no land unit will be able to occupy the place, as it cannot "land". Also ships will simply appear to sail "through" it, with no special effect, though located in an enemy city. Only Helicopters are able to conquer the city.

          All in all, your discovery, Nemo, seems to have quite some possibilities. Especially the fact that only heli's can capture it, calls for a special "aquanauts" unit or something to be used to conquer Atlantis. Or of course a Nautilus .

          Comment


          • #20
            Some updates on what I found this week:

            Code:
            START OF SAVED GAME FILE:
            =========================
            A     : 31 : Test of Time
            
            32    = amount of polution. 7F is maximum, and will certainly cause global
                    temperature rising at the end of the turn. A value of 80 till FF
                    is a negative amount (still shows the icon for global rising),
                    but it will be reset to 00 at the end of the turn.
            33    = amount of times that a global temperature rising has been
                    happening this far in the game. 7F is maximum and will make the
                    whole world a big swamp when the next global temperature rising
                    occurs. 80 or higher will prevent any global rising from happening.
                    At the moment when terrain should be changed, nothing happens, and
                    byte 32 is restored to 00, though a message still pops up.
            38    = number of turns of peace (counts only after 200th turn)
            These last three (32, 33, 38) were found on Harlan's request a while ago. Lightbulbs are determined by the amount of research already found rather than that the current colour of the bulb is stored in the saved game. Same for nuclear activity icon.

            Code:
            TECHNOLOGIES & MONEY:
            =====================
            byte 9  - Research progress. Also updates the colour of research
                      indicator in status bar on the right.
            
            byte 15 - Percentages to tax, science and luxuries.
            
            byte 16 - Government. Valid values are 00-07 (though 07 does
                      not normally exist). A value of 08 or higher causes
                      the game to crash. 00 is of course Anarchy, 01 is
                      Despotism, etc.
                      You can give the barbarians Democracy (06) to prevent
                      their cities being subverted.
            
            byte 67-68 - military demographics value.
            Code:
            OTHER
            =====
            
            - 3B1-3B2 bytes after the last city has been finished are the zoom factors. For zooming
                      in, change byte 3B1 only. For zooming out, change byte 3B2 to FF and lower
                      the value of byte 3B1 beginning with FF.
                       note: F9 FF is the lowest zoom you can get. Lowering it further causes
                             the game to crash. There is no limitation when zooming in.
            
            - 583-58A control the size of the city screen.
            Not so many useful new stuff, but I wanted to keep you informed of what news I found.

            I'll also update the first post of the thread now.

            Comment


            • #21
              I was mainly trying to find a way to build a bunch of cities (Up to 255) and place them on water to make them unusable...That didn't work. What seems to work is to place a whole bunch of cities at the same coordinates! They all continue to exist in the game file and use up the extra city spaces, to preventing the building of new cities without taking up a bunch of map space.

              Another very interesting one: Edit city locations to be adjacent...That way you can build mega-cities covering 2, 3 or 4 squares. This would be useful in scenarios where 2 opponents hold adjacent parts of the same city (East-West Berlin, Stalingrad...)

              Comment


              • #22
                Here’s some more stuff on hex editing I discovered while trying to create a formula for determining the location of the city table in the save file. The information already stated in this thread was very helpful towards that end.

                BASIC INFORMATION

                In all Civ2 Formats (all offsets stated in hex)
                Offset 3A-3B: Number of units stored as an integer
                Offset 3C-3D: Number of cities stored as an integer
                Never change these! They are needed to calculate the locations of save file structures such as the city table. Note: integers are stored somewhat in reverse. A decimal value of 294 in integer is Hex'26 01', not Hex'01 26' like you'd expect.
                I deduced these locations from Angelo Scotto’s Civconverter program which states these values when it runs.

                MAP INFORMATION:

                The map header is at a fixed location depending on file format.
                Offset 3586 in FW and later
                Offset 3478 in CIC and earlier

                The map header is 14 bytes long
                ~ Map X dimension : integer (2 bytes).
                ~ Map Y dimension : integer (2 bytes). A 50 by 80 map will show up as 100 by 80 here.
                ~ Map Area: integer (2 bytes) or X times Y divided by 2.
                ~ Flat Earth Flag: integer (2 bytes). 1 = flat, 0 = round.
                ~ Map Seed: integer (2 bytes). I haven’t fooled around with this yet to see if it might change the resource pattern in an active game.
                ~ Locator Map X dimension : integer (2 bytes): equals ‘Map X’ divided by 4 rounded up.
                ~ Locator Map Y dimension : integer (2 bytes): equals ‘Map Y’ divided by 4 rounded up. The locator map is the small map in the corner.

                THE MAP BLOCKS:
                These begin immediately after the header.
                ~ Block 1 contains terrain improvement data, such as irrigation. This block is 7 times the ‘Map Area’ bytes long.
                ~ Block 2 Contains the basic terrain type data. This block is 6 times the ‘Map Area’ bytes long.
                ~ Block 3 is the locator map. It's stored in 2 pieces, each piece being ‘locator map x’ times ‘locator map y’ bytes long.
                ~ Note: Viewing the save file in graphical mode in the hex editor is what allowed me to figure out what these map blocks lengths were. When I oriented the hex editor to start viewing at the beginning of map block 3 and made the width of the display the same as the ‘locator map X dimension’, I could see two little maps! So when you’re looking around a save file, you might want try graphical mode to see the big picture.

                UNIT TABLE
                When you add 1024 bytes to the end of map block 3, you end up at the start of the unit table. Each unit table entry is 26 bytes long and has the ‘number of units’ value stored at offset 3A-3B number of entries.

                CITY TABLE
                It starts immediately after the Unit table (no slack bytes). Each city table entry is 84 bytes long and has the ‘number of cities’ value stored at offset 3C-3D number of entries.
                "Cease fire! Please! Cease fire. What a dreadful waste of ammunition!" -- General Horatio Herbert Kitchener
                --

                Comment


                • #23
                  I must seem out of it, but how do you know which lines to edit? And which is the write set of numbers? I have a hexeditor and I opened up a scenario file, but what do you do exactly?

                  ------------------
                  "There's one more thing you men can say when it's all over and you're home once more. You can thank God that twenty years from now when you're sitting by the fireside with your grandson on your knee, and he asks you what you did in the war, you won't have to shift him to the other knee, cough and say, 'I shovelled **** in Louisiana.'"
                  -General George S. Patton addressing his troops before D-Day landings June 1944
                  Georgi Nikolai Anzyakov, Commander Grand Northern Front, Red Front Democracy Game

                  Comment


                  • #24
                    Allard,
                    Does your latest research on pollution mean that in effect, one can turn off the global warming effect? Edit byte 33 to be 80 or greater, or does that byte reset to 0 somehow?

                    If so, Capt. Nemo, you could have the Allied bombing of Germany actually be nukes that create rubble (in fact, pollution) that would cut the productivity of squares around the cities, and soften up defenses, allowing Allies to conquer places when you want them to. Better than rubble as units.

                    Comment


                    • #25
                      Nemo, I wasn't talking about changing the amount of units in the units.bmp file, but the actual amount the map will hold. Like in Red Front, how sometimes you get the "too many units" message and new units won't be created. I want to know if you can hex edit that problem.

                      Comment


                      • #26
                        sorry, haven't been online too often lately, so I couldn't update this thread.

                        Gothmog, very interesting!!! I think we now understand the building of the saved game pretty well. And what's funny is that the saved games of Colonization and even civ1 are pretty similar.

                        quote:

                        Another very interesting one: Edit city locations to be adjacent...That way you can build mega-cities covering 2, 3 or 4 squares. This would be useful in scenarios where 2 opponents hold adjacent parts of the same city (East-West Berlin, Stalingrad...)


                        Always trying to make things practical... Serious, this is very cool! Wow! And if you change the background terrain too a bit you can even make it look like one big city.

                        quote:

                        I must seem out of it, but how do you know which lines to edit? And which is the write set of numbers? I have a hexeditor and I opened up a scenario file, but what do you do exactly?


                        it's really very easy. before I started I almost knew nothing about hex-editing myself. It's all pretty obvious. If you have a good editor it will tell you (usually somewhere at the bottom of the screen) what the offset is of the currently selected hex. The layout of the saved game is explained at the start of my first post. And you see that using FW until the map info everything is always at the same offset. After that it starts to be variable, but mostly it is pretty clearly visible when going from one area to the next. Watching the LAYOUT chapter should explain it mostly to you.

                        quote:

                        Does your latest research on pollution mean that in effect, one can turn off the global warming effect? Edit byte 33 to be 80 or greater, or does that byte reset to 0 somehow


                        Yes. If you turn byte 33 to be 80 you can switch off global warming completely. I'll try to explain it in some more details so that everybody understands it, even without knowledge of hex-editing.

                        The thing is, normally byte 32 and 33 both stand at 0. If there is pollution, byte 32 gets higher and higher, and at a certain amount global warming will happen. Maybe there is a x% chance of this happening determined by this byte. If global warming happens, byte 32 is reset to 00, and byte 33 is set to 01, which is logical, cause if byte 32 would not be reset to 0, there would be again a chance of global warming. This goes on and on, and byte 33 gets higher after every global warming.

                        However if you set byte 33 higher than 7F, the max, byte 32 will still get higher, of course still causing global warming still to occur, which causes the pop-up. Normally, it will cause a 1st, a 2nd, a 3rd.. to a 7Fth rate global warming, determined by byte 33, but since that is turned to a strange rate, nothing happens at all, and byte 32 is reset without anything happening.

                        Byte 33 remains at 80, and appears to remain so every time again.
                        This makes a foolproof anti-global warming tool that allows pollution. Two things still have to be taken care of, which could if used right give some extra fun. The icon for pollution itself, and the pop-up message (with a nice little logo of the game).

                        quote:

                        Nemo, I wasn't talking about changing the amount of units in the units.bmp file, but the actual amount the map will hold. Like in Red Front, how sometimes you get the "too many units" message and new units won't be created. I want to know if you can hex edit that problem


                        The amoung of units in the units.gif/bmp file SHOULD be changeable. After all, that's what they did changing from CiC to FW, and that change was so minor, you might be able to track it down. In the file civ2.exe of course, not in a saved game.
                        The too many units/cities will be probably trickier to change. It still could, but you'd have to insert a byte, I guess, screwing the whole file up. To fix that you'd need a lot of expertise. Maybe some expert at programming or hacking might explain how to do this. I mean, it should be possible. You could change anything if you wanted.

                        Both problems anyway could only be changed by editing the civ2.exe file, which I haven't done yet, so I know nothing about it (except changing the font the game uses). And both are pretty tricky.

                        Comment


                        • #27
                          To Nemo - ship paradropping and the other stuff ...

                          Are you sure about that?
                          I planned an year ago to realize a scenario on the "One Year War" ( the "Gundam series", do you know? ). If this trick works for true, it'll be a lot useful in order to perform Zion Komusai landing on Earth...
                          "Io non volgo le spalle dinnanzi al nemico!!!" - il Conte di San Sebastiano al messo del comandante in capo, battaglia dell'Assietta
                          "E' più facile far passare un cammello per la cruna di un ago che un pensiero nel cervello di Bush!!!" - Zelig
                          "Live fire, and not cold steel, now resolve battles" - Marshall de Puysegur

                          Comment


                          • #28
                            I'm sorry if it's already mentioned here, but does anyone know which hex value specifies which wonders are already build/ destroyed?
                            Could you even create multiple wonders?
                            Civilization Webring Forum

                            Comment


                            • #29
                              quote:

                              I'm sorry if it's already mentioned here, but does anyone know which hex value specifies which wonders are already build/ destroyed?
                              Could you even create multiple wonders


                              That's a great question!! Thanks to you I uncovered 3 more lines of the file. Here comes the new stuff, it's also updated in the main story.

                              As you see, it's unfortunately not possible to create the same wonders multiple times. If it would have been listed as one of the city improvements with the city information stuff, it would have, but this makes it strictly buildable only at one place.
                              Here comes the info:


                              Code:
                              WONDERS:
                              ========
                              
                              Near the start of the saved game, on offset 10A until 141 are given the
                              locations of all wonders. All 28 wonders have 2 bytes, so in total the
                              block for all wonders is 56 bytes long.
                               If the 2 bytes for a wonder are
                                  - FF FF : the wonder has not yet been built.
                                  - EF FF : the wonder is destroyed (original city is not stored).
                                  - otherwise the number is the city ID number. 00 00 the first city, etc.

                              If you come up with more interesting questions...

                              Comment


                              • #30
                                Thanks for looking at my post. Do you know a good hex editor, that's free? And if not, anything that's good!
                                Georgi Nikolai Anzyakov, Commander Grand Northern Front, Red Front Democracy Game

                                Comment

                                Working...
                                X