Modding Civilization I - Data Tables

Wow...Good Work!

Now, we could customize Civ 1 to have all European countries playing the game, or all nations from one era, or all American states, or all Native American tribes.
 
I think he's going to focus on making it easier to use before even thinking about new features.
Thanks a lot for all of this, you've definitely added some spice to civilization.
 
Gowron,

I've been following your steps in looking at the disassembled data segment of CIV.EXE (version 474.01), and in addition to everything you already listed, I found the following data regarding Space ship:
  • data segment starts at 0x314B0
  • it is composed of 10 blocks of 26 bytes each, totally 260 bytes
  • each 26-byte block stands for 1 space ship part:
    • offset 0x00: Structure1 (horizontal)
    • offset 0x1A: Structure2 (vertical)
    • offset 0x34: Structure3 (intersection)
    • offset 0x4E: Propulsion
    • offset 0x68: Fuel
    • offset 0x82: NONE (cockpit)
    • offset 0x9C: Habitation
    • offset 0xB6: Life Support
    • offset 0xD0: Solar Panel
    • offset 0xEA: Support
  • the 26 bytes are divided as below:
    • bytes 0 to 11 (12 bytes): a string describing the ship part, padded with 0's
    • bytes 12 to 25 (14 bytes): a series of 7 little-endian short integers, identified as follows:
      • [12 13]: unknown
      • [14 15]: unknown
      • [16 17]: unknown
      • [18 19]: sprite horizontal coordinate (x)
      • [20 21]: sprite vertical coordinate (y)
      • [22 23]: sprite width in pixels
      • [24 25]: sprite height in pixels
  • when restructured, the data looks as below:
    Code:
    'Structure1',  0   0   1   0  16  16  16
    'Structure2',  0   0   1  16  16  16  16
    'Structure3',  0   0   1  32  16  16  16
    'Propulsion',  0   0   4 256  48  32  16
    'Fuel',        0   0   4   0  80  16  16
    'NONE',        0   0   4 192  96  32  32
    'Habitation',  0   0  16 224  96  32  32
    'Life Support',0   0  16 288  96  32  32
    'Solar Panel', 0   0   4   0  96  32  32
    'Support',     0  16 256  96  32  32   0
  • the sprites' locations and dimensions perfectly match the contents of DOCKER.PIC shown below:
    attachment.php
 

Attachments

  • DOCKER.PIC.X0.gif
    DOCKER.PIC.X0.gif
    5.4 KB · Views: 946
Gowron,

I've been following your steps in looking at the disassembled data segment of CIV.EXE (version 474.01), and in addition to everything you already listed, I found the following data regarding Space ship:
While I was aware of that table, I didn't have an in-depth look at it so far.

Thanks for adding it :)

  • bytes 0 to 11 (12 bytes): a string describing the ship part, padded with 0's
  • bytes 12 to 25 (14 bytes): a series of 7 little-endian short integers, identified as follows:
    • [12 13]: unknown
    • [14 15]: unknown
    • [16 17]: unknown
    • [18 19]: sprite horizontal coordinate (x)
    • [20 21]: sprite vertical coordinate (y)
    • [22 23]: sprite width in pixels
    • [24 25]: sprite height in pixels
[12 13] and [14 15] are not variables, this space seems to have been reserved for the strings as well.

[16 17] looks like the mass of the space ship part.

Good job with identifying the graphical values. Comparing them with docker.pic was a smart move :)

when restructured, the data looks as below:
Code:
'Structure1',  0   0   1   0  16  16  16
'Structure2',  0   0   1  16  16  16  16
'Structure3',  0   0   1  32  16  16  16
'Propulsion',  0   0   4 256  48  32  16
'Fuel',        0   0   4   0  80  16  16
'NONE',        0   0   4 192  96  32  32
'Habitation',  0   0  16 224  96  32  32
'Life Support',0   0  16 288  96  32  32
'Solar Panel', 0   0   4   0  96  32  32
'Support',     0  16 256  96  32  32   0
The last line got shuffled.
 
The last line got shuffled.

You're right, it makes a lot more sense that "Support" is actually the "red" style module, which is actually not available in CIV by default... But it can be added by hacking the SVE file and putting one of the Space Ship parts value to "9" ! The result in-game is shown below:

attachment.php
 

Attachments

  • civ_050.png
    civ_050.png
    5.1 KB · Views: 930
I swore I used to edit Civ 1 with a notepad but that's impossible right? I must be confusing it with Civ II?
 
You can edit the introduction text and news blurbs via text editor but that's about it.
 
Here is another contribution. The table for how to position spaceship parts starts at address 0x29E60 in version 475.01. The table consists of 68 entries where each is tree bytes.

relative offset: 0x00
position X

relative offset: 0x01
position Y

relative offset: 0x02
spaceship part as mentioned by darkpanda in post #24

The last position has -1 for X, Y, and part to indicate that there is no more positions. There are five duplicates of structures, which are counted twice towards the spaceship’s weight when built. Placement of components and modules is strictly in the first unbuilt position for the selected part.

Placement of structures, on the other hand, is intended to support components and modules that are already built by selecting between the first unbuilt structure in the components section (position 0-32) and modules section (position 33-66). The selection is based on how far the structure’s position index is from the highest position index of built components or modules, respectively. The structure that is furthest away is selected, with a preference for module structures in case of a tie. If no components or modules are built the reference index is -1, which means a preference for structures in the components section.

On a side note, a component or module is considered supported if it has a structure in one of the surrounding positions. This may potentially give erroneous results when checking for support at the back of propulsion components for Indian and Mongol spaceships. The reason is that these spaceships are last in the data structure for spaceships and there are no boundary checks.
 
I am getting the hang of this finally. I just made it possible to mine an ocean into grassland! Mountains, arctic, and tundra can now be irrigated. Also, I just made it possible for the AI to irrigate or mine under despotism... This is going to be fun to see what happens. :)

Hmm, I don't see government types listed here, where exactly are they? (And can I change them?)
 
Hello Fans,
I know this was possible because i modified my german Version civ.exe with a hex-editor just to give settlers the ability to irrigate/Mine every terrain Type to anything more suiteable to you. So you could make ocean to grassland, mountains tograssland,etc. Some terraforming needed a combiniation of irrigate andere mining, but all was possible.
This modification by hex-editing civ.exe was described in a german game magazine -i believe to 90% it was powerplay, to a very Small degree it was maybe PC Joker or ASM. The Design of the Header of this small article (and the Rest of the page) leads me to this conclusion.
It was a small article AT the bottom of the page (only a quarter of a page maximum) . Some lines Text as an introduction to the article, then a few lines o hex-codes from different adresses . Left Side adress in civ.exe, in the middle the original Code, on the right Side modified Version. The few Bytes that had to be changed were marked with a line under that bytes .
It was done in 2 minutes, just searched for the few marked bytes AT the told position and simply edited that Bytes. Saving file and it was done. But unfortunately i really ddon't knie of i had to unpack the civ.exe. i know the Tool "unp", so it could be possible.
I Made a copy from that page back in that days (20-23 years ago) but lost it some years ago. I still had a Backup, but After a hd-crash.. and searchinge desperately the Internet i am Here.
Need to so some testing...
 
Using the information found here, I was able to change the attitudes of the various leaders. However none of the civilizations seems to be researching technology. Is there a certain combination that makes them more adept to researching techs?
I've made most of the civs aggressive, expansionistic, and civilized..
 
Amazing thread, I used it to change the Chariot attack to 3 in the 474.05 patch. Now the Chariot is no longer so dominant, and there's some point in researching Knights:

char.gif


I'd post the modded exe here, but I'm not sure if it's legal...
 
Another possible easy modification - I made Invention require Philosophy, and Democracy require University. This increases the time to railroads and the no-corruption government, slightly increasing the difficulty of the game for the human player.

I also upped the cost of Diplomats to 50 shields. They are still powerful! Nice that Civilopedia reflects these changes automatically.

And I changed the Republican ruler title from President to Proconsul. It was boring how both Republic and Democracy had the same title.
 
Last edited:
Anyway, I've decided to post my modded *.exe here, since it's, like all other modified files posted in CivII-CivVI modding, useless without the complete game. I also removed the quiz, made building RR's possible in cities, and modified the look of jungle/swamp concentrations with CIVed.
 

Attachments

Thank you for the detailed writeup. I've been trying for hours to understand how to mod the civ.exe files to make some modifications to units but to no avail. Do you think it would be possible to explain it with a little more detail?

Do we need to uncompress the .exe? The link to the unp tool is no good.
How do you use the UNP tool?
I opened civ.exe with a Hex editor but I don't understand the coordinates at all. There is an offset column that starts at 00000000 and goes up incrementally. the numbers and letters don't seem to match the ones in your post. Is there a post or file which specifically explains how to modify these files?

Thank you
 
@rahorvat has written a better unpacker (it retains the overlays so you don't need to have it alongside an unpacked exe)
Thanks for the the reply! Question though..in the readme for that unpacker it says"Just copy CivUnpack.exe (with .dll and .json files) in a directory with CIV.EXE and run." but there is no CivUnpack.exe in the github project folder. There is CivUnpack.csproj. How do I run the program?

Have you had any luck changing the civ.exe with a hex editor. It seems to be really complicated.
 
Just need to go to the releases page and grab the binary, you don't need to compile it yourself

I only tweak things using jcived patches, doing your own hacks is non trivial, and beyond my skill unless someone literally spells out which bytes to change! The jcived program is excellent and let's you change all sorts of things.

EDIT

Just to confirm, I unpacked a v01 EXE with the unpacker, and the offsets described by Gowron in the first post for unit stats checked out, so you could certainly change them that way. JCivEd does not currently support altering unit stats, but can do terrain stats.
 
Last edited:
Top Bottom